'-------------------------------------------------------------------------------- 'name : GLCD_DMF5001_example 'purpose : Graphic LCD DMF5001NY control example 'micro controller : Mega128 (Kyohritsu-Digit ABL128 board) 'Hardware : Graphic LCD DMF5001NY (Toshiba T6963C controller) ' : 160x128 dots. monochro. (20 char. x 16 line) ' '-------------------------------------------------------------------------------- ' Rem Used ports '-------------------------------------------------------------------------------- ' RESERVED PORTS (unable to use by user) ' ' PE0,1 : reserved by USB communication (UART0 RXD0, TXD0) ' PG4 : reserved by ABL128 boot-loader (changeable by jumper on ABL128 board) ' ' ' GLCD control ports ' ' PC0-7 : LCD - ' Data port must be settled into one 8-bit port. ' In the above case, PortC. ' PA3 : LCD /WR ' PA4 : LCD /RD ' PA5 : LCD /CE ' PA6 : LCD C/D ' PA7 : LCD /Res ' Control lines must be settled into the same port. ' In the above case, all control lines are set to PortA. ' '-------------------------------------------------------------------------------- $regfile = "m128def.dat" $crystal = 16000000 $hwstack = 128 $swstack = 64 $framesize = 80 Rem disable JTAG (must be done at the first execution of program for ABL128.) Mcucsr.jtd = 1 ' To disable JTAG, two consecutive commands (operations) Mcucsr.jtd = 1 ' (write to the JTAG control bit in MCUCSR register) must be done. Rem type definition of variables Dim I As Integer , J As Integer Dim S As String * 40 Dim X As Single , Y As Single Rem Port initialize ' define LCD Config Graphlcd = 240 * 128 , Dataport = Portc , Controlport = Porta , Ce = 5 , Cd = 6 , Wr = 3 , Rd = 4 , Reset = 7 , Fs = 2 , Mode = 8 ' NOTE: Fs = 2 is dummy definition (un-used). Unless, a BASCOM error occurs. ' BASCOM supports Toshiba T6963C controller by Config Graphlcd command as default. ' After the declaration of the above statement, ' many control commands for GCLD are ready to use on BASCOM. ' Therefore, it is very easy to use the DMF5001 Graphic LCD. ' clear LCD Cls ' print character strings Locate 1 , 1 Lcd "GLCD DMF5001" Locate 2 , 1 Lcd "160 x 128 dots" Locate 5 , 6 X = 3.14 Y = 0.3 * X Y = Sin(y) Lcd "Sin(Y) = " ; Y ' Draw line Line(1 , 1) -(27 , 52) , 1 Rem Other BASCOM commands, for example, Pset, Circle, etc. can be used too. End