interfering with eeprom?
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 Baker
Propeller Applications Engineer
Parallax, Inc.
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
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
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.
Regards,
David
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
E3 = Thought
http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
[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
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.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
E3 = Thought
http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
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
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
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.