Reputation: 11
I'm trying to interface a custom LCD to a 24x4 Ram mapping driver chip from Holtek - HT16L21 in I2C mode with an arduino UNO. I'm referring the data sheet from holtek. I tried searching over the internet for examples and could not find an example code for HT16L21.
There are a bunch of samples for HT1621 which uses an SPI interface. But I'm working on I2C mode, and no help available from the manufacturer for some sample code on how to use this.
I referred to the commands in the data sheet, but for some reason i'm unable to get it to work.
Below is the code i've tried.
#include <Wire.h>
int DISPLAY_ADDRESS = 0x38; // Device address
int low, high;
void initialize_display(void)
{
Wire.beginTransmission(DISPLAY_ADDRESS);
Wire.write(0xAA); //reset display
Wire.endTransmission();
Wire.requestFrom(DISPLAY_ADDRESS, 0);
while(Wire.available() == 1);
low = Wire.read();
Wire.end();
Serial.println("Display Initialized.!!");
}
void setup()
{
Serial.begin(9600);
initialize_display();
Wire.beginTransmission(DISPLAY_ADDRESS);
Wire.write(0x80); // command to write to RAM as per data sheet
Wire.write(0x01); // register address - i have tried changing this values
Wire.write(0xFF); // write 8 ones (11111111) so that some segments on the display turns on
Wire.end();
}
void loop()
{
}
The default address of the chip says - 0x38. I tried using 0x70 (shifting bit to the left and sending out command + data, but this also did not work)
I've tried using various bytes for address / command / data values as per the data sheet, but i'm unable to get this to work for some mistake which i'm doing. The display shows nothing. Could any help point out where i'm going wrong?
This is the link to the pdf datasheet of HT16L21 which i'm referring - https://www.signal.com.tr/pdf/cat/HT16L21v120.pdf
When i run an I2C scanner, i'm able to detect the chip and it reports an I2C device was found at address 0x38. If i remove any one of the SDA or SCL lines from the arduino, the I2C scanner says no I2C devices are found. This test confirms that the HT16L21 chip is detected by arduino uno, and the interfacing is correct.
Upvotes: 0
Views: 58