LK202-25 and PIC 16F876 I2C Problems

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
BeerMug
LCD?
Posts: 5
Joined: Tue Oct 03, 2006 7:03 am

LK202-25 and PIC 16F876 I2C Problems

Post by BeerMug »

The situation consists of an LK202-25 display and a PIC 16F876 executing the PIC application note 725 programs (modified with slave address 0x50). I can monitor the SCL/SDA lines and see the correct slave address bits are transmitted. The LK202 does not respond with an ACK. Both the SCL and SDA have 10K pullup resistors at the PIC.

Executed the display tuner program from Matrix using a laptop and an RS232 cable. Sent 'set I2C address =0x50" just to be certain. Still no ACK from the display.

This is my first move into I2C ... the goal is to display the values in a few registers, moving the data to the display over the I2C interface. The MicroChip program(s) were compiled with MPLab v7.42.

Any ideas/suggestions/comments welcome!
Raquel
Matrix Orbital
Matrix Orbital
Posts: 834
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Post by Raquel »

Hello BeerMug,

Thank you for your post.

I know that you may have already done so, but you did not mention it, so I just want to clarify: when you move from I2C to RS232 (and vice versa), you need to move the jumpers. Can you please tell me the PCB rev of your LK202-25?

Also, please make sure that when you write the code for PIC16F876, assign the slave address to be 0x50. Something like:

SSPADD = 0x50;

Please let me know if this changes anything.
Raquel Malinis
Design and Development
Matrix Orbital
BeerMug
LCD?
Posts: 5
Joined: Tue Oct 03, 2006 7:03 am

Post by BeerMug »

The slave address transmitted = 0x50 (with the msb 0 suppressed for a 7 bit address). This has been verified by monitoring the I2C SCL/SDA lines with a scope. At the end (the 9th SCL), the SDA line stays high = no ACK from the display.

Jumpers? Have read the user manual several times, and done a search through the pdf file for "jumper" ... the only jumper mentioned is the master reset jumper. Am I banging my noggin on the wall because I missed a simple "add a solder blob here" statement? How cruel...but I'll take the hit if that gets this project moving !!

Thanks very much for your time and support. Can you describe the "jumpers" ?? BTW - I have pcb rev 1.50
Raquel
Matrix Orbital
Matrix Orbital
Posts: 834
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Post by Raquel »

Hello BeerMug,

Can you please tell me the PCB Rev of your LK202-25? It should be printed on the board. I have a feeling that you might have an older module, earlier than PCB Rev 3.0. If you do, there maybe several steps to going from RS232 to I2C (and vice versa), not just replacing the jumpers.

If you can post a picture, that will be best.

Thanks,
Raquel Malinis
Design and Development
Matrix Orbital
BeerMug
LCD?
Posts: 5
Joined: Tue Oct 03, 2006 7:03 am

Post by BeerMug »

Rev1.5 (c)2003
Matrix Orbital LK202-25-E (handwritten E)
Attachments
Requested picture of PCB
Requested picture of PCB
MatrixOrbitalcrop.jpg (192.09 KiB) Viewed 10316 times
Raquel
Matrix Orbital
Matrix Orbital
Posts: 834
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Post by Raquel »

Hi BeerMug,

Sorry, you are right, there is no need to move / replace jumpers for PCB rev 1.5. You should just be able to connect using the Power / I2C Communications connector (as you probably have done).

The only other thing I can think of now is to put the manual override jump on pins 5 and 6 of the keypad connector. Cycle the power then communicate via I2C (leave the jumper on).

Please let me know how it turns out.
Raquel Malinis
Design and Development
Matrix Orbital
BeerMug
LCD?
Posts: 5
Joined: Tue Oct 03, 2006 7:03 am

Post by BeerMug »

Thanks for the idea ... alas, 'tis NoGo. Adding a jumper to pins5/6 on the keypad interface = no change. Attached is a screen capture of the SCL and SDA lines (the attachment is a zipped PDF). Anything pop out? I also reversed the SCL and SDA connections, just in case the pinouts were incorrect. As I wrote earlier, this is my first expedition into I2C land ... it is a frustrating journey this week.
Attachments
i2c.zip
SCL and SDA scope screen capture
(18.18 KiB) Downloaded 585 times
Raquel
Matrix Orbital
Matrix Orbital
Posts: 834
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Post by Raquel »

Hello BeerMug,

After looking at the attached file, I can see that you are actually sending address 0xA0. Note that 0x50 is b'01010000' which is not what we see on the picture.

I am attaching a file that should show how the I2C transaction should go. Only look at the '50' for now and note when it starts. The first '1' on the SDA should line up with the second pulse of the SCL.

Please let me know if this is clear.
Attachments
I2C LK162-12-V-Rev2.1.jpg
I2C LK162-12-V-Rev2.1.jpg (224.55 KiB) Viewed 10290 times
Raquel Malinis
Design and Development
Matrix Orbital
BeerMug
LCD?
Posts: 5
Joined: Tue Oct 03, 2006 7:03 am

Post by BeerMug »

Wonderful !! The program apparently shifts the address bits (rlf) once before transmitting, i.e. converts to a 7-bit address. That was a tad confusing to me, the neophyte, but I accepted their description. I presumed that the 7-bit address was somehow different from the normal 8-bit decoding... learn something new every day (of course, being dumber than a case of rusty anvils makes it easy to be exposed to something new every day...). I'll kill that initial rlf instruction and see what happens.

Again, thanks so very much for your time, your patience, and your support.
Raquel
Matrix Orbital
Matrix Orbital
Posts: 834
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Post by Raquel »

Hello,

Yes, please let me know how it turns out.
I2C is a little tricky at start but definitely a neat protocol. I do not know about being a "rusty anvil" but I know that I have been bitten by snags caused by I2C a number of times! :)
Raquel Malinis
Design and Development
Matrix Orbital
Post Reply