Shop OBEX P1 Docs P2 Docs Learn Events
interfering with eeprom? — Parallax Forums

interfering with eeprom?

ThePenguinMasterThePenguinMaster Posts: 89
edited 2007-07-27 23:52 in Propeller 1
hey guys, i have a simple question.. its dealing with the pins 28-31. i need to free up as many pins as possible for my project, and i was wondering if it would mess up anything if i were to also connect pins 28-31 to the 4 resistors used for tv output, and after loading was compleate, i could out put to them without interfering with the eeprom? would it be ignored or is there a possibility itll screw up my eeprom. of coarse i believe i would add diodes to prevent any signal from flowing out into the eeprom.

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-07-25 18:51
    ideally you would not connect the clock (SCL) that way there is no possibility for interference with the EEPROM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-25 18:58
    The problem is the cross connection through the resistors to the other pins. You need some kind of switch to disconnect the TV resistors until after the Prop is finished initializing itself and you could probably run the switch off a 555 timer with a 1 second or 1/2 second delay from the end of the reset pulse.

    It's much easier to just use some kind of I/O expander part. The PCA9554AN from NXP is an 8-bit expander. The MCP23017 is a 16 bit part. Both attach (compatibly) to pins 28/29 and use the same I2C protocol as the EEPROM. I use a PCA9554AN for my Prop BoeBot to connect the HM55B compass. Have a look at the BoeBotBasic source in the Object Exchange for Spin code to access the expander.

    You'd use the PCA9554AN to provide 8 extra I/O pins to replace pins 24-31 which you'd use for the TV output, the EEPROM and I/O expander, and the serial programming port.· You can always add additional PCA9554AN parts to get more I/O pins.· You can add up to 8 of them.

    Post Edited (Mike Green) : 7/25/2007 7:05:09 PM GMT
  • ThePenguinMasterThePenguinMaster Posts: 89
    edited 2007-07-26 01:47
    the only reason i didn't run to the i\o expander is because.. well i dont know how to use serial communications yet [noparse]:([/noparse] why? well I'm not really sure.. but i think i should pick that up because the expander might make things a little easier..
  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-26 05:11
    The I/O expanders mentioned are all I2C which is serial, but different from asynchronous serial and different from SPI. The datasheets for the parts have some discussion of the protocol. There are two or three sets of routines in the Object Exchange for doing I2C with the Propeller.
  • deSilvadeSilva Posts: 2,967
    edited 2007-07-26 06:33
    For just an overview about I2C have a look at this graphically impressive Philips presentation
    www.nxp.com/acrobat_download/various/i2c_overview_2h_2003.pdf

    BTW: There is often some confusion about how many I2C devices (of the same kind) can be connected to one bus: All device types have a built-in address of 4 bit, adding to pin programmable 3 bits (generally called A0, A1, A2). To allow more than eight devices, many I2C chips are produced with two different built-in addresses, the variant has the postfix "A". So you cannot exchange an "A" type with the standard type without changing the software!

    On the other hand 16 is a very small number, thus there are is a lot of address overlapping which is a main cause for confusion and superfluous debugging.Consult the datasheets in every case! This overlapping can of course be easily resolved by pin-programming of A0,A1, A2

    Post Edited (deSilva) : 7/26/2007 6:38:45 AM GMT
  • ThePenguinMasterThePenguinMaster Posts: 89
    edited 2007-07-26 12:51
    ok i like the idea of an i\o expander and i think its something id like to use.. as long as i can keep up the speed.. itll slow things down a little but with the speed of the prop it wouldn t be a huge deal. the part thats a little scary tho is i wanted to do some basic routines for my hard drive driver in assem.. but im not that good. basic reads and wrights to ports dont seem to bad.. but id have to include an ic2 driver embeded into it, which seems a little more intimidating. i could try to use the one that is on the object exchange. i can see how it works now and it dosnt seem as bad as i thought. so what your saying is that i might have to worry about the signal from the eeprom being sent out to the tv right? so what if i used a transistor to form an electronic switch and when something is triggering the programming, it will disconnect the resistors from the chip.. maybe what i can do is have it so when there is no signal comming out of say.. p7, then the tv is disconnected.. but when my program starts running it will initialise the tv and then bring p7 to high, thus enabling the tv pins... if i could sacrifice one pin to save 4 then it would probibally be worth it.. think that might work out?

    oh and thanks for the input on the io expander.. i realise its somnething i need to learn.. oh and good job on the ic2 object mike green.. lots of comments really helps a lot.
  • DroneDrone Posts: 433
    edited 2007-07-26 13:35
    There are alternatives to I2C serial expanders, like the relatively inexpensive and easy to find 74HC595N 8-bit serial in parallel out (SIPO) shift register or the higher current 8-bit shift registers ike Texas Instruments TPIC6595. These parts daisy-chain. So four of them give you 32 outputs that can be loaded from a 32 bit long. They have output enables so you can load the shift registers in banks using the same serial I/O pins. If you have a lot of banks of shift registers enable them through a decoder demultiplexer like a 74HC138/238/154 to save some pins. Use parallel in serial out (PISO) shift registers to expand inputs. These parts are fast too.

    Regards,

    David
  • RinksCustomsRinksCustoms Posts: 531
    edited 2007-07-26 16:21
    Might you be interested in a board like this? The principal of the board is to have 45 "full speed" I/O's at any given time.





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    E3 = Thought

    http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
  • ThePenguinMasterThePenguinMaster Posts: 89
    edited 2007-07-27 02:14
    ok yep.. i\o expander it is! lol and a new prop setup lols.. just so you guys know.. your right .. it wont work, and it'll probabibly fry something.. too bad i didn't even get to see the smoke come out. so basically i tried it and it wouldn't work quite right.. because when RX is activated it shorts through the TV.. but also screws something up on the board. i disconnected everything and went back to the default setup.. now i can check the propeller version, but when i go to upload a program it says loading ram.. then verifying ram.. then it says 'prop chip lost'. also i noticed that when sending it the red light on my prop plug doesn't blink any more? hmm.. sounds like i fried something on either my propeller or my prop stick.. but which?...

    [noparse][[/noparse]edit]

    oh but the tv did work fine while connected in that configuration lol just in case anyone was wondering

    Post Edited (ThePenguinMaster) : 7/27/2007 2:27:59 AM GMT
  • Marc GebauerMarc Gebauer Posts: 60
    edited 2007-07-27 03:28
    I'm using the PCF8574 I/O expander with the basic_i2c_driver and wrote the following routines that have worked reliable for me with 8 devices on the same i2c bus as the prop's eeprom:

    OBJ
    · i2c·········· : "Basic_i2c_Driver"


    PUB· PCF8574_read(scl,addr)
    ''PCF8574 port expander read routine·
    · i2c.Start(scl)·····················
    · if i2c.Write(scl,addr+i2c#Recv)
    ··· abort ' an error occured during read······························
    · result:=i2c.Read(scl,i2c#NAK)······
    · i2c.Stop(scl)

    PUB· PCF8574_write(scl,addr,data) : ackbit
    ''PCF8574 port expander write routine
    · i2c.Start(scl)
    · if ackbit := i2c.Write(scl,addr+i2c#Xmit)
    ··· abort ' an error occured during the write·························
    · if ackbit := (ackbit << 1) | i2c.Write(scl,data)
    ··· abort ' an error occured during the write·························
    · i2c.Stop(scl)

    The·PCF8574 is a quasi in out device. So check·the data sheet to see if it will serve your purpose. FYI the addr for the first device is %01110000. Bits 1,2 and·3 are used for addressing devices 0-7.·A 1 in bit·0 declares a write.

    Any way as you can see it's pretty easy.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • RinksCustomsRinksCustoms Posts: 531
    edited 2007-07-27 05:48
    Penguin - try another prop clip/plug, sounds like you shorted something on it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    E3 = Thought

    http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
  • ThePenguinMasterThePenguinMaster Posts: 89
    edited 2007-07-27 12:36
    yah i just ordered another.. well i guess at least im contributing to a great cause! is there much of a slow down when using i\o expanders? or are they almost as fast? the only thing i can see that might slow it down would be the repeate in the ic2 class..

    so wheres a good place to buy or sample the PCF8574? newark charges an arm and a leg for shipping and handeling.. like 15 bucks on a 5 dollar part..

    Post Edited (ThePenguinMaster) : 7/27/2007 12:40:50 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-27 13:27
    The usual clock for I2C is 100KHz and an 8-bit read will take 3 to 4 frames of 10 bits so we're talking about roughly 2 thousand bytes per second. Writes are faster since they need fewer frames.

    The MAX7300 from Maxim is another I2C I/O Port Expander that's available in PDIP packaging and Maxim is very nice about providing samples. It's a larger part (24 pin) and has 20 I/O pins, each usable as an output or Schmidt trigger input with or without a pullup.

    www.maxim-ic.com/quick_view2.cfm/qv_pk/3376
  • ThePenguinMasterThePenguinMaster Posts: 89
    edited 2007-07-27 23:52
    ok i found the Texas instruments site and found the samples section.. i ordered tow io expanders o experiment with, and my new prop plug should show up around the same time.

    i did look for the maxim chip but i guess they dont have any samples for the dip package, they might be out or something.. i have ordered samples from them again.. you have to admit its pretty cool that they give samples like that.. props to them lol.
Sign In or Register to comment.