as in my demo
Code:Pause 1500 ' LCD initialize time lcdout $FE,1 gosub st7920_init 'graphic mode
as in my demo
Code:Pause 1500 ' LCD initialize time lcdout $FE,1 gosub st7920_init 'graphic mode
Warning I'm not a teacher
[mega facepalm] DUH!!!
Thanks Richard.
Troy
Well, the zeros are still appearing even with up to 5 consecutive commands to clear the character memory. However, probably not as often. Definitely is text in the character display memory that's causing it - no doubt about it, but I'm also sure I'm doing something wrong with either the wiring or initialisation. Probably tolerable for now.
Troy
at one stage i did init like this
st7920_init:
lcdout $FE,$24 'In same instruction cannot alter DL, RE and G at once. Make sure that change DL or G first and then RE.
Pause 5
lcdout $FE,$26
Pause 5
bgcolour = 0
colour = 1
return
also look at defines' these may need a fiddle if you display is slower than mine
DEFINE LCD_COMMANDUS 1000 'defines the delay after LCDOUT statement DEFINE LCD_DATAUS 40 'delay in micro seconds
ps i changed to serial mode, perhaps thats why , i forget
Warning I'm not a teacher
No luck. Maybe 1 in 10 starts I still get the zeros. Tried increasing the DEFINE LCD_COMMANDUS 1000 to 1500 and DEFINE LCD_DATAUS to 100 and inserted the code you suggested. I didn't mention I need to call the graphic mode initialisation routine a few times to get a reasonably reliable initialisation which might trigger alarm bells? So, my hunch is the display might be slightly different or my wiring is missing something: I've wired up RS, E, RW and the 4 high bits of the data bus and 5V rails. I can't think of anything else?
Troy
does it make a difference if you power it down verses a reset >\?
also if you look at the data sheet you can see what commands are needed to make a routine to revert to lcd mode, do a clear screen then return to graphics mode
Warning I'm not a teacher
Haven't tried 1st suggestion yet, but I've been playing around with your 2nd suggestion... well... I can't find a datasheet for my displays so I've been playing the old game of finding a ST7920 DS with commands that might be close enough. So, I found one that lists a command that turns the graphics display on / off. So, I've tried simulating the issue and it goes like this:
init code
...
run some st7920_init calls with pauses
...
...
your extra LCD commands...
...
pause 1000
lcdout $FE, %00100100 'Command to turn off graphics mode
pause 1000
lcdout $FE,1,"123" 'clear screen and display 123 in top left corner in text mode - the numbers 123 *are* displayed in the top left
pause 1000
lcdout $FE,1 'Clear screen for text mode - screen *is* cleared
pause 1000
lcdout $FE, %00100110 'command to turn graphics mode back on - screen still cleared (replacing this with "gosub st7920_init" produces the same outcome)
gosub grf_clr 'clear graphics display
colour = 1
FILLRECT 5,35,120,8
ARRAYWRITE BUFF2,["WAITING FOR LOAD CELL",0]
DMDSTR 5,10, BUFF2,1
ARRAYWRITE BUFF3,["SERIAL STREAM",0]
DMDSTR 5,25, BUFF3,1
gosub show 'here the stuff just here (supposed to be displayed) is displayed BUT my 123 text in the top left has also reappeared which is supposed to be cleared whilst in text mode
?????
Bookmarks