Batron I2C LCD Display stays Blank.

Go To Last Post
15 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I2c Command sequence to Initialize and write data to the BATRON I2c LCD display
===============================================================================
I bought a Batron I2C LCD display for testing. However i am not succeeding in getting
something on the LCD screen. It stays blank. Only the LED back light is illuminated.
There is NO contrast adjustment possible on this LCD display, at least i did not
see any reference to it.

I have read the application note found on Avrfreaks concerning driving a Batron
LCD display with I2C. They use a different batron LCD display BT21605V-SRE-I2C-COG.

My configuration
----------------
LCD-Type BATRON BTHQ 21605AV-YETF-LED04-I2C-5V

AVR Processor ATMEGA16 running on ext cristal 3,6864MHz.
TWBR = 0x0C;
TWSR |= 0x01;

Implemented I2C Command sequence, Interrupt driven.
---------------------------------------------------

- Read LCD Control Byte to check Busy State LCD Display

- Init LCD I2c Command sequence.
- - - - - - - - - - - - - - - - -
I2C-START
SLA_W 0x76;
FUNC_SET 0x00; Selcet function setting
0x34; 2 by 16 display
0x0C; Turn display on with no cursor
0x06; Inc cursor adr for each write to DDRAM
0x01; CLR_LCD Clear display and set DDRAM adr counter to 0
I2C-STOP

- Read LCD Control Byte to check Busy State LCD Display

- Write Data to the LCD
- - - - - - - - - - - - -
I2C-START
SLA_W 0x76
FUNC_SET 0x00 Selcet function setting
0x80 Write to DDRAM AC, set DDRAM Adr on 0

I2C-START
SLA_W 0x76
0x40 Write to DDRAM
0x50 Write Data, Character "P" Ascii-0x50 (Note_1)

I2C-START
SLA_W 0x76
0x80 Register Select Control Write
0x02 Clear_Adr

I2C-STOP

The LCD Screen is BLANK after this sequence. I expect a Character "P" on the screen.
All I2C return Codes are OK.

Has someone an idee what is missing in the I2C command stream?

Note_1
------
In the Application_Note they say we need to add an Character_Offset 0X80 to the written
characters. I tried to write 0xD0, with the same result, blank screen.

Thanks for help,
Fabrizio

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

fabrizio

Quote:
Has someone an idee what is missing in the I2C command stream?
My guess is that you might not have the correct I2C slave address.

Don

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I presume that you are using Atmel AVR155 app note. I compiled it for CodeVision some time ago. But have never run the code.

Personally I dislike the way that the AVR155 code is written, but it should work. You just send a Start(slave) followed by an initial mode, then a sequence of data or commands until a Stop.

I have driven Batron COG displays with i2c, but they use a similar pattern with different command values. You change mode with a Stop or Repeated Start.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For initializing :

// init
twi("s76 8035 8002 8004 8008 8010 8040 00A8p");
twi("s76 8034 8001-8002 8006 800F 0080p");
// write 'ABC' to line 1
twi("s76808040C1C2C3p");
// write 'ABC' to line 2
twi("s7680C040C1C2C3p");

By the way I use a 2x16-character display, bought @ Farnell (http://nl.farnell.com/jsp/search/productdetail.jsp?sku=1220409)
Some remarks :
* I did not find many working examples, this is a compilation of several examples until I got it working
* Mine has a strange charset, ABC begins at 0xC1 instead of 0x41
* I use an own TWI library, but I hope the idea is clear - 's' is start, 'p' is stop, digits are send in hex

Greets
Patrick

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The data sheet for the controller and for the display itself is available from Farnell.

It must just be a case of following the correct sequences.

I presume that you want to end up with a similar API to a regular HD44780 display. e.g. lcd_init(16), lcd_goto(x, y), lcd_putchar(c), lcd_puts(s), etc...

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Paddy wrote:

* Mine has a strange charset, ABC begins at 0xC1 instead of 0x41
Greets
Patrick

For some reason you have to add An Offset 0x80 to every character you write to the LCD. For your example character 'A' you have to write 0x41 + 0x80 = 0xC1 just like you expierenced. It is specified like this in the character set in the datasheet of the batron LCD.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The LCD display is working.

There is indeed a difference in the Batron LCD display used in Avr Applnote AVR155, and the batron that i used.

AVR155 uses Batron BT21605V-SRE-I2C-COG
I Use BATRON BTHQ 21605AV-YETF-LED04-I2C-5V

The ..COG type means Chip-On-Glas. While
mine is an LCD mounted on a PCB.

The contrast LCD reset and the Contrast steering signals are brought outside on the COG type. On the PCB version these features have to be set via I2C commands.

So the fact that my LCD screen stayed BLANK was due to a contrast problem.

After initialising the constrast Values the LCD worked.

You can find a list of initialisation command on the website DATA-MODULE AG

www.data-module.de Click further on
- Support
- Driver
- PCF2119 BT21605

Here they are anyhow.

//Initialisation sample and Ram writing routine for PCF2119

void Display_init(void)
{
Reset=1;
delay_ms(5);
Reset=0;
delay_ms(5000);
iic_start();
iic_write(0x76); // i2c slave Address
iic_write(0x00); // Control byte for Instruction
iic_write(0x34); // DL: 8 bits, M: 16 by two line display, SL: 1:18, H: normal instruction set
iic_write(0x0C); // D: Display on, C: curser off, B: blink off
iic_write(0x06); // I/D: increment, S: no shift
iic_write(0x35); // DL: 8 bits, M: 16 by two line, SL: 1:18, H: extended instruction set
iic_write(0x04); // P: left to right, Q: top to bottom
iic_write(0x10); // TC1: 0, TC2: 0
iic_write(0x42); // HV Stages 3
iic_write(0x9f); // set Vlcd, store to VA
iic_write(0x34); // DL: 8 bits, M: two line, SL: 1:18, H: normal instruction set
iic_write(0x80); // DDRAM Address set to 00hex
iic_write(0x02); // return home
iic_stop();
}

void Write_text(void)
{
int i;
iic_start();
iic_write(0x76); // i2c slave Address
iic_write(0x00); // Control byte for Instruction
iic_write(0x80); // DDRAM Address set to 00hex
iic_stop();

iic_start();
iic_write(0x76); // i2c slave Adress
iic_write(0x40); // Control byte for Data
for (i=1;i<=16;i++)
{
iic_write(0xC0+i); // Write ABCDE....
}
iic_stop();
iic_start();
iic_write(0x76); // i2c slave Adress
iic_write(0x00); // Control byte for Instruction
iic_write(0xc0); // DDRAM Address set to 10hex
iic_stop();

iic_start();
iic_write(0x76); // i2c slave Address
iic_write(0x40); // Control byte for Data
for (i=1;i<=16;i++)
{
iic_write(0xe0+i); // Write abcde....
}
iic_stop();
}

void upside_down(void)
{
iic_start();
iic_write(0x76);
iic_write(0x00); // Control byte for Instruction
iic_write(0x35); // DL: 8 bits, M: 16 by two line, SL: 1:18, H: extended instruction set
iic_write(0x07); // P=1; Q=1;
iic_stop();
}

void normal(void)
{
iic_start();
iic_write(0x76);
iic_write(0x00); // Control byte for Instruction
iic_write(0x35); // DL: 8 bits, M: 16 by two line, SL: 1:18, H: extended instruction set
iic_write(0x04); // P=0; Q=0;
iic_stop();
}

Thanks for all reply's
Fabrizio

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am pleased that it works.

You just need to write some functions with a reasonably pleasant API. Patrick's method is quite tidy.

On the other hand you can always write void functions with void parameters if that is what you like.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
For some reason you have to add An Offset 0x80 to every character you write to the LCD. For your example character 'A' you have to write 0x41 + 0x80 = 0xC1 just like you expierenced. It is specified like this in the character set in the datasheet of the batron LCD.

Yep, that is correct... But why define a charset which has such strange numbering ? For example when sending the CLR-command to the display, it fills all locations with charcode 0x20. Normally this is a space, with this exotic charset the display gets filled with an arrow to right.
The reason I use this display was that it was the only 3V3 I2C display at the moment available from Farnell.
Does anyone know what the advantage of this kind of charset is ?

By the way, since I got this display working, I like the possibillities. You can program it to display everything mirrored / upside-down and you only need to provide 3V3, there is a programmable step-up converter inside that produces about 6V for the display.

Patrick

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have used a different Batron COG graphic display.

It required a fair bit of setting up, but once you get the hang of it ------ you can set contrast, voltage-generator, writing upside-down, right-to-left, power-save etc. This is all done in lcd_init() and forgotten about.

The strange font is presumably for a non-European market. But is fairly simple to map to a regular ASCII layout.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
* I use an own TWI library, but I hope the idea is clear - 's' is start, 'p' is stop, digits are send in hex

I just uploaded the TWI library I use. Not sure if it comes into the projects correctly, otherwise you can download it from www.paddyelectronics.com. The lib is called PELIB

Bye

paddy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Fabrizio - thanks for publishing the code. I've got one of these displays I've been trying to get working with a PIC and just been getting a nice green nightlight. I had wondered whether it was contrast, but had just had a cursory look at the datasheet when I tried Google and found this article. Now I've got something coming out I at least know the 2119 isn't fried and can look into it more without worrying I'm working with a dead chip!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I hope you will read this message...

I have a BTHQ21605 (COG version) on a board. I2C is working since I have the good waveforms on analyser. I reset correctly the LCD :

Reset = 1;
Wait 5ms
Reset = 0;
Wait 5s

And then I write init command to LCD but it never acknowledge. Power rails are ok (verified with scope : 3V, I use 10kohms pull up and SCL frequency is not very high. Signal integrity is good.

Since Batron fu*** datasheet does not provide I2C adress, I use the 2 possibles ones (0x74 and 0x76), but LCD seems to be dead. I bought I new one today, but this one does'nt acknowledge :

Send start
Send adresse in writing mode (0x74 or 0x76)
Wait and check LCD ack : always 1 !

There is something strange : Vlcd is near 0V... Did it should be 5V before LCD initialization ?

Any Ideas ?

Thanks !!!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Better late than never...
It seems like you have a problem with LCD voltage. What is VLCD pin configuration in your circuit?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everyone, sorry for getting this post up so many years later but I am working with this LCD and I want to know if it is possible to set the LCD blank when you got it cleared without the triangle simbols, cause I don´t like to write ' ' characters so to make the triangles disappear :s

 

Thanks!!!