What does LCD initialisation 38H mean?

Status
Not open for further replies.

AceOfHearts

New Member
Hi,

I am a bit confused as to what the 38H means and how to work it out.

for my 2x16, I used 38H, but what do I use for a 4x20? How do I get to this figure?

Thanks.
 
Last edited:
38H means 38 hexadecimal, you simply decide what bits you need to set, and generate the hexadecimal value for it - or you could use a binary value?, in which case it's B'00111000'
 
Nigel Goodwin said:
38H means 38 hexadecimal, you simply decide what bits you need to set, and generate the hexadecimal value for it - or you could use a binary value?, in which case it's B'00111000'


Hi thanks for that.

Can someone elucidate a little further? Thanks.
 
Ah 4x20 means four lines of 20 characters. You do seem to be struggling a bit here. Maybe you should back up and compose a set of questions whose answers will get you back on track. You might start with a link to the LCD datasheet so we can all be on the same page.


I suspect there is more to the initialization than 38H.
 
AceOfHearts said:
Hi,

I am a bit confused as to what the 38H means and how to work it out.

for my 2x16, I used 38H, but wha do I use for a 4x20? How do I get to this figure?

Thanks.

hi,
Perhaps this will help.

Also download the Hitachi HD44780 datasheet, this explains the various setup sequences.
 
Last edited:
As most people use 4 bit mode then writing 0x38 is nonsense as bits 3-0 are not connected.

The correct sequence to initialise an LCD is,
Wait 15mS
Write command 0x30
Wait 5mS
Write command 0x30

The LCD is now initialised in 8 bit mode. To change to 4 bit mode write command 0x20.

Mike.
 
IMO, the OP is obviously using a 8 wire configuration with his 2*16 LCD,
which suggests to me he wants to use the same PIC wiring for a 2*20 LCD,
so why is the initialise 0x38, nonsense?
 
ericgibbs said:
IMO, the OP is obviously using a 8 wire configuration with his 2*16 LCD,
which suggests to me he wants to use the same PIC wiring for a 2*20 LCD,
so why is the initialise 0x38, nonsense?

It would be the same for 4x20 as 2x16, it's setting it to 8 bit interface, and 2 line display - as opposed to 4 bit interface and 1 line display.
 
Nigel Goodwin said:
It would be the same for 4x20 as 2x16, it's setting it to 8 bit interface, and 2 line display - as opposed to 4 bit interface and 1 line display.

Isn't that what I said?
 
ericgibbs said:
IMO, the OP is obviously using a 8 wire configuration with his 2*16 LCD,
which suggests to me he wants to use the same PIC wiring for a 2*20 LCD,
so why is the initialise 0x38, nonsense?

I think I didn't explain myself very well.

When they designed the chip they had no way to know if it would be used in 4 or 8 bit mode and so the initialisation had to use only the top 4 bits.

Once the chip is initialised and the data width is selected then writing 0x38 is perfectly valid. The initiation, however, is different and should not be relied upon to setup any registers.

Mike.
 

Hi Mike,
100% in agreement.

Some of my very early documention 'insists' that the 0x38 'must' be used.

Obviously they have have made improvemnts in the HD, its certainly faster than the 1980's versions, also the documention has changed.

Regards
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…