Code:
#CONFIG
CONFIG FOSC = INTIO67
CONFIG PLLCFG = ON
CONFIG PRICLKEN = ON
CONFIG FCMEN = OFF
CONFIG IESO = OFF
CONFIG PWRTEN = ON
CONFIG BOREN = SBORDIS
CONFIG BORV = 190
CONFIG WDTEN = ON
CONFIG WDTPS = 32768
CONFIG CCP2MX = PORTC1
CONFIG PBADEN = OFF
CONFIG CCP3MX = PORTB5
CONFIG T3CMX = PORTC0
CONFIG HFOFST = ON
CONFIG P2BMX = PORTB5
CONFIG MCLRE = EXTMCLR
CONFIG STVREN = ON
CONFIG LVP = OFF
CONFIG XINST = OFF
CONFIG DEBUG = OFF
CONFIG CP0 = OFF
CONFIG CP1 = OFF
CONFIG CP2 = OFF
CONFIG CP3 = OFF
CONFIG CPB = OFF
CONFIG CPD = OFF
CONFIG WRT0 = OFF
CONFIG WRT1 = OFF
CONFIG WRT2 = OFF
CONFIG WRT3 = OFF
CONFIG WRTC = OFF
CONFIG WRTB = OFF
CONFIG WRTD = OFF
CONFIG EBTR0 = OFF
CONFIG EBTR1 = OFF
CONFIG EBTR2 = OFF
CONFIG EBTR3 = OFF
CONFIG EBTRB = OFF
#ENDCONFIG
OSCCON=%01110000 ' SET TO 16 MHZ internal oscillator
OSCTUNE.6=1 ' 4xPLL
DEFINE OSC 64
;set these to match display
ssd1306_addr con $78
#DEFINE colours 1 ;1 mono 2 rg or 3 rgb
width con 128
height con 64
h_offset con 0 ;28 for 40x72
include "grx.pbpMOD"
include "SSD1306.pbpMOD"
include "font.bas"
include "bignum.bas"
include "bigchr.bas"
BUFF VAR BYTE[10]
J VAR BYTE
BGCOLOUR=0
ANSELB=0
ANSELC=0
ANSELA=0
OSCCON=$70
gosub glcd_init
gosub grf_clr
gosub show
SETFONT FONT5x7
main:
'DMDBMP 128,64,logo64 'X,Y,LABEL (HOW DO I SPECIFY SIZE???)
'gosub show
'pause 5000
'gosub grf_clr
'gosub show
ARRAYWRITE BUFF,["STRING OF TEXT",0]
DMDSTR 10,5,buff,1
gosub show
pause 5000
gosub grf_clr
gosub show
SSDBM 31,0,64,64 ,logo64 'This displays the top half of the image ok, and repeats the top half on lower half of screen
'Using this MACRO inside of grx.pbpmod
'SSDBM?CCCCL macro Xin ,Yin ,Win,Hin,BMin
' IFNDEF TBLPTRL
' ERROR BITMAPS ONLY SUPPORTED ON PIC18
' ENDIF
' MOVE?CB Xin , _gx
' MOVE?CB Yin , _gy
' MOVE?CB Hin/8+Yin-1 , _gy_
' MOVE?CB Win+Xin-1 , _gx_
' MOVE?CW Win*Hin/8 , _glcd_rad
' banksel _glcdbm
' movlw low BMin
' movwf _glcdbm
' movlw high BMin
' movwf _glcdbm +1
' BANKSEL 0
' L?CALL _ssd_bitmap
' endm
pause 1000 'WE GET STUCK HERE!!!
gosub grf_clr
gosub show
pause 1000
goto main
end
logo64: '64x64 image
@ db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
@ db 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 112, 60, 28, 6, 7, 3
@ db 3, 7, 6, 14, 28, 112, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0
@ db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
@ db 0, 0, 0, 0, 0, 0, 0, 0, 248, 254, 7, 7, 3, 3, 3, 3
@ db 3, 6, 2, 6, 4, 12, 136, 184, 23, 33, 64, 64, 0, 128, 0, 0
@ db 0, 0, 0, 128, 64, 32, 33, 23, 120, 136, 12, 4, 4, 6, 2, 3
@ db 3, 3, 3, 3, 7, 6, 254, 252, 0, 0, 0, 0, 0, 0, 0, 0
@ db 0, 0, 0, 0, 0, 0, 0, 0, 2, 7, 60, 224, 128, 128, 128, 128
@ db 0, 64, 0, 64, 0, 64, 110, 0, 32, 0, 64, 32, 32, 8, 33, 2
@ db 6, 9, 32, 16, 0, 32, 128, 32, 0, 21, 96, 0, 64, 64, 0, 64
@ db 128, 128, 128, 128, 224, 28, 15, 1, 0, 0, 0, 0, 0, 0, 0, 0
@ db 192, 224, 120, 24, 28, 4, 6, 2, 3, 0, 1, 0, 1, 6, 8, 16
@ db 32, 0, 192, 0, 32, 154, 4, 0, 1, 128, 224, 248, 248, 252, 252, 254
@ db 252, 252, 252, 252, 248, 224, 64, 1, 2, 0, 73, 16, 64, 128, 0, 64
@ db 32, 8, 6, 1, 1, 1, 1, 3, 2, 6, 12, 12, 56, 112, 240, 192
@ db 3, 15, 30, 24, 60, 96, 96, 64, 192, 128, 128, 128, 128, 64, 60, 12
@ db 2, 1, 0, 2, 0, 0x2C, 144, 0, 0, 0, 15, 31, 31, 63, 127, 63
@ db 127, 63, 63, 31, 31, 15, 1, 128, 0, 32, 0x94, 8, 2, 0, 1, 2
@ db 8, 16, 96, 128, 0, 128, 128, 64, 64, 96, 96, 60, 24, 14, 15, 3
@ db 0, 0, 0, 0, 0, 0, 0, 0, 128, 240, 56, 7, 1, 1, 1, 0
@ db 3, 0, 2, 2, 4, 2, 234, 4, 0, 1, 4, 4, 0, 12, 144, 64
@ db 64, 36, 152, 0, 4, 2, 0, 4, 0, 178, 6, 0, 2, 2, 2, 2
@ db 0, 1, 1, 1, 7, 28, 240, 128, 0, 0, 0, 0, 0, 0, 0, 0
@ db 0, 0, 0, 0, 0, 0, 0, 0, 31, 127, 240, 192, 192, 192, 192, 192
@ db 192, 192, 32, 96, 32, 16, 16, 31, 248, 132, 4, 2, 1, 0, 0, 0
@ db 0, 0, 0, 1, 2, 4, 132, 120, 31, 16, 60, 32, 32, 96, 64, 192
@ db 192, 192, 192, 192, 224, 112, 127, 63, 0, 0, 0, 0, 0, 0, 0, 0
@ db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
@ db 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 14, 60, 60, 112, 224, 192
@ db 192, 224, 112, 112, 24, 30, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0
@ db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Bookmarks