'-------------------------------------------------------------------------------- 'name : M1284_OLED_tst1.bas 'purpose : OLED check 'micro controller : Mega1284 '-------------------------------------------------------------------------------- '-------------------------------------------------------------------------------- Rem Used ports ' ' PB5-7 : used for SPI programming ' OLED I/F ' ' PA7-0 : Data or Command - ' PC3 : E ' PC2 : RS '-------------------------------------------------------------------------------- $regfile = "m1284pdef.dat" $crystal = 8000000 ' 8MHz Internal clock $hwstack = 64 $swstack = 64 $framesize = 40 Rem Organic LED Display pin number definition Config Portc.3 = Output Config Portc.2 = Output Config Porta = Output Ee Alias Portc.3 Rss Alias Portc.2 Oldat Alias Porta Rem program start Rem OLED initialize Waitms 100 Oldat = &H0F Gosub Ocom Config Lcd = 16 * 2 Config Lcdpin = Pin , Port = Porta , E = Portc.3 , Rs = Portc.2 Cls ' Clear OLED Screen Cursor Off Lcd "M1284 OLED test1" ' Character print to LCD Gosub Nextline Lcd "Starting" End Rem subroutines ' OLED command set Ocom: Reset Rss Set Ee Reset Ee Return ' to next line Nextline: Oldat = &HA0 ' to next line Gosub Ocom Return