I2C Troubles!!
jokerswild
Posts: 31
Hi!
I'm having weird problems with my BS2px24 when i use I2C.
I don't get any SDA or SCL output when both are connected to the device i'm controlling with 4.7k pull-up resistors in place. If i remove the SCL line i can get SDA output but i can't get SCL with SDA disconnected. If i only have the BS2 and pull-up resistors in circuit i get the same problem.
Both pin 1 and 9 work normally with other operations.
i need help!!!
BTW i use the basic schematic in the PBASIC 2.2 docs for the I2C connections.
I'm having weird problems with my BS2px24 when i use I2C.
I don't get any SDA or SCL output when both are connected to the device i'm controlling with 4.7k pull-up resistors in place. If i remove the SCL line i can get SDA output but i can't get SCL with SDA disconnected. If i only have the BS2 and pull-up resistors in circuit i get the same problem.
Both pin 1 and 9 work normally with other operations.
i need help!!!
BTW i use the basic schematic in the PBASIC 2.2 docs for the I2C connections.
Comments
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
· If your set-up is solid, then please post your program.
I've got the wiring correct for I2C. I use pin 0 for SDA and pin 1 for SCL.
This is the basic code i'm using. I'm not 100% sure of the slaveid but i can't get any output from the BS2 with both SDA and SCL connected correctly.
If i run the program with SCL disconnected and then connect while SDA is outputting, the program stops.
I've even tried just a I2COUT command with all the values written without constants or variables, ie
···· I2COUT 0, $78, $40, [noparse][[/noparse]0]
and still no luck.
The graphics LCD i'm using is based on the PCF8558 controller.
help!
Try --
With:
SDA PIN 0 ' I2C SDA pin
SCL PIN SDA + 1
I guess you're trying to declare the I2C pins or something, but that's not necessary, it's a function of the I2CIN/OUT Pin statement's being 0 or 1 (it's all taken care of for you.)
I've already tried using different expressions for the PIN field in the I2COUT command without any success.
Like i mentioned before i've also tried I2COUT 0, $78, $40, [noparse][[/noparse]0] without any variables, pin identifiers or constants also without success.
It's beginning to seem like there is a problem with the BS2 itself. I can use pins 0, 1, 8 and 9 for other operations like high, low, freqout, pwm etc all without fault, only seems with I2COUT i have problems.
Are there any related functions to I2COUT other that I2CIN i can use to determine if my BS2 is functioning properly?
Earlier you said you had a BS-2px24 and now you're saying you have a BS-2. If it really IS a BS-2 and not a BS-2p that's your problem. The BS-2 does not support the I2C commands.
If it is a BS-2p or higher, what specific device are you trying to access?
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
The graphics LCD I'm trying to use is from an Ericsson A1018s mobile phone and is controlled by the Philips PCF8558 universal graphics controller. Here is a link to the Philips datasheet:
http://www.semiconductors.philips.com/acrobat/datasheets/PCF8558_2.pdf
With SDA and SCL both connected with 4.7k pull-up resistors to 5V i don't get ANY output. With SCL not connected i get SDA output.
I should be able to see both SDA and SCL data when using I2COUT without any device connected, just pull-up resistors in place.
Bruce-
I am using a BS2px24 IC. My laziness not typing the full name in. sorry!
Thank you both for your replies!!
What are you doing with pin SA0 on the PCF8558? I suspect it should be tied directly to Vss, and not left floating.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
The LCD has the PCF8558 embedded in the screen so i'm not sure if SA0 high or low, thats why i'm not 100% sure if the slaveid is $78 or $7A.
Perhaps i'm not asking my question correctly.
If i have the following circuit and run the command
I should see the SCL pin 1 pulse clock signal and SDA pin 0 pulse $78, $40 etc ?
Using my scope i can only see the SDA signal and only when SCL is NOT connected to anything.
If i run the command with SCL connected as shown in the circuit i get no output from either pin.
I think I can see where your problem may be. I2C is an entire protocal, which includes communication prefixes and sequences, such as "START", "ACK", "STOP", etc. Depending on the particular period in the protocal sequence, unless you knew exactly what to expect, and both master and slave are active and accessable, and the proper commands have been issued and acknowledged, in the proper order, something as short as the electrical sequence you're seeing may be all that you will see.
Unlike synchronous serial data transmission (Microwire, SPI, 3-4 wire serial, etc), there aren't simply clock signals traveling across the clock line, and data bits traveling in sequence across the data line. The clock and data lines are used in combination for "signalling" between the master and the slave, and the data line carries prefixes and suffixes beyond the actual raw data.
I hope that makes some sense to you. Otherwise, it's slogging through the entire Philips I2C Manual to really understand it at the root level. If you do end up doing that - bring lunch!
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Post Edited (Bruce Bates) : 5/30/2006 9:09:40 AM GMT
kelvin
Its just strange that i have no data transmission when i have both SDA and SCL connected but SDA without SCL connected.
Anyway ive got a DS1337 realtime clock which uses I2C and i have all the info for that so i might try and get that working first.
I appreciate your comments Bruce and PJ Allen.
kelvin-
the slaveid is an 8 bit string, so 01111000 is $78. lsb is the SA0 with allows 2 controllers to be connected to the same line, which makes it 01111001 or 01111000 ($7A or $78).
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
www.xs4all.nl/~lous/i2c_lcd/lph_i2c.htm
Post Edited (kelvin james) : 5/31/2006 5:55:00 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
One end of each resistor goes to SCL and SDA repectively. Where have you connected the other end of each resistor? What voltages are you reading at that connection, before and after the resistors are connected?
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
I've got a one-wire ADC that works on any of the pins of the BS2px so it seams strange..
First, are you SURE the LCD from the Ericsson A1018s mobile phone is a 5 volt device? Many, if not most, mobile phone "attached accessories" (today) are 3.3 VDC or lower.
Second, what is feeding power to the LM7805?
Third, are you using capacitors on the input and output of the LM7805, as shown in this somewhat generic LM78xxx schematic?:
http://www.national.com/pf/LM/LM78L05.html
Do you have an ampacity budget for all of the items you're running off of this LM7805? If not, I'd suggest going through that exercise, since you can only pull 100 mA TOTAL from it, and the BS-2P is going to be pulling 40 mA or 40% of that budget all by itself!
If it's not apparent from my various questions, my thinking is drifting towards possible sagging or lowered input power/voltage from the +5 VDC source. This has been one of the more interesting and challenging problems of late! Congradulations
BTW - Approximately how old (in months or years) is this BS-2P you're using?
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
pete
All other functions appear to work correctly.
Big thanks for the helpful pointers guys.
Time for an ESD prevention plan I think.