Shop OBEX P1 Docs P2 Docs Learn Events
OS and Tile with Spin Stamp — Parallax Forums

OS and Tile with Spin Stamp

NewzedNewzed Posts: 2,503
edited 2007-03-10 22:21 in Propeller 1
For Mike Green:

Good evening, Mike.

I just about have·my new·board for the Spin Stamp finished.· When they become available, I would like to run your OS plus Chip's Tile program - same thing I am doing now with the Prop.· Would I have to do anything other than change the keyboard pins in the CON block and VGA start pin in the program.· Spin Stamp has no EEPROM, but I would leave OS_loaderInit and OS_loader in as objects since they might perform some function I am not aware of.

Thanks

Sid

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.

That is why they call it the present.

Don't have VGA?
Newzed@aol.com
·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-10 00:32
    I don't think you'd have to do anything else. The only I/O devices are the keyboard and display. The initialization routine might try to access the EEPROM. If so, you could comment that code out.

    The OS_loader and OS_loaderInit are needed as things are written. They also can be used to access other I2C devices and EEPROMs on any pair of I/O pins.
  • NewzedNewzed Posts: 2,503
    edited 2007-03-10 00:46
    Mike, I can attach an EEPROM to pins 10 and 11, with pullups.· Would that do it if I change the pin assignment in OS_loader?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-10 04:37
    You don't need to change any pin assignments. OS_loader is designed to work without changes with any pair of I/O pins. Read the comments at the beginning. You'll see that the pin number of the (even numbered) clock pin is part of the address passed to the OS_loader.
  • Damien AllenDamien Allen Posts: 103
    edited 2007-03-10 13:11
    Hi Newzed you say in your first post that there is no eeprom on the spin stamp, are you sure thats true? I haven't recieved mine yet but I believe it would contain a voltage regulator, eeprom, crystal or resonator and maybe even a brownout detector. I would have thought the crystal wouldn't be removable though. Maybe Paul Baker or Ken could clarify this?
  • NewzedNewzed Posts: 2,503
    edited 2007-03-10 14:14
    Damien, I said that wrong.· What I meant was there is no external EEPROM.· I think the embedded Spin Stamp EEPROM works just like the Stamp EEPROM, although I don't know what size it is.· I plan on adding an external EEPROM to my new Spin Stamp board, probably a 24LC512.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • NewzedNewzed Posts: 2,503
    edited 2007-03-10 14:37
    Mike, let me make sure I understand.· My EEPROM is wired SCL Pin 10 and SDA Pin 11.· OS_loader says:

    · maxPinPairs = 16
    · i2cBootSCL· = 28
    · i2cBootSDA· = 29

    I change maxPinPairs to 8 and leave the SCL/SCA pin assignment unchanged, even though there are no pins 28 and 29.

    Same with OS-loaderInit?· ·i2cBootSCL· = 28·- leave unchanged.\

    And with all of this, Spin Stamp will find the EEPROM, whether it is on 10-11, 12-13 or 14-15?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • CJCJ Posts: 470
    edited 2007-03-10 15:07
    the boot eeprom is on the same pins, just the pins are not brought out

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Parallax Forums - If you're ready to learn, we're ready to help.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-10 15:47
    Please DO NOT change any of the constants you've mentioned. The routines will not "find" the EEPROM, you have to include the pin number of the SCL pin as part of the EEPROM address when you call the read/write routines. The comments at the beginning of OS_loader describe how the EEPROM address is put together. This is taken from that comment block:
    '' The EEPROM address is in the same format used by other routines with the I/O pin pair
    '' in bits 21..19, the device address in bits 18..16, and the 64K address in bits 15..0.
    '' Note that the I/O pin pair is the number of the SCL pin divided by 2.
    


    In your case, assuming the device address is zero (A0-A2 are grounded), the address of the first byte of the EEPROM on pins 10-11 would be "10 << 18 + 0". The shift count of 18 positions the pin number properly since the I/O routines don't use the least significant bit (because the pin # is always even).

    Post Edited (Mike Green) : 3/10/2007 3:52:44 PM GMT
  • RsadeikaRsadeika Posts: 3,837
    edited 2007-03-10 15:54
    To answer Damien's question, yes the SpinStamp has an eeprom, voltage regulator, and a 10MHz crystal. So, you will have to specify a freq = 10_000_000, and a pll8x, to get it to work properly. I had a SpinStamp, until it died unexpectedly, so I sent mine back to Parallax, to let them figure out what happened to the thing. Not sure if I am going to get it back or not.
  • Damien AllenDamien Allen Posts: 103
    edited 2007-03-10 16:16
    do you happen to know how much current the regulator can supply? I may need to power a maxstream xbee or xbee pro module off of it if possible which I think is 200mA max?
  • NewzedNewzed Posts: 2,503
    edited 2007-03-10 17:33
    Damien, my board will have a 5V and a 3V regulator, both rated at 1A.· I have
    the 5VDC ported to a 4-pos header, but I still have to find a place to port
    out the 3VDC.

    Sid





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • NewzedNewzed Posts: 2,503
    edited 2007-03-10 21:54
    Mike, does this look right so far?

    PRI ReadByte(location) : contents
    · ldr.readEEPROM(10 << 18 + location, @contents, 1)

    PRI ReadWord(location)
    · return ReadByte(location+1) << 8 | ReadByte(location)

    ····addr := ReadWord($F618)

    ··· WriteWord(addr, t1, t2, t3)······· ·'send all 3 words at once, or,

    ··· WriteWord(addr, t1)
    ······ addr := addr + 2
    ··· WriteWord(2, t2)
    ······ addr := addr + 2
    ··· WriteWord(4, t3)
    ······ addr := addr + 2
    ··· WriteWord($F618, addr)··· 'store current addr at end of EEPOM

    PRI WriteByte(location,contents)
    · ldr.writeEEPROM(10 << 18 + 0, @contents, 1)· 'Is 1 the no. of bytes written?
    · waitcnt(clkfreq / 50 + cnt)········ ' Pause briefly (20ms) to allow write cycle to complete

    PRI WriteWord(location,contents)
    · WriteByte(location+1,contents >> 8)
    · WriteByte(location,contents & $FF)

    Sid




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-10 22:21
    Sid,
    Your routines (ReadByte, ReadWord, WriteByte, WriteWord) look mostly ok. WriteByte has a typo ("10 << 18 + 0"?). The "1" is the # of bytes to be written as you noted.

    The stuff in-between ReadWord and WriteByte doesn't make much sense ("WriteWord(4,t3)"?). I'm sure you can straighten it out.
Sign In or Register to comment.