Grove LCD RGB display problem

Technoman

Senior Member
Hi,

While I was testing a Grove LCD RGB display using an AXE118 (20M2 V8.A) I came across an I2C problem.

SDA (B.5) and SCL (B.7) are tied to +Vcc using 4.7K resistors.

Blockly program : Grove LCD_RGB test 1.PNG

On the scope both lines remain to 1 ; there is no sign of I2C activity.

When I set both lines to 0 (low), it works. Seems there is no electrical problem.

Did I miss something?
 

hippy

Technical Support
Staff member
How are you using Blocky; within PE6, the Chrome App, through a browser ? And which version do you have ?

As you have the Grove LCD RGB Display block available it would seem you probably have the latest version but knowing exactly what you have will allow us to better assess or replicate the issue.

It should be working; worked when we tested the block for the display, and if you Convert the Blockly to Basic commands you should see it's mostly HI2CSETUP and HI2COUT commands, so if executing those it should be communicating via the I2C bus, and you should be seeing that activity.

You could run the converted to Basic code and add SERTXD commands just to demonstrate it is going through the code. Maybe put some HIGH, LOW or TOGGLE blocks or commands around the LCD commands so you can better synchronise the scope.
 

Technoman

Senior Member
I use the latest version 6.1.0.0. on a pc currently running Win 10. The converted code seems correct.

I used a simple block just initializing an I2C device and put some high and low around. I checked that the pull-up resistors were doing their job. I removed the ULN2804, having a weird constant voltage on a pin (2V), why?
Everything is correct on the scope on different pins but not I2C bus, still stuck to Vcc!:confused:

I tried also an AXE401 board fitted with a Grove shield (I2C bus is then reconnected to proper pins on the shield). Doesn't work either : SDA remains at 5V and SCL at 2V...
 

Technoman

Senior Member
just initializing an I2C device
is not enough, I was wrong. At least, I should add an hi2cout.

Meanwhile I noticed that the converted code is repeating the hi2csetup in main :
Code:
;Initialise RGB LCD module
	hi2csetup I2CMASTER, $7C, I2CSLOW, I2CBYTE
	[B]pause 50[/B]
	hi2cOut $80,($38)
	pause 5
        ...

main:
	hi2csetup I2CMASTER, $7C, I2CSLOW, I2CBYTE
	hi2cout $40, ( "message" )
	stop
Two questions : why hi2csetup is repeated in main? Why there is no pause in main?
 

hippy

Technical Support
Staff member
why hi2csetup is repeated in main?
Because the Blockly code converter isn't smart enough to know if an HI2CSETUP is already active for addressing an I2C RGB LCD so forces a HI2CSETUP to ensure it is before it uses any HI2COUT to write to the display.

Why there is no pause in main?
No idea. The pauses are there when I test it. Perhaps post your full Blockly code (.xml file) so it can be checked by ourselves or others.
 

hippy

Technical Support
Staff member
Importing that and I only see ...

Capture.JPG

Just the Start and I2C RGB LCD blocks. No pauses so none generated. Your code in post #4 is therefore correct, what would be expected.

I had thought it odd that what you had in post #1 was not showing any pauses or the second I2C RGB LCD block but I guess we are talking about the code as shown here, were actually asking why a PAUSE follows HI2CSETUP in the initialisation but not in the main code. That wasn't immediately obvious to me.

The answer to that is that it's not a PAUSE that's strictly required for I2C but a PAUSE to ensure the module is powered-up and ready before the first I2C data is sent, and that's only needed during initialisation.

The first ever HI2CSETUP will set the I2C Bus lines, define the Device ID and settings for when HI2COUT comes to be used. The second time the bus lines are already set, the device will be already ready for the HI2COUT.
 

hippy

Technical Support
Staff member
I tried also an AXE401 board fitted with a Grove shield (I2C bus is then reconnected to proper pins on the shield). Doesn't work either : SDA remains at 5V and SCL at 2V...
It might be worth describing exactly what hardware you are using, what connections you are making.

Unless I2C support has just mysteriously stopped working for some reason ( and it seems to work for me ) it may be something to do with the hardware. Are you measuring signals on the PICAXE side or the LCD side ? It could be the connections aren't the ones required.
 

hippy

Technical Support
Staff member
That seems correct. Have you added the 4K7 pull-ups ?

I found the best way to connect a Grove sensor to a PICAXE is to cut one of the Grove jumper cables in half and then wire that to the relevant PICAXE pins.
 

Technoman

Senior Member
On the AXE118 board, the ULN2804 has been removed and a cable is going straight to the LCD-RGB display, as described by Hippy. Two 4K7 resistors are soldered on the copper side.
According to what I read, the circuit diagram seems compatible with I2Cdriving then Grove LCD .

The power supply is made out of 4 NiMH batteries, so the voltage is lower than 5V (4.8V). Could it be the cause? I'll try a 5V power supply.
Although the AXE300 seems to be powered by 3 alkaline batteries (4.5V).

We intend to buy AXE300 board, but not before September. Would it be possible to view its circuit diagram? The link to the data sheet is broken (404).
 

hippy

Technical Support
Staff member
The power supply is made out of 4 NiMH batteries, so the voltage is lower than 5V (4.8V). Could it be the cause? I'll try a 5V power supply.
Although the AXE300 seems to be powered by 3 alkaline batteries (4.5V).
The Grove I2C RGB LCD is rated as a 5V device though it 'just about works' for me at 4.5V. The characters displayed are quite dim with poor contrast. At 4.7V the characters are reasonably black. It seems as good as can be expected above 4.8V.

I have, as you can probably guess, just double-checked things are working with an AXE300 board, 20M2 and Grove I2C LCD RGB v2.0 and everything is fine for me.

Some Grove devices are 5V only and may not work well with less than that. The AXE300 comes with a 3xAA battery box, but that doesn't mean such a supply will be suitable for all sensors. That's why the AXE300 has screw terminal power connectors and a barrel jack PSU input, both non-regulated.

I don't know if any official Grove sensors are 3V only but some third-party 'Grove compatible' sensors can be. One should therefore check what the supply requirements are before choosing a supply and powering up.
 

hippy

Technical Support
Staff member
Would it be possible to view its circuit diagram? The link to the data sheet is broken (404).
I'll let the web team know. According to my notes ...

Code:
PICAXE-20M2    A&D          A&D          A&D          A&D
               .-.          .-.          .-.          .-.
0V ------------|O|-GND------|O|-GND------|O|-GND------|O|-GND
V+ ------------|O|-VCC------|O|-VCC------|O|-VCC------|O|-VCC
          .----|O|-B4  .----|O|-B3  .----|O|-B2  .----|O|-B1
B.4 ------' .--|O|-B3--' .--|O|-B2--' .--|O|-B1--' .--|O|-B0
B.3 --------'  `-'       |  `-'       |  `-'       |  `-'
B.2 ---------------------'            |            |
B.1 ----------------------------------'            |
B.0 -----------------------------------------------'
Code:
       .--.-.
       | .|.|.
 2x10K | |_|_| I2C          I2C           D          UART
       |  | |  .-.          .-.          .-.          .-.
0V ----|--|-|--|O|-GND------|O|-GND------|O|-GND------|O|-GND
V+ ----^--|-|--|O|-VCC------|O|-VCC------|O|-VCC------|O|-VCC
          }-|--|O|-SDA------|O|-SDA .----|O|-C5  .----|O|->TX
B.5 --SDA-' }--|O|-SCL------|O|-SCL | .--|O|-C4  | .--|O|-<RX
B.7 --SCL---'  `-'          `-'     | |  `-'     | |  `-'
C.5 --------------------------------' |          | |
C.4 ----------------------------------'          | |
C.0 >-HSEROUT------------------------------------' |
B.6 <-HSERIN---------------------------------------'
Code:
                            A&D          A&D          A&D
                            .-.          .-.          .-.
0V -------------------------|O|-GND------|O|-GND------|O|-GND
V+ -------------------------|O|-VCC------|O|-VCC------|O|-VCC
                       .----|O|-C2--. .--|O|-C3--. .--|O|-C7
C.1 -------------------|----|O|-C1  '-|--|O|-C2  `-|--|O|-C3
C.2 -------------------'    `-'       |  `-'       |  `-'
C.3 ----------------------------------'            |
C.7 -----------------------------------------------'
Code:
        _   -.- V+
      _|_|_  |   ___                        LED   __
C.6 <-o   o--^--|___|-.       A.0 >-SEROUT--|>|--|__|-.
                 10K _|_ 0V                          _|_ 0V
 
Last edited:

Technoman

Senior Member
@hippy
Thanks for this diagram. The resistor value for the pull-ups has been taken up to 10K, not the frequently seen 4K7. Any reason?
 

hippy

Technical Support
Staff member
I would guess that's to cater for sensor boards which do have pull-ups on them and those which do not.
 

Technoman

Senior Member
Yesterday night, having the LCD removed, I put the scope probe on SCL and saw some activity. (AXE118)
Connected, the display was perfectly working on both lines. A miracle!:)

Still, I try to figure out what happened : bad solder joint? (I re soldered every joint shortly before, including the two pull-ups) Where? Could-it be GND of the chip? Connexion between an output pin and the pull_up?
 
Last edited:
Top