fl hex { 240X68dots Graphic LCD WD-G2406B-1YLYa 2013/03/02 21:06:36 PropForth5.2/5.0 Using graphic-LCD(WD-G2406B-1YLYa) Propeller WD-G2406B-1YLYa 1 FG P0 ---------- 2 DIO1(FLM) P1 ---------- 3 LP P2 ---------- 4 SCP P3 ---------- 5 FR(M) P4 ---------- 6 DI 7 Vdd 8 -Vee 9 Vss 10 Vadj P5 ---------- -9V_on } lockdict create WD_G2406B forthentry $C_a_lxasm w, h148 h113 1- tuck - h9 lshift or here W@ alignl h10 lshift or l, z2WyPW1 l, zfiPZB l, z2WibJC l, zfyPW1 l, z2WibRC l, zfyPW1 l, z2WibZC l, zfyPW1 l, z2WibeC l, z2WiPZB l, z20yPW4 l, z2Wybj1 l, zfibmC l, z2WyPWV l, zfiPZB l, z1bixmC l, z1SyLI[ l, z2WyPW2 l, z2WibuB l, z2WyPc0 l, z2WyPjU l, ziQ57 l, zfyQ0O l, z20ybr1 l, z2WyPr8 l, zgyQ01 l, z1jix\6 l, z1bix\4 l, z1SybCx l, z1[ix\4 l, z1SybCx l, z3[yPvf l, z3[yPnb l, z1bix\3 l, z26VPc0 l, z1rix\2 l, z1SybCx l, z1[ix\3 l, z3[yPfa l, z26VPb2 l, z1rix\5 l, z3[yP[\ l, z1SV04[ l, z2WiQFk l, z20yQ8l l, z3ryQ80 l, z1SV000 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, \ ~ h38 c, h6C c, hC6 c, hC6 c, h6C c, h28 c, hEE c, h00 c, \ ohm wvariable vidMem d2040 allot \ 30bytes X 68bytes \ charcter position vidX=0-d29 vidY=0-7 wvariable vidX wvariable vidY \ basepin for DMF-51026NY-LY's control 0 wconstant BASE \ Clear vidMem \ ( n1 n2 -- ) n1:start address n2:number of word (2byte) : clear_vram 0 do dup 0 swap W! 2+ loop drop ; : demo BASE 5 + pinout \ Disable -9V c" vidMem BASE WD_G2406B" 0 cogx \ Drive graphicLCD 1 delms BASE 5 + pinhi \ Enable -9V 1 delms 0 vidX W! 0 vidY W! vidMem d1020 clear_vram Font \ top address for character begin d96 0 do ." number= " i . cr dup i 3 lshift + \ Get Font-address vidMem vidX W@ + vidY W@ d240 u* + \ Calculate address of vidMem swap st? \ Copy character to vidMem 8 0 do 2dup C@ dup . swap i d30 u* + dup . C! 1+ \ Font-address + 1 cr loop 2drop vidX W@ 1+ dup d30 = \ Check if vixX = 30 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 \ LCD-off BASE 5 + pinlo \ Disable -9V 0 cogreset ; decimal { Driver for WD-G2406B-1YLYa ( 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 $C_treg1 , $C_stTOS add $C_treg1 , # 4 mov __data , # 1 shl __data , $C_treg1 mov $C_treg1 , # h1F 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 mov $C_treg3 , # d30 __4 \ Read vidmem rdbyte $C_treg5 , __vid shl $C_treg5 , # d24 add __vid , # 1 mov $C_treg4 , # 8 __5 \ Shift one pixel to lcd shl $C_treg5 , # 1 wc muxc outa , __data \ Set CP to High or outa , __cp jmpret __delay_ret , # __delay \ Set CP to Low andn outa , __cp jmpret __delay_ret , # __delay djnz $C_treg4 , # __5 djnz $C_treg3 , # __4 \ Set LP or outa , __lp \ Set FLM cmp $C_treg2 , # d64 wz muxz outa , __flm \ wait jmpret __delay_ret , # __delay andn outa , __lp djnz $C_treg2 , # __3 cmp $C_treg2 , # 2 wz \ Set M muxz outa , __m djnz $C_treg1 , # __2 jmp # __1 __delay mov $C_treg6 , cnt add $C_treg6 , # d50 waitcnt $C_treg6 , # 0 __delay_ret ret __flm 0 __lp 0 __cp 0 __m 0 __data 0 __vid 0 ;asm WD_G2406B }