Say if 1% precision for me is enough, still 18F needed?
Say if 1% precision for me is enough, still 18F needed?
Got some time and tested that approach with ST7920. And it indeed works.
While PBP seems to beginning to belong to dead language category, I'll leave this simple code here anyways - maybe someone will find it useful.
ST7920 is wired as standard HD44780 in 4 bit mode. With appropriate LCD pins defined.
Note: X counter increases after each write by itself, but Y counter - not, so you have to do it manually.Code:LCDOUT $FE,$2E 'enable graphic mode LCDOUT $FE,$80 'set Y position to zero (Top) LCDOUT $FE,$80 set X position to zero (Left) LCDOUT 255 'draw a line consisting of 8 pixels in top left row
And this simple code fills up entire screen with white:
Code:LCDOUT $FE,$2E for Z=0 to 32 LCDOUT $FE,$80+z LCDOUT $FE,$80 FOR x=1 TO 18 LCDOUT 255 NEXT next
How to send $FE with LCDOUT ?
X=$FE
LCDOUT X
It sends statements instead of byte dataFound this accidentally - one of my custom font letters contained $FE pixels, and when using that char, it blowed up all my code. Took me several days to figure the reason (I was thinking about faulty EEPROM, display controller, SRAM on PIC and so on)
Any ideas?
This is very annoying and trashes whole idea of using LCDOUT statement...
At the very beginning of this thread we went over how LCDOUT works, how it determines if what you give it should be sent as data or as commands, ie the $FE prefix. Now, a couple of weeks later you claim to have found this by accident and all of a sudden the LCDOUT command is at fault and doesn't work.
LCDOUT works perfectly fine for its intended purposes. You're trying to use it for something it was not designed for and because that doesn't work the way you'd like the command is flawed, is that correct?
Apart from editing the custom characters to not include $FE and/or writing your own routines to drive the display I don't have any ideas.
Well, I have shifted letters to right edge, instead of left, and for text it indeed works, but when there is need to display the graphics...
I'm using LCDOUT due it's simplicity and low memory use.
The code below occupies less than 1k of memory (font data stored in eeprom), and allows you to have 4 lines X 18 characters text display with all custom letters on graphical display.
Code:C=0 '0=1st line, 8=2nd line, 16=3rd line and 24=4th line arraywrite topline, ["place text here "] GOSUB GCODER stop GCODER: FOR X=0 TO 17 step 2 'READ ARRAY INTO VARIABLE, ARRAY MEMBER CHAR=EEPROM OFFSET Y=(topline[x]-65)*8 Z=(topline[x+1]-65)*8 'READ INTO VARIABLE AS TWINS FOR I=0 TO 7 'HELPER LOOP FOR CHARACTER READING READ Y+I,A 'READ EEPROM BYTES INTO VAR READ Z+I,B LCDOUT $FE,$80+i+c 'UPDATE Y POSITION LCDOUT $FE,$80+x/2 'UPDATE X POSITION if topline[x]=32 then a=0 if topline[x+1]=32 then b=0 'blanker LCDOUT a LCDOUT b 'WRITE TO SCREEN 'pause 10 NEXT I NEXT X return
Bookmarks