Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

AIP31068 based LCD support in I2C mode

2 posters

Go down  Message [Page 1 of 1]

1AIP31068 based LCD support in I2C mode Empty AIP31068 based LCD support in I2C mode Thu Jan 07, 2021 12:49 am

acebrian



I have added support for AIP31068 based LCDs in I2C mode (like the Grove - LCD RGB Backlight).

The code is heavily based on hd44780 and i2cram components.

Tested with Arduino Mega 2560 with SlowSoftI2CMaster library because Wire library (TWI based) doesn't work in SimulIDE.

Attached patch and examples.

Best regards.
Attachments
AIP31068 based LCD support in I2C mode Attachmentaip31068_support.zip
AIP31068 support
You don't have permission to download attachments.
(8 Kb) Downloaded 9 times

arcachofo

arcachofo

Hi acebrian.

Thank you very much!

AVR I2C should be working in version 0.4.14: https://www.simulide.com/p/downloads.html

3AIP31068 based LCD support in I2C mode Empty Re: AIP31068 based LCD support in I2C mode Thu Jan 07, 2021 10:03 am

arcachofo

arcachofo

I see this patch is for 0.5.15.

Wire library should work in this version.
I will have a look.

4AIP31068 based LCD support in I2C mode Empty Re: AIP31068 based LCD support in I2C mode Thu Jan 07, 2021 10:12 am

acebrian



Arduino Mega I2C using Wire library (TWI based) hangs at "Wire.endTransmission()" function call.

You can test it with the "Lcd_twi.ino" example.

Best regards.

5AIP31068 based LCD support in I2C mode Empty Re: AIP31068 based LCD support in I2C mode Thu Jan 07, 2021 10:17 am

arcachofo

arcachofo

Thanks. I will have a look.

arcachofo

arcachofo

Wire library should work now.
Issue solved in rev 7 and 8.

But there is still another issue:
Sometimes I2C stops to work (randomly).
I'm trying to find the problem.

And there is another issue in transmission start:
SlowSoftI2CMaster lib.  expect:  control_code << 1:
Code:
#define LCD_I2C_ADDR 31
si.i2c_start( LCD_I2C_ADDR << 1 );

But wire lib. expect control_code not rotated.
Code:
#define LCD_I2C_ADDR 31
Wire.beginTransmission( LCD_I2C_ADDR );

acebrian



Now "bzr log" shows that latest revision in trunk branch is 6:

------------------------------------------------------------
revno: 6
committer: arcachofo
branch nick: trunk
timestamp: Tue 2021-01-05 16:39:58 +0000
message:
Oscope printing wave out of display with only 1 channel connected.
------------------------------------------------------------

Have you already commit your changes to Launchpad?

acebrian



Checked with the real Arduino Mega 2560 and the Groove LCD, the working values are:

#define LCD_I2C_ADDR 3E // 62
si.i2c_start( LCD_I2C_ADDR << 1 );

#define LCD_I2C_ADDR 3E // 62
Wire.beginTransmission( LCD_I2C_ADDR );

Best regards.


arcachofo wrote:Wire library should work now.
Issue solved in rev 7 and 8.

But there is still another issue:
Sometimes I2C stops to work (randomly).
I'm trying to find the problem.

And there is another issue in transmission start:
SlowSoftI2CMaster lib.  expect:  control_code << 1:
Code:
#define LCD_I2C_ADDR 31
si.i2c_start( LCD_I2C_ADDR << 1 );

But wire lib. expect control_code not rotated.
Code:
#define LCD_I2C_ADDR 31
Wire.beginTransmission( LCD_I2C_ADDR );

arcachofo

arcachofo

Now "bzr log" shows that latest revision in trunk branch is 6:
Have you already commit your changes to Launchpad?
I hadn't sorry.
Now it's updated.

Checked with the real Arduino Mega 2560 and the Groove LCD, the working values are:

#define LCD_I2C_ADDR 3E // 62
si.i2c_start( LCD_I2C_ADDR << 1 );

#define LCD_I2C_ADDR 3E // 62
Wire.beginTransmission( LCD_I2C_ADDR );
Ok, thanks.

10AIP31068 based LCD support in I2C mode Empty Re: AIP31068 based LCD support in I2C mode Thu Jan 07, 2021 9:41 pm

acebrian



I have tested "Lcd_twi.ino" example with Arduino Mega and the latest revision 8 and it still doesn't work. Also step by step execution is not possible if the Wire library is used.

"Lcd_soft.ino" still works right with (LCD_I2C_ADDR << 1) fix.

Best regards.

11AIP31068 based LCD support in I2C mode Empty Re: AIP31068 based LCD support in I2C mode Fri Jan 08, 2021 2:12 pm

arcachofo

arcachofo

I think it should now.

12AIP31068 based LCD support in I2C mode Empty Re: AIP31068 based LCD support in I2C mode Fri Jan 08, 2021 4:01 pm

acebrian



I confirm that TWI works right with revision 11.

Still step by step execution is not possible if the Wire library is used.

I have also found that with some examples step by step execution is very imprecise (no one step per C sentence).

Best regards.

13AIP31068 based LCD support in I2C mode Empty Re: AIP31068 based LCD support in I2C mode Fri Jan 08, 2021 5:30 pm

arcachofo

arcachofo

I confirm that TWI works right with revision 11.
Nice to know.

Still step by step execution is not possible if the Wire library is used.
I have also found that with some examples step by step execution is very imprecise (no one step per C sentence).
Step by step shouldn't be working at all in 0.5.15 yet.
If it works in some cases is just by chance.

In this version there is a complete change in the simulation engine that is not yet completed.

Anyway 0.4.14 brach will receive all these fixes.

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum