Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - Interfacing LCD I2C with ATmega32 16MHz

(you are viewing a thread; or go back to list of threads)

Interfacing LCD I2C with ATmega32 16MHz (by Gérard)
Hi All
Feedback on the use of a LCD I2C 1602 with ATmega32 16MHz :
For this project first I used an ATmega16L-8MHz with one of this cheap LCD 1602 + I2C without any tech data we find here in Morocco and it worked fine.
Then I updated to ATmega32-16MHz and time to time the LCD went crazy, with uncontrolled letters on the upper row and black squares on the lower row.
I change cycle time, I2C rate, 1602 LCD, I2C module, I2C module wires, .... and I always had the same problem.
The defect occured about one of ten times when a pump started; I suppose the defect is linked to disturbances with the start of the pump when the LCD has to write a new status message.
But the same LCD with the same I2C module, the same ladder and the same PCB worked like a charm with the ATmega16L-8MHz when the same pump started.
On the net I found the post of a guy who met the same LCD I2C problem with an ATmega32 updating 8MHz to 16MHz and someone advised him to change the initialize delay of the LCD
I did so :
LIBRARIES_FOR ; AVR ; LcdI2cLib.c ;
.........
lcd_I2C_adr=I2C_adr
// Attente de l'initialisation interne du circuit LCD Delay_ms(20)
I changed for ... Delay_ms(100)
I did a lot of test and it seems the defect is fixed.
Could someone please explain to me
The settings are :
ATmega32 ; MCU cristal frequency 16MHz; PLC cycle time 25ms; I2C rate 100 000Hz
Sat Feb 13 2021, 17:28:22
(no subject) (by José)

Bonjour Gérard


C'est effectivement intéressant ; les librairies ont été testées
par mes soins à 8 MHz et il n'est pas impossible qu'à 16 MHz les timings ne soient pas équivalents car les fonctions de temporisations sont approximatives (voir usrlib.c) et ne sont pas basées sur des timers.

Cordialement
José
Thu Feb 18 2021, 06:54:09
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):