I wish I hadn't gone with the K series. Too many problems with clock settings that I fail to comprehend.
Code: Select all
DEVICE = 18F24k20
CLOCK = 8
// import LCD library...
INCLUDE "convert.bas"
'INCLUDE "InternalOscillator.bas"
INCLUDE "SetDigitalIO.bas" // Include this file when we compile so that we can use keywords like 'setalldigital'
'INCLUDE "utils.bas"
CONST A_data(18)AS WORD = (%00000000, // A
%00000000,
%00000000,
%00111110,
%01001000,
%01001000,
%00111110,
%00000000,
%00000000,
%00000000,
//B
%00000000,
%00000000,
%01111110,
%01001010,
%01001010,
%00110110,
%00000000,
%00000000)
CONST Cathodes_Data(8) AS BYTE = (%11111110, %11111101, %11111011, %11110111, %11101111, %11011111, %10111111, %01111111)
'CONST Data_array(2) AS BYTE = (%11111111, %00000000)
DIM x AS BYTE
DIM y AS BYTE
SetAllDigital // Make all Pins digital I/O's
TRISC = %00000000 // Make PORTD all outputs
TRISB = %00000000
osccon = %01100110
ANSEL = $00
ANSELH = $00
CM1CON0 = 0
CM2CON0 = 0