I have read manual, and it says nothing about $FE, and why it can't be $DC, for example.
And how this breaking into nibbles is done?
Can I have an example?
I mean, how can I instruct LCDOUT to send 8 bit data command.
I have read manual, and it says nothing about $FE, and why it can't be $DC, for example.
And how this breaking into nibbles is done?
Can I have an example?
I mean, how can I instruct LCDOUT to send 8 bit data command.
$FE is the "signal" to the compiler that the next byte should be sent to the LCD as a command and not as data. The fact that it's $FE and not something else is most likely because $FE in the character set of the HD44780 is a white space (at least in ROM code A00) which there already is a valid ASCII code for within the character set ($20).
DEFINE LCD_BITS 8 will instruct the compiler to talk to the LCD in 8-bit mode. This IS covered in the manual, there's even setup code and schematic for 8-bit mode. The LCDOUT command itself is used exactly the same, no matter 4 or 8 bit mode. Read through the section on LCDOUT again.
I know how to set up 8 bit connection.
I want to learn how to transfer 8 or 16 bits with 4 bit connection.
Because say
LCDOUT $FE,0,1
is NOT equal (in terms what I see on display)
to
LCDOUT $FE,0
LCDOUT $FE,1
So I guess, on each LCDOUT statement, there's something special made to display. So I'm interested exactly what happens.
Again, $FE is the "signal" to the compiler that the next byte should be sent to the LCD as a command and not as data.
LCDOUT $FE, 0, 1 will send the value 0 to the instruction register and then the value 1 to the data register of the LCD controller.
LCDOUT $FE, 0, $FE, 1 will send 0 and 1, both to the instruction register.
On the LCD controller the RS-pin is what controls which register the data ends up with. $FE tells the compiler to generate code that pulls the RS-line LOW for the duration of the next byte transfer. It's as simple as that and it feels to me like your reading too much into it.
Last edited by HenrikOlsson; - 7th August 2021 at 22:35.
I'm trying to deal with ST7920 controller, to enable the graphics mode.
It needs a complex initialization sequence. (like send this, then wait xx ms, then pull e high, then pull e down, then wait again, then send and so on) To make things simpler, I wanted to use LCDOUT, instead of port bitbanging, but as it seems, that is impossible.
Well, LCDOUT is designed for 44780 compatible controllers. A quick look at the ST7920 datasheet seems to indicate that it's sort of compatible but with extended functionallity. It may or may not work with LCDOUT.
Do you have it connected with 4-bit or 8-bit interface?
I would let the compiler do the initial initalization, setting 4/8-bit interface etc. Then I would make two manual writes enabling graphics mode and extended function set mode, making SURE I don't change the 4/8-bit mode flag when doing so. See the note in the datasheet that you can't change DL, RE, and G at the same time, hence the multiple writes. Provided 4-bit interface is used I would try:
Code:LCDOUT $FE, %00100100 ' Enable extended instruction set, keep 4-bit interface. LCDOUT $FE, %00100110 ' Enable graphics mode, keep 4-bit interface and extended instruction set.
Yes I have it connected via 4 bit interface. This is a special kind of ST7920 module, which has physical dimensions and pinout of standard 1602 LCD module, and in most cases, just works as drop-in replacement.
So far, I've figured an easy ways how to use LCDOUT to display all extended characters and features for this display. The graphic mode remains a mystery. My idea is to develop a PBP code, which will allow to use this module with existing 1602 LCD codes with as less modification, as possible.
I will try your solution today later and will write back.
Bookmarks