hi guys, i got this lcd screen, but I cant read this datasheet, first there is no cs2 which is !cs so im not too worried about it,
BUT look at truth table, there is A0, /rd, /wr, but rd & wr is a state of a0, so when/how do i switch it?
pls just a simple psudo is all i need , just something to make a few pixles appear , ie
cs
switch a
shift instruction
switch rd
shift data
cs off
I don't think that you can read anything from it, because there's no SO line anyway (which they used to have on their LCDs). So, I would simply ignore the /RD /WR columns.
I think you just use SI and SCL to bit-bang the commands to the display.
I looked at my code for NHD0420DZW. In purely serial mode, each command would consist of 10 bits - RS bit (data/command), RW bit (read/write), then 8 bits of the data. For example to send a command (RS=0):
There's only few possible combinations to consider:
A0 - either sent like a bit or hardrawe signal
RW/RD - either both sent or one of them sent, or none.
It won't show you anything until you initizlize properly, including considerable wait for the clear command. Here's my initialization sequence (don't know if it will work for yours):
.byte 0x38 + DISPLAY_TABLE ; function set
.byte 0x08 ; display off
.byte 0x01 ; clear display
.byte 0x06 ; I/D = 1; S = 0
.byte 0x02 ; return home
.byte 0x0c ; display on
ok well thats np , i have int code off data sheet which goes:
main (){
Code:
INSTRUCT (0,2,0xA0);
INSTRUCT (0,2,0xAE); // display off
INSTRUCT (0,2,0xC0);
INSTRUCT (0,2,0xA2);
INSTRUCT (0,2,0x2F);
INSTRUCT (0,2,0x26);
INSTRUCT (0,2,0x81);
INSTRUCT (0,2,0x11); //set address upper bit
INSTRUCT (0,2,0xAF); // dislpay on
Delay10KTCYx(10);
while (1){
LCDb(6);
INSTRUCT (0,2,165); Delay100TCYx(100);
INSTRUCT (0,2,164); Delay100TCYx(100);
}}
while switching over the lang i also looked up the val for a0, but in every instance it is 0, so that solves that for now, but a0 is a hard pin, and clocks in at d0.
also going through this again i have noticed that RW != RD always... but have tried on both 1st & 2nd clock bits, aswell as the 1st bit alone. also im shifting MSB first, correct!?
The data bit (A0?) is supposed to be set. This is how it tells data from commands.
The data sheet doesn't give much details, but they do have a test code. I commented it as I understand it:
Code:
Sub Command
Reset P3.7 ; CS down
Reset P3.4 ; A0 down
For Writecount = 1 To 8
Rotate A , Left , 1
Reset P3.1 ; SCL down
P1 = A ; set SI
Set P3.1 ; SCL up
Next Writecount
Set P3.7 ; CS up
End Sub
When you send data (characters), their example is the same, but A0 is up.
That's quite different from mine.
Whewn initializing, try wait few ms between each command.
thnx guys for staying with this here, but you were rite from post 1 & 2, turns out my biggest problem was that i had 2 pins mixed, a0 & ck, I also have never initialized an lcd before so that was new too, simple, but i thought it to be non-essential, but we still have that mystery of how to call command 6, where a0 = 1 and /rd = 1, either way who cares!!! i contacted digikey and my(digikeys) sheet was 1/10th the size of the manuf one that they gave me, i'm going to guess that the sheet was chopped from another similar one, since theirs showed /cs1 & /cs2 and other pins i didnt have. I was also able to remove all the delays and bump that clock up to full speed with great results
so thnx again!
also! i thought i'd take the time to share the vb6 program i made:
it is able to import a b/w bit bitmap off the HD or freehand draw an image.
it can then take that image and convert it to 128x64 resolution,
then convert to both bytecode
then compress to hex,
then trim the top and left 0's
giving me a nice hex sprite for my LDC
i have included source code for ones like me who dont like exe's!
(18f4620)
i have seen alot of topics about lcd code, and idk if im interested in extending any buffers or anything crazy, i was thinking about just going off eeprom to a few write arrays, would that sound good for efficient coding?