I2C problems

8051, AVR, ARM, ISP programmer, multi processor communication, embedded C...

Moderators: ikalogic, cotto88

I2C problems

Postby Ralphxyz » Sat Apr 23, 2011 2:05 am

OK at the start let me say that I do not know what I am doing so if you do not want to offer help at the most basic level don't bother reading further.

I am just learning I2C, I am just learning the Scanlogic2 Digital Analyzer so this goes together rather nicely, I think.

I have a I2C application running on a ATmega328P mcu.

The program is a analog temperature sensor tied to the ATmega328P's ADC.

The readings of the temperature sensor are "supposed " to be displayed on a I2C driven LCD. The LCD is fed from a I2C port expander (MAX7318).

Here is a .scl file of a session.
http://gettheworkdone.net/images/Projects/I2C_LCD/I2C_LCD-1.scl

Besides the difficulty I had in getting any waveform one of the things I think I see is that there is no Acknowledgements from the slave, is that correct2685 The Scanlogic2 "Decode" puts in a Acknowledgement flag where one should be but I do not see a High on the SDA.

The problem I have is that nothing is displayed on the LCD it is just a blank.

If anyone who understands I2C would give me a interpretation of what they see in the .scl file I would really appreciate it.

The I2C LCD program is running for the developer in their environment.

So what do you see2685

Thanks,

Ralph
Ralphxyz
 
Posts: 31
Joined: Thu Mar 31, 2011 2:47 am

Re: I2C problems

Postby ikalogic » Sat Apr 23, 2011 8:31 am

i'll be at the office in a couple of hours, and will take a better look at it.. from what i see your I2C bus seem to be working just fine.. are you sure the contrast is correctly adjusted on your LCD2685
True wisdom is knowing what you don't know -- Confucius
User avatar
ikalogic
Site Admin
 
Posts: 2239
Joined: Wed Jan 02, 2008 2:00 pm
Location: Limoges, France

Re: I2C problems

Postby g_koukis » Sat Apr 23, 2011 2:18 pm

Hello Ralphxyz,
Ack is low on the SDA line, so your slave device work fine.
If you send error slave address, the slave must not Ack - just try it...
Then try to replace the LCD display with some LEDs (and 320 ohm resistors) and send slowly the numbers 1, 2, 4, 8.... The first LED must turn on, then the second, and so on.... if this works, the problem is in LCD.
g_koukis
 
Posts: 7
Joined: Fri Mar 04, 2011 1:35 pm

Re: I2C problems

Postby ikalogic » Sat Apr 23, 2011 3:10 pm

As g_koukis said, your I2C bus seems to be working just fine..

what type of LCD is it2685 do you have a datasheet2685
True wisdom is knowing what you don't know -- Confucius
User avatar
ikalogic
Site Admin
 
Posts: 2239
Joined: Wed Jan 02, 2008 2:00 pm
Location: Limoges, France

Re: I2C problems

Postby Ralphxyz » Mon Apr 25, 2011 4:54 pm

Thanks for the replies.

I am using Rick Shear's code posted on Nerdkits.com
http://www.nerdkits.com/forum/thread/1382/

I have two LCDs and they both are working using standard micro/lcd wiring.

Everything I have seen says the I2C bus is working correctly.

I do not "think" it is LCD contrast but possible, I have a 10k contrast resistor which is what I use normally.

If I used the I2C LCD test code with LEDs should the LEDs blink2685

Lots of things to try, thanks again.

Ralph
Ralphxyz
 
Posts: 31
Joined: Thu Mar 31, 2011 2:47 am

Re: I2C problems

Postby ikalogic » Mon Apr 25, 2011 5:21 pm

Ralph, i have moved this thread to:
Board index ‹ General forums ‹ Micro controllers
since it is not related to SCANALOGIC-2


Ralphxyz wrote:I have two LCDs and they both are working using standard micro/lcd wiring.


Then what is the problem exactly...2685 :2685

Do you have any schematics of your system.. this might be handy
True wisdom is knowing what you don't know -- Confucius
User avatar
ikalogic
Site Admin
 
Posts: 2239
Joined: Wed Jan 02, 2008 2:00 pm
Location: Limoges, France

Re: I2C problems

Postby g_koukis » Mon Apr 25, 2011 9:20 pm

I don't speak English well, so I had to paint ...
You do not have the required permissions to view the files attached to this post.
g_koukis
 
Posts: 7
Joined: Fri Mar 04, 2011 1:35 pm

Re: I2C problems

Postby Ralphxyz » Tue Apr 26, 2011 12:30 am

Thanks everyone for the help.

I tried lighting LEDs on Port2 of the MAX7318 port expander using a breadboard and the leds all blinked. So I mounted a green LCD on the breadboard and it worked!!

The LCD displayed the data as expected.

Then I went back to trying to use a protoboard with wired circuit and that still gets the blank LCD.

So then I went back to the breadboard this time using two inch longer wires andI can barely read the display. This is using a green LCD I get a blank LCD using a blue LCD.

I know the I2C, and he poert expander are functional so I believe as was suggested earlier that problem is with the contrast resistor.

So I am trying different resistors to see if I can get a good display.

Thanks again for your help.

Ralph
Ralphxyz
 
Posts: 31
Joined: Thu Mar 31, 2011 2:47 am


Return to Micro controllers

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 0 guests

cron