fl hex { 160X64dots Graphic LCD DMF-51026NY-LY 2013/01/09 22:44:10 PropForth5.2/5.0 } lockdict create DFM-51026 forthentry $C_a_lxasm w, h150 h113 1- tuck - h9 lshift or here W@ alignl h10 lshift or l, z2WyPW1 l, zfiPZB l, z2WicBC l, zfyPW1 l, z2WicJC l, zfyPW1 l, z2WicRC l, zfyPW1 l, z2WicZC l, z2WiceB l, z20ycb4 l, z2WyPZy l, zfiPZB l, z1bixmC l, z1SyLI[ l, z2WyPW2 l, z2WicmB l, z2WyPc0 l, z26VPc0 l, z1bdx\9 l, z1[\x\9 l, z2WyPjK l, ziQ5E l, z2WicuG l, z2WyPr2 l, z1bix\B l, z26VPr2 l, zbtQ04 l, z1WyQ0F l, zfiQ5D l, z1bixZG l, z1Syc55 l, z1[ix\B l, z2WyQ0F l, zfiQ5D l, z1[ixZG l, z2WiQ5F l, z1Syc55 l, z3[yPvf l, z20ycj1 l, z3[yPnc l, z1bix\A l, z1Syc55 l, z1[ix\A l, z3[yPf\ l, z26VPW2 l, z1bdx\C l, z1[\x\C l, z3[yP[Z l, z1SV04Y l, z2WiQFk l, z20yQAK l, z3ryQ80 l, z1SV000 l, 0 l, 0 l, 0 l, 0 l, 0 l, 0 l, 0 l, freedict \ Character Font 8X8dots wvariable Font -2 allot h00 c, h00 c, h00 c, h00 c, h00 c, h00 c, h00 c, h00 c, \ (space) h30 c, h78 c, h78 c, h30 c, h30 c, h00 c, h30 c, h00 c, \ ! h6C c, h6C c, h28 c, h00 c, h00 c, h00 c, h00 c, h00 c, \ " " h6C c, h6C c, hFE c, h6C c, hFE c, h6C c, h6C c, h00 c, \ # h18 c, h7E c, hC0 c, h7C c, h06 c, hFC c, h18 c, h00 c, \ $ h00 c, hC6 c, hCC c, h18 c, h30 c, h66 c, hC6 c, h00 c, \ % h38 c, h6C c, h38 c, h76 c, hDC c, hCC c, h76 c, h00 c, \ & h30 c, h30 c, h60 c, h00 c, h00 c, h00 c, h00 c, h00 c, \ \ h18 c, h30 c, h60 c, h60 c, h60 c, h30 c, h18 c, h00 c, \ ( h60 c, h30 c, h18 c, h18 c, h18 c, h30 c, h60 c, h00 c, \ ) h00 c, h66 c, h3C c, hFF c, h3C c, h66 c, h00 c, h00 c, \ * h00 c, h30 c, h30 c, hFC c, h30 c, h30 c, h00 c, h00 c, \ + h00 c, h00 c, h00 c, h00 c, h00 c, h30 c, h30 c, h60 c, \ , h00 c, h00 c, h00 c, hFC c, h00 c, h00 c, h00 c, h00 c, \ - h00 c, h00 c, h00 c, h00 c, h00 c, h30 c, h30 c, h00 c, \ . h06 c, h0C c, h18 c, h30 c, h60 c, hC0 c, h80 c, h00 c, \ / h7C c, hC6 c, hC6 c, hD6 c, hC6 c, hC6 c, h7C c, h00 c, \ 0 h30 c, h70 c, h30 c, h30 c, h30 c, h30 c, hFC c, h00 c, \ 1 h78 c, hCC c, h0C c, h38 c, h60 c, hCC c, hFC c, h00 c, \ 2 h78 c, hCC c, h0C c, h38 c, h0C c, hCC c, h78 c, h00 c, \ 3 h1C c, h3C c, h6C c, hCC c, hFE c, h0C c, h1E c, h00 c, \ 4 hFC c, hC0 c, hF8 c, h0C c, h0C c, hCC c, h78 c, h00 c, \ 5 h38 c, h60 c, hC0 c, hF8 c, hCC c, hCC c, h78 c, h00 c, \ 6 hFC c, hCC c, h0C c, h18 c, h30 c, h30 c, h30 c, h00 c, \ 7 h78 c, hCC c, hCC c, h78 c, hCC c, hCC c, h78 c, h00 c, \ 8 h78 c, hCC c, hCC c, h7C c, h0C c, h18 c, h70 c, h00 c, \ 9 h00 c, h30 c, h30 c, h00 c, h00 c, h30 c, h30 c, h00 c, \ : h00 c, h30 c, h30 c, h00 c, h00 c, h30 c, h30 c, h60 c, \ ; h18 c, h30 c, h60 c, hC0 c, h60 c, h30 c, h18 c, h00 c, \ < h00 c, h00 c, hFC c, h00 c, h00 c, hFC c, h00 c, h00 c, \ = h60 c, h30 c, h18 c, h0C c, h18 c, h30 c, h60 c, h00 c, \ > h78 c, hCC c, h0C c, h18 c, h30 c, h00 c, h30 c, h00 c, \ ? h7C c, hC6 c, hDE c, hDE c, hDC c, hC0 c, h78 c, h00 c, \ @ h30 c, h78 c, hCC c, hCC c, hFC c, hCC c, hCC c, h00 c, \ A hFC c, h66 c, h66 c, h7C c, h66 c, h66 c, hFC c, h00 c, \ B h3C c, h66 c, hC0 c, hC0 c, hC0 c, h66 c, h3C c, h00 c, \ C hF8 c, h6C c, h66 c, h66 c, h66 c, h6C c, hF8 c, h00 c, \ D hFE c, h62 c, h68 c, h78 c, h68 c, h62 c, hFE c, h00 c, \ E hFE c, h62 c, h68 c, h78 c, h68 c, h60 c, hF0 c, h00 c, \ F h3C c, h66 c, hC0 c, hC0 c, hCE c, h66 c, h3E c, h00 c, \ G hCC c, hCC c, hCC c, hFC c, hCC c, hCC c, hCC c, h00 c, \ H h78 c, h30 c, h30 c, h30 c, h30 c, h30 c, h78 c, h00 c, \ I h1E c, h0C c, h0C c, h0C c, hCC c, hCC c, h78 c, h00 c, \ J hE6 c, h66 c, h6C c, h78 c, h6C c, h66 c, hE6 c, h00 c, \ K hF0 c, h60 c, h60 c, h60 c, h62 c, h66 c, hFE c, h00 c, \ L hC6 c, hEE c, hFE c, hFE c, hD6 c, hC6 c, hC6 c, h00 c, \ M hC6 c, hE6 c, hF6 c, hDE c, hCE c, hC6 c, hC6 c, h00 c, \ N h38 c, h6C c, hC6 c, hC6 c, hC6 c, h6C c, h38 c, h00 c, \ O hFC c, h66 c, h66 c, h7C c, h60 c, h60 c, hF0 c, h00 c, \ P h78 c, hCC c, hCC c, hCC c, hDC c, h78 c, h1C c, h00 c, \ Q hFC c, h66 c, h66 c, h7C c, h6C c, h66 c, hE6 c, h00 c, \ R h78 c, hCC c, hC0 c, h78 c, h0C c, hCC c, h78 c, h00 c, \ S hFC c, hB4 c, h30 c, h30 c, h30 c, h30 c, h78 c, h00 c, \ T hCC c, hCC c, hCC c, hCC c, hCC c, hCC c, hFC c, h00 c, \ U hCC c, hCC c, hCC c, hCC c, hCC c, h78 c, h30 c, h00 c, \ V hC6 c, hC6 c, hC6 c, hD6 c, hFE c, hEE c, hC6 c, h00 c, \ W hC6 c, h6C c, h38 c, h38 c, h6C c, hC6 c, hC6 c, h00 c, \ X hCC c, hCC c, hCC c, h78 c, h30 c, h30 c, h78 c, h00 c, \ Y hFE c, hC6 c, h8C c, h18 c, h32 c, h66 c, hFE c, h00 c, \ Z h78 c, h60 c, h60 c, h60 c, h60 c, h60 c, h78 c, h00 c, \ [ hC0 c, h60 c, h30 c, h18 c, h0C c, h06 c, h02 c, h00 c, \ \ h78 c, h18 c, h18 c, h18 c, h18 c, h18 c, h78 c, h00 c, \ ] h10 c, h38 c, h6C c, hC6 c, h00 c, h00 c, h00 c, h00 c, \ ^ h00 c, h00 c, h00 c, h00 c, h00 c, h00 c, h00 c, hFF c, \ _ h30 c, h18 c, h0C c, h00 c, h00 c, h00 c, h00 c, h00 c, \ ` h00 c, h00 c, h78 c, h0C c, h7C c, hCC c, h76 c, h00 c, \ a hE0 c, h60 c, h60 c, h7C c, h66 c, h66 c, hDC c, h00 c, \ b h00 c, h00 c, h78 c, hCC c, hC0 c, hCC c, h78 c, h00 c, \ c h1C c, h0C c, h0C c, h7C c, hCC c, hCC c, h76 c, h00 c, \ d h00 c, h00 c, h78 c, hCC c, hFC c, hC0 c, h78 c, h00 c, \ e h38 c, h6C c, h60 c, hF0 c, h60 c, h60 c, hF0 c, h00 c, \ f h00 c, h00 c, h76 c, hCC c, hCC c, h7C c, h0C c, hF8 c, \ g hE0 c, h60 c, h6C c, h76 c, h66 c, h66 c, hE6 c, h00 c, \ h h30 c, h00 c, h70 c, h30 c, h30 c, h30 c, h78 c, h00 c, \ i h0C c, h00 c, h0C c, h0C c, h0C c, hCC c, hCC c, h78 c, \ j hE0 c, h60 c, h66 c, h6C c, h78 c, h6C c, hE6 c, h00 c, \ k h70 c, h30 c, h30 c, h30 c, h30 c, h30 c, h78 c, h00 c, \ l h00 c, h00 c, hCC c, hFE c, hD6 c, hD6 c, hC6 c, h00 c, \ m h00 c, h00 c, hF8 c, hCC c, hCC c, hCC c, hCC c, h00 c, \ n h00 c, h00 c, h78 c, hCC c, hCC c, hCC c, h78 c, h00 c, \ o h00 c, h00 c, hDC c, h66 c, h66 c, h7C c, h60 c, hF0 c, \ p h00 c, h00 c, h76 c, hCC c, hCC c, h7C c, h0C c, h1E c, \ q h00 c, h00 c, hDC c, h76 c, h66 c, h60 c, hF0 c, h00 c, \ r h00 c, h00 c, h7C c, hC0 c, h78 c, h0C c, hF8 c, h00 c, \ s h10 c, h30 c, h7C c, h30 c, h30 c, h34 c, h18 c, h00 c, \ t h00 c, h00 c, hCC c, hCC c, hCC c, hCC c, h76 c, h00 c, \ u h00 c, h00 c, hCC c, hCC c, hCC c, h78 c, h30 c, h00 c, \ v h00 c, h00 c, hC6 c, hD6 c, hD6 c, hFE c, h6C c, h00 c, \ w h00 c, h00 c, hC6 c, h6C c, h38 c, h6C c, hC6 c, h00 c, \ x h00 c, h00 c, hCC c, hCC c, hCC c, h7C c, h0C c, hF8 c, \ y h00 c, h00 c, hFC c, h98 c, h30 c, h64 c, hFC c, h00 c, \ z h1C c, h30 c, h30 c, hE0 c, h30 c, h30 c, h1C c, h00 c, \ { h30 c, h30 c, h30 c, h30 c, h30 c, h30 c, h30 c, h00 c, \ | hE0 c, h30 c, h30 c, h1C c, h30 c, h30 c, hE0 c, h00 c, \ } h76 c, hDC c, h00 c, h00 c, h00 c, h00 c, h00 c, h00 c, \ ~ wvariable vidMem d1278 allot \ 20bytes X 64bytes \ charcter position vidX=0-d19 vidY=0-7 wvariable vidX wvariable vidY \ basepin for DMF-51026NY-LY's control { P* -- FLM P* + 1 -- LP P* + 2 -- CP P* + 3 -- M P* + 4 -- D0 P* + 5 -- D1 P* + 6 -- D2 P* + 7 -- D4 P* + 8 -- DISPOFF } 8 wconstant BASE : demo BASE 8 + dup pinout \ Disable graphicLCD c" vidMem BASE DFM-51026" 0 cogx \ Drive graphicLCD 1 delms pinhi \ Enable graphicLCD 0 vidX W! 0 vidY W! Font \ top address for character begin d95 0 do ." number= " i . cr dup i 3 lshift + \ Get Font-address 1- vidMem vidX W@ + vidY W@ d160 u* + \ Calculate address of vidMem swap st? \ Copy character to vidMem 8 0 do 2dup 1+ C@ dup . swap i d20 u* + dup . C! 1+ \ Font-address + 1 cr loop 2drop vidX W@ 1+ dup d20 = \ Check if vixX = 20 if drop 0 vidX W! vidY W@ 1+ dup 8 = \ Check if vixY = 8 if drop 0 vidY W! else vidY W! then else vidX W! then loop ." AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" st? fkey? swap drop until drop BASE 8 + pinlo \ Disable graphicLCD 0 cogreset ; : demo1 BASE 8 + dup pinout \ Disable graphicLCD c" vidMem BASE DFM-51026" 0 cogx \ Drive graphicLCD 1 delms pinhi \ Enable graphicLCD 0 vidX W! 0 vidY W! begin d1280 0 do hFF i vidMem + C! loop fkey? swap drop until BASE 8 + pinlo \ Disable graphicLCD 0 cogreset ; : demo2 BASE 8 + dup pinout \ Disable graphicLCD c" vidMem BASE DFM-51026" 0 cogx \ Drive graphicLCD 1 delms pinhi \ Enable graphicLCD 0 vidX W! 0 vidY W! begin d1280 0 do h00 i vidMem + C! loop fkey? swap drop until BASE 8 + pinlo \ Disable graphicLCD 0 cogreset ; decimal { Driver for DMF-51026NY-LY ( n1 n2 -- ) n1:Address of vidMem n2:basepin fl build_BootOpt :rasm mov $C_treg1 , # 1 shl $C_treg1 , $C_stTOS \ Get FLM mov __flm , $C_treg1 shl $C_treg1 , # 1 \ Get LP mov __lp , $C_treg1 shl $C_treg1 , # 1 \ Get CP mov __cp , $C_treg1 shl $C_treg1 , # 1 \ Get M mov __m , $C_treg1 \ Get top of data mov __data , $C_stTOS add __data , # 4 mov $C_treg1 , # hFF shl $C_treg1 , $C_stTOS \ Set pins to output or dira , $C_treg1 spop __1 mov $C_treg1 , # 2 __2 \ Get vidMem mov __vid , $C_stTOS mov $C_treg2 , # d64 __3 \ Set FLM cmp $C_treg2 , # d64 wz if_z or outa , __flm if_nz andn outa , __flm mov $C_treg3 , # d20 __4 \ Read vidmem rdbyte $C_treg5 , __vid mov __tmp , $C_treg5 mov $C_treg4 , # 2 __5 \ Set CP to High or outa , __cp cmp $C_treg4 , # 2 wz \ Set 4bit-data \ Upper 4bit if_z shr $C_treg5 , # 4 and $C_treg5 , # hF shl $C_treg5 , __data or outa , $C_treg5 jmpret __delay_ret , # __delay \ Set CP to Low andn outa , __cp \ Clear 4bit-data mov $C_treg5 , # hF shl $C_treg5 , __data andn outa , $C_treg5 mov $C_treg5 , __tmp jmpret __delay_ret , # __delay djnz $C_treg4 , # __5 add __vid , # 1 djnz $C_treg3 , # __4 \ Set LP or outa , __lp \ wait jmpret __delay_ret , # __delay andn outa , __lp djnz $C_treg2 , # __3 cmp $C_treg1 , # 2 wz \ Set M if_z or outa , __m if_nz andn outa , __m djnz $C_treg1 , # __2 jmp # __1 __delay mov $C_treg6 , cnt add $C_treg6 , # d148 waitcnt $C_treg6 , # 0 __delay_ret ret __flm 0 __lp 0 __cp 0 __m 0 __data 0 __vid 0 __tmp 0 ;asm DFM-51026 }