Forum

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

   

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
I2C address list needed to enable LCD2004 SainSmart LCD display
2014 年 05 月 25 日
20:46:29
leutenecker
Germany
Member
Forum Posts: 13
Member Since:
2014 年 05 月 20 日
Offline

Hi Community,

I bought the LCD2004 with 20x4 lines from SainSmart and testes it with the LiquidCrystal_I2C library on my Arduino UNO. Works perfectly there if I use the address 0x3F to talk via I2C to the display. The display is connected via 5 V and Gnd and SCL and SLA.

I tried the same on EduCake, but the address 0x3F does not give any result. I tried to use the I2C scanner sketch to get all connected addresses of I2C on EduCake. It printed out 50 different addresses. Now it would be great to get some schema or document to distiguish between the internal EduCake devices addresses and those external connected addreses of the breadboard top of EduCake.

Can you provide a list which device listed in I2C scanner sketch is internal EduCake hardware and which could be external connected pin components?

Thanks and greetings,

Moritz Cool

2014 年 05 月 26 日
14:23:21
cucubutter
Moderator
Forum Posts: 84
Member Since:
2014 年 04 月 10 日
Offline

Hi
I find the datasheet, and it says the I2C address are 0x3f or 0x27,do you try the address 0x27??
You can rafer to http://www.ebay.com/itm/SainSm.....1103741812

Thanks and greetings,

Cucubutter

2014 年 05 月 26 日
16:47:08
leutenecker
Germany
Member
Forum Posts: 13
Member Since:
2014 年 05 月 20 日
Offline

Hello Cucubutter,

there is definitively a big problem with the I2C Wire library adapted for 86duino!!

Problem 1:
You can try it yourself with the following I2C Scanner sketch:
http://playground.arduino.cc/M.....I2cScanner

Result: Scanner will tell that every address from 0 - 127 has a working device connected on EduCake, which is of course wrong !!

Problem 2:
The LCD2004 from SainSmart allows blinking backlight with the following code on Arduino, but does nothing on 86Duino EduCake:

#include
void setup()
{
Wire.begin();
}

void loop()
{
byte error;
Wire.beginTransmission(0x27); // tried 0x3f and others too does not matter/work on EduCake!
Wire.write(0); // backlight on
error = Wire.endTransmission();
delay(2000);
Wire.beginTransmission(0x27);
Wire.write(0 | 0x08); // backlight off
error = Wire.endTransmission();
}

Waiting for help :-) Greetings,

P.S. I set the clock speed to 200 Mhz, would this make a difference?

Moritz

2014 年 05 月 27 日
13:36:43
cucubutter
Moderator
Forum Posts: 84
Member Since:
2014 年 04 月 10 日
Offline

Hi
1.Check the electric circuit .
2.the Aduino board and The LCD2004 from SainSmart need 5V signal, but the educake is 3.3V, so u can use pull up
resistance 1.8KΩ to 5V on SCL pin and SDA pin.

Thanks and greetings,
Cucubutter

2014 年 05 月 27 日
19:33:05
leutenecker
Germany
Member
Forum Posts: 13
Member Since:
2014 年 05 月 20 日
Offline

Hello Cucubutter,

There is nothinh to check, it only has 4 wires: +5V, GND and SCL and SLA. All are connected and the display is lighting up. But none of the I2C addresses do work. So the implementation of the wire library is not 100% compatible to arduino!

Otherwise the I2C Scanner Sketch would work without problems!!

EduCake has 5V output on its top! So this is not the problem! The same with other libraries which depends on Arduino Registers like "IRRecv" do not work on 86Duino or EduCake!

Greetings,
Moritz

2014 年 05 月 28 日
20:34:42
Android_Lin
Moderator
Forum Posts: 211
Member Since:
2014 年 04 月 01 日
Offline

Hi,
I tried to use the I2C Scanner Sketch and get the same result. So i compared with Arduino and 86Duino wire library and found the reason in wire.cpp and twi.cpp. In wire.cpp, the endTransmission() will detect txbuff size, if size is 0, then returen 0, this behavior is difference from Arduino. In twi.cpp, a interrupt status is incorrect. So i modified them to download as below:

http://www.roboard.com/files/8.....o/Wire.zip

Unzip and put them to /86Duino_Coding_103/hardware/86duino/x86/libraries/Wire and compile with I2C Scanner Sketch. Use this, i can get my i2c device address(0x21), but also get 0x04, 0x05, 0x06, 0x07, because 86Duino i2c hardware supports philips i2c spec, those address are responded(ack) by master like high-speed mode master code etc. (Refer to http://i2c2p.twibright.com/spec/i2c.pdf)
You can ignore them in I2C Scanner Sketch and try again.
This compatibility problem will be revised in next IDE version. Thank you :)

2014 年 05 月 29 日
06:55:41
leutenecker
Germany
Member
Forum Posts: 13
Member Since:
2014 年 05 月 20 日
Offline

Hello Android Lin,
thank you very much for your expertise and great support!!

Especially on the other cases and ideas I posted. I really appreciate that you take care :-) As you seem to have the deep knowledge of the libraries, could you take a look at this Infrared common library https://github.com/shirriff/Arduino-IRremote/

It seems to have similar problems as it uses the original arduino mhz timing / speed and special arduino internal register addresses like TCCR2A, PIND and I want to use it on 86Duino EduCake, but have no Idea how I can adapt to the mhz speed of EduCake and how to find a replacement for the arduino special registers like TCCR2A, _BV(), PIND and so on.

Changing that for you should be done in minutes ;-) Maybe you could port this lib and provide a download link and add it to the next release of 86Duino IDE. I think porting this lib would be a great addition to the 86duino!

Greetings and have a productive day :-)

Moritz Cool

2014 年 05 月 30 日
15:18:09
leutenecker
Germany
Member
Forum Posts: 13
Member Since:
2014 年 05 月 20 日
Offline

Thanks to the patch of you (Android_Lin) the I2C Scanner sketch works now!

It shows me on EduCake without any external I2C device plugged in the following used device addresses:

0x04
0x05
0x06
0x07

If I plug the LCD in without any pullup resistors and restart the EduCake I don't see a difference. No new address gets added to the list.
I did a test and tried to write to one of those existing addresses with a simple Wire.write(0); which seems to hang the EduCake. If I use an address which does not exist it does not hang anymore.

Hope you have some more ideas why the LCD address does not show up.

Greetings, Moritz Cool

2014 年 05 月 30 日
21:45:40
Android_Lin
Moderator
Forum Posts: 211
Member Since:
2014 年 04 月 01 日
Offline

Hi,
I modified the previous result, those 0x18, 0x19, 0x1E, 0x6A, 0x77 addresses are built-in I2C sensors on 86Duino ONE and dont exist on the EduCake. So you only got 0x04, 0x05, 0x06, 0x07, that is correct. But they are special addresses(High-speed mode master code), we should avoid to use one of them. (This limit will also be added in next IDE version)
You can try to add 2 pull-up resistance on SDA and SCL to 5V and try it again. (Refer to http://en.wikipedia.org/wiki/F.....le:I2C.svg, Vdd is 5V and Rp is 1.8KΩ)

Additional, i get a IRRemote library and need some time to implement. (because a timer ISR also need to port)Smile

Greetings,
Android_Lin

Forum Timezone: Asia/Taipei

Most Users Ever Online: 66

Currently Online:
2 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Dinosaur: 27

leutenecker: 13

mrZagg: 10

lukeross: 8

tomka: 8

smeezekitty: 8

hippy: 8

Ekkehard: 8

UIdahoCIT: 8

blaxxun: 7

Member Stats:

Guest Posters: 0

Members: 1541

Moderators: 14

Admins: 5

Forum Stats:

Groups: 2

Forums: 10

Topics: 239

Posts: 1082

Newest Members: nhollywoodmarli, bat869cube672, lenggeleranto, iknowesp, dimka, elihu, Woodrowcercraby, Robertnalty, Homerwoppy, RonaldLew

Moderators: Glaux: 70, uaa: 11, guigra: 17, asian55: 22, Android_Lin: 211, bcarroll: 12, cucubutter: 84, recycled-air: 12, stevemork: 16, zerozaber: 52, pongraczi: 20, George Andrews III: 56, poto: 11, garpastym: 20

Administrators: eveshih: 1, anthony: 31, viky6: 0, roboard: 135, hcl: 0