Problem getting I2C to work
blacksheep45
Posts: 41
I have set up the circuit the way it is in the·Basic Stamp·syntax and reference manual and i am using the sample code I2C.bsp, but this is not working. When the code is at the reading part it debugs "Error at location 000" "Found: 255, Expected: 000".
I am not sure what is wrong, can someone help.
Kind Regards
Shaun
I am not sure what is wrong, can someone help.
Kind Regards
Shaun
Comments
Regards,
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Parallax Tech Support·
Here is the code that i am using.
Kind Regards
Shaun
You may want to post a high-resolution picture of your circuit as well. We may spot something from that.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
The output you showed suggests that the writing is not occurring. Did you connect WP (write protect - pin 7) to Vss (ground)?
I have connected WP to Vss, as well asA0, A1, A2 and Vss.
Pin 8 (Vdd) on the EEPROM is connected to Vdd as ar pins 5 and 6 via a 4700 ohm resistor.
Pin 5 on the EEPROM is also connected to pin 0 on the BS2p40
Pin 6 on the EEPROM is also connected to pin 1 on the BS2p40
I hope someone can help. I will try to get a pic of the circuit tomorrow.
Kind Regards
Shaun
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Deus tantum me iudicabit
The PBasic Manual describes how to produce a two byte address with the I2CIN and I2COUT statements.· I don't have mine handy, but it's pretty clear
Post Edited (Mike Green) : 1/20/2009 12:02:45 AM GMT
·· There is no need for the picture now...you have provided the information that was missing.· Your initial post indicated everything was the same as the example, but in fact you're using a different chip which is not directly compatible with that code (as Mike idientified).· This is why it is important to be clear about details and provide as much information as possible.· Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
So does this mean that the low address is only used after·the address 255 on the EEPROM, also·using the sample code that i attached earlier, would i put the \low address after addr·variable? or after the block variable on the I2C commands. I would have thought after the addr but im not 100%.
Thank you for the code PJ Allen however, i only have a bs2p just now, so i was wondering if anyone had code for this using a BS2p.
Kind Regards
Shaun
·
**
sorry kelvin but that code is not working either, it just displays 255 fifteen time accross 1 row, im guessing its supposed to display all the numbers in the string instead.
I think it must be my wiring that is wrong, i have taken pics of the circuit but i cant find the cd with the software to connect my phone to my computer, but i'll post them as soon as i can.
Kind Regards
Shaun
Regards
Shaun
**
kind regards
Shaun