Trying to get my code to run on a PIC18LF2680. When I step thru the code I notice it skips over all of the "VAR" statements.
However, when I continue, it acts like it is performing the required instruction. But when I try to run stand-alone, it doesn't work. I can see with an O'Scope that the clock is working but no I/O activity.
Here's the config code;
#CONFIG
__CONFIG _CONFIG1H, _OSC_HS_1H
__CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
;Set osc, Low-Voltage Programming disabled,
;Extended Instructionset disabled,
#ENDCONFIG
Define OSC 4 ' 17
' 18
TRISA = $00 'set port a to all outputs ' 19
TRISB = $00 'set port b to all outputs ' 20
TRISC = $FF 'set port c to all inputs ' 21
LATB = $00 'clear port b latches ' 22
PLLDATA Var Byte ' stores value for PLLDATA ' 28
LASTCH Var Byte ' stores value for LASTCH ' 29
PLLDATAOUT var byte 'stores ouput for portB ' 30
CHSEL Var Byte 'channel selector storage ' 31
Display Var BYTE 'Display storage ' 32
Char1 VAR BYTE 'Digit 1 transistor switch ' 33
Char2 VAR BYTE 'Digit 2 transistor switch ' 34
Char3 VAR BYTE 'Digit 3 transistor switch ' 35
LASTCHSEL Var Byte 'stores the previous position of the ch selector ' 36
SEGSW Var BYTE ' 37
LOGOCNT Var BYTE ' 38
Digit3 Var PORTA.0 ' 41
Digit2 Var PORTA.1 ' 42
Digit1 Var PORTA.2 ' 43
BNDDNSW Var PORTA.3 ' 50
BNDUPSW Var PORTA.4 ' 51
LTCHENBL Var PORTA.5 'Latch Enable ' 46
'LTCHENBL = 0
CHSEL = PORTC & $0f 'set the inputs for the channel selector register ' 57
READ 5, LASTCH 'Read the last channel data from the EEProm 58
IF LASTCH = $FF THEN LASTCH = $70 'power up ch = CH 16 (Call channel) ' 59
IF LASTCH = $00 THEN LASTCH = $72 'power up ch = Ch 18 (Coast Guard) ' 60
PLLDATAOUT = PLLDATA 'put PLLDATA on the output pins ' 121
PORTB = PLLDATAOUT
LTCHENBL = 1
LTCHENBL = 0
PORTB = Display
LOGOCNT = $a0 'set the countdown timer for logo display ' 65
Start:
Is there something else I need to do in the configuration statement?
Thanks
Bookmarks