Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20613

Share your working BASCOM-AVR code here : Graphic LCD Screen Dump : REPLY

$
0
0
Hi Paul, Thanks for the nice comments Paul, Michael's the one doing all the hard stuff. And damn, I didn't even think of the heads up display, but now that you mention it, have to think about it. We should have a forum somewhere that we can do this type of thing, collaboration on projects, because I don't really think that this particular one is the correct spot. Here is the latest code to reproduce the GLCD screen on Michael's "Screen Copy program. From there it can be saved as a BMP. Regards Dean [code:1:f07e04388d] $regfile = "m32def.dat" $crystal = 16000000 $hwstack = 20 $swstack = 60 $framesize = 20 $timeout = 10000 Declare Sub Glcd_save() Declare Sub Serial0charmatch() Baud = 38400 $lib "glcdKS108-GDM.LBX" '' ===[ Setup LCD Display ]====================================================== Config Graphlcd = 128 * 64sed , Dataport = Portc , Controlport = Portb , Ce1 = 0 , Ce2 = 1 , Cd = 2 , Rd = 3 , Reset = 4 , Enable = 5 , Mode = 6 Config Portc = Output Config Portb = Output 'For the incomming serial. Enable Interrupts Setfont Font8x8 Dim Addr As Byte Dim Rdstatus As Byte Dim Dat As Byte Dim P As Byte Dim X As Word Dim B As Byte Dim Incoming_data As String * 20 Incoming_data = "" Config Serialin0 = Buffered , Size = 21 , Bytematch = 13 'Note these definitions MUST be that same as the Congig Graphlcd command above 'Define the chip selects ports. Statce1 Alias Portb.0 Statce2 Alias Portb.1 'Define the Data/Instruction port Statdi Alias Portb.2 'Define the Read port Statread Alias Portb.3 'Define the reset port Statrst Alias Portb.4 'Define the Enable port Staten Alias Portb.5 'Enable normally low Reset Staten Cls 'Print a test Screen Print ""; Lcdat 1 , 0 , "PSU Ready 1 2 3-" Lcdat 2 , 0 , "4 5 6 7 8 9 10--" Lcdat 3 , 0 , "3 Third Line -" Lcdat 4 , 0 , "4 -" Lcdat 5 , 0 , "5 Full Screen -" Lcdat 6 , 0 , "6 -" Lcdat 7 , 0 , "7 -" Lcdat 8 , 0 , "Last line to tsT" 'Loop here waiting for the "CMD1" from the incomming serial. Do If Incoming_data <> "" Then If Instr(incoming_data , "CMD1") > 0 Then 'Six1's RND test program ' Print "SCRCPY" ; Chr(128) ; Chr(8); ' For X = 1 To 1024 ' B = Rnd(255) ' Print Chr(b); ' Next ' Print "/SCRCPY"; Call Glcd_save End If Incoming_data = "" End If Loop 'The save GLCD data to serial routine. Sub Glcd_save() ''======================================= ' Read Routine from here down ''======================================= Set Statce1 Set Statce2 'Address Glcdcmd &B01000000 'Dummy Read $asm rcall _Gread_data $end Asm 'Header as required by Michael (Six1) Print "SCRCPY" ; Chr(128) ; Chr(8); 'Header as required by Six1 128 pixels wide, 8xlines (of 8 bits each) For P = 0 To 7 'Set Cs Reset Statce1 Set Statce2 'Set the page (line number) Dat = &B10111000 + P Glcdcmd Dat 'Address Glcdcmd &B01000000 'Required Dummy Read $asm rcall _Gread_data $end Asm 'Get the data from the current line (left half of the screen) For Addr = 0 To 63 Loadadr Dat , X $asm rcall _Gread_data Mov r24,r1 st x,r24 $end Asm Print Chr(dat); 'Print Decimal Numbers Next Addr 'Change CS's around Set Statce1 Reset Statce2 'Reset the Address to zero Glcdcmd &B01000000 'Required Dummy Read $asm rcall _Gread_data $end Asm 'Get the data from the current line (right half of the screen) For Addr = 0 To 63 Loadadr Dat , X $asm rcall _Gread_data Mov r24,r1 st x,r24 $end Asm Print Chr(dat); 'Print Decimal Numbers Next Addr Next P 'End of data footer Print "/SCRCPY"; 'End of data End Sub 'Incomming serial data grab Sub Serial0charmatch() Input Incoming_data Noecho Toggle Led End Sub End $include "font8x8.font" [/code:1:f07e04388d]

Viewing all articles
Browse latest Browse all 20613

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>