I2C on GLK12232-25-SM

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

Moderators: Henry, Mods

Post Reply
shasson
LCD Geek
Posts: 28
Joined: Mon Dec 22, 2003 7:07 am

I2C on GLK12232-25-SM

Post by shasson »

Hi,

I have had the GLK12232-25-SM working well over RS-232 communications and I am now trying to make it work over I2C. I have followed the manual making the necessary steps to the LCD board hardware. I have placed that LCD on an I2C bus. Using that bus I can talk to another couple of I2C devices on the bus already. I know the I2C signals are getting to the correct pins on the PIC on the LCD board because my scope has showed me this. I have also cycled through every I2C address, but the LCD will not ACK any addresses. It is like the LCD does not expect to respond to the I2C protocol (one address should).

Did I miss a step? Is there some firmware setting (send a command) that must be done to make the LCD I2C compatible?

The master I am using only provides 3.3V on the SCL and SDA lines which may be an issue, but the voltages appear high enough for the PIC on the LCD to count a 3V high as a logical 1. I will try another master next which uses 5V, but I thought some other people may have some ideas (something I missed)?

Thanks in advance.
Miles
Matrix Orbital
Matrix Orbital
Posts: 1105
Joined: Mon Mar 04, 2002 4:00 pm

Post by Miles »

Hello...

The 3.3 Volts should be enough for the PIC to receive a logic level 1, however I'd feel more comfortable with a master that output 5 Volts. The GLK12232-25-SM I2C default address is 08h. Are you bit bashing or are you using an I2C function established from your microcontroller.?
Miles Y.
Head of Technical Support
Product Manager
Matrix Orbital
shasson
LCD Geek
Posts: 28
Joined: Mon Dec 22, 2003 7:07 am

Post by shasson »

Hi,

I now am using an I2C master with 5V output. I am not having any more luck. It appears that the I2C functionality on the LCD is not enabled. By plugging in the SDA and SCL lines into the LCD, the clock line amplitude gets nearly cut in half (5V to 2.7V)?

I have also tried measuring the voltage from both the SDA and SCL lines while the LCD is not attached to the bus (but turned on). I placed a 2.2Kohm resistor between a line (SDA or SCL) and ground. The voltage across them is minimal (300mV). I would expect an open collector on these lines?

To answer the question from the last post, the two masters used C and C++ functions that work on many other I2C devices. My one master is a PIC using the MSSP module on it ( the one with 5V ).
Miles
Matrix Orbital
Matrix Orbital
Posts: 1105
Joined: Mon Mar 04, 2002 4:00 pm

Post by Miles »

Can you tell me what PCB revision you have?? By most other devices are you referring to memory chip components?
Miles Y.
Head of Technical Support
Product Manager
Matrix Orbital
shasson
LCD Geek
Posts: 28
Joined: Mon Dec 22, 2003 7:07 am

Post by shasson »

Hi,

On the board it says R1.2. I'm fairly certain that that the firmware was 25 (decimal) and the module type is 36 (decimal). I can't check these values right now, but these were the values I found before when I was doing RS-232.

When you say what devices I was referring to, I believe you meant the other I2C devices on the bus? For my 5V master (a PIC using MSSP) , I have another PIC (using SSP), a TC74 temperature sensor and an EEPROM. They all seem to work fine.

I hope I answered your questions, I was a little unsure what you meant.

Thanks.
Miles
Matrix Orbital
Matrix Orbital
Posts: 1105
Joined: Mon Mar 04, 2002 4:00 pm

Post by Miles »

Yes, that was exactly what I was referring to!! Do each of the slave units use a memory address?? Please see the following link for what I'm trying to refer to...

http://www.lcdforums.com/forums/viewtop ... hlight=i2c
Miles Y.
Head of Technical Support
Product Manager
Matrix Orbital
shasson
LCD Geek
Posts: 28
Joined: Mon Dec 22, 2003 7:07 am

Post by shasson »

None of the devices have a memory address as far as I can tell from the description I saw. Right now I have it set up to send the I2C address byte onto the line and if there is an ACK, I pause and can see what address it was on the scope. I do not send anything, after or before that byte.

for(int i = 0; i < 255; i+=2)
{
I2CStart();
if(I2CSendAddress( i ))
{
pause for 4 seconds
}
else
{
pause for 500 ms
}
I2CNak();
I2CStop();
}


I start at 00000000 and increment by two (only testing write). All of the other I2C devices ack (method returns true) when their address appears except the LCD.
shasson
LCD Geek
Posts: 28
Joined: Mon Dec 22, 2003 7:07 am

Post by shasson »

I have partly solved my problems. I have discovered what the issue was with my 5V master. I had not set the clock pin an output (explicitly) on the master PIC. After I had done so there was no longer an amplitude drop in the clock voltage when I attached the LCD and every device was found. I am still unsure why the code still worked for other I2C devices before doing this?

The one line added in my code in intialization was:

clear_bit(trisc, 3);

I have still had no luck with my 3.3V master, but that may simply be the same problem or a lower voltage issue.

I will post later how that goes.
Miles
Matrix Orbital
Matrix Orbital
Posts: 1105
Joined: Mon Mar 04, 2002 4:00 pm

Post by Miles »

Thanks for the update...I was curious how you made out after our phone conversation! To be honest I've never tried a 3.3 Volt master and it may not work as expected. I really do think it may be a low voltage issue. I'll try to find out more. Keep us posted!!
Miles Y.
Head of Technical Support
Product Manager
Matrix Orbital
shasson
LCD Geek
Posts: 28
Joined: Mon Dec 22, 2003 7:07 am

Post by shasson »

After further investigation I think I understand what is going on. My previous post stating to set the clock pin on the master as an output works, but is not the right solution. That would prevent slave I2C devices from holding the clock (making the master wait) which they may want to do and I believe this is required by the I2C spec.

The real solution was to use stronger ( less resistant ) pull up resistors. As I had stated before when putting the LCD on the bus, the voltage would drop on the clock line is from 4.7V to 2.7V (high voltage amplitude). Setting the clock pin on the master to an output only masked this problem and the voltage stayed high (at 4.7V amplitude) and the LCD responded to it's address when put on the bus. To fix the problem I used two 2.2Kohm resistors in parallel going from the clock line to the 5V source, pulling up the voltage to a 3.8V amplitude. This was high enough for the LCD to understand the signal (the clock pin was not set to an output on the master). This setup works for my 5V master, but I wanted to use a 3.3V master, and how can I pull 3.3V up to 3.8V (approx.)? Well there is an example of how to split the I2C bus into 3.3V and 5V sections in the I2C spec and I plan on trying this shortly.

So stronger pull up resistors seemed to be the solution. There is still a question of why adding the LCD to the bus made the clock amplitude drop by 2 volts (where is this resistance coming from)? But at least I believe I have found an acceptable solution.

Thanks for your help.
shasson
LCD Geek
Posts: 28
Joined: Mon Dec 22, 2003 7:07 am

Answer to why the clock amplitude drops when adding the LCD

Post by shasson »

After even more investigation it was discovered that there is a pull down resistor (about 6K) inside the SIPEX chip on the I2C clock line that still remains after changing the LCD to I2C mode (no jumper to remove to remove access to that line in the chip). We removed this connection by removing the trace on that line and the problem was no longer present (nor can we bring that LCD board back to use the RS232 or TTL modes). At least we now know what the problem is and can deal with it appropriately.
Miles
Matrix Orbital
Matrix Orbital
Posts: 1105
Joined: Mon Mar 04, 2002 4:00 pm

Post by Miles »

Thank you for your input and patience regarding this matter. This is something we will have to fix in the near future. :) I appreciate all your time and feedback you have given this situation!
Miles Y.
Head of Technical Support
Product Manager
Matrix Orbital
Post Reply