There must be some awful mistakes, I can't get this code working
Code:
#CONFIG
CONFIG OSC = IRCIO67 ;Internal oscillator block, port function on RA6 and RA7
CONFIG WDT = ON ;WDT enabled
CONFIG WDTPS = 64 ;1:64
CONFIG PWRT = ON ;PWRT enabled
CONFIG BOREN = BOHW ;Brown-out Reset enabled in hardware only (SBOREN is disabled)
CONFIG BORV = 3 ;VBOR set to 2.1V
CONFIG MCLRE = OFF ;RE3 input pin enabled; MCLR disabled
CONFIG LPT1OSC = OFF ;Timer1 configured for higher power operation
CONFIG PBADEN = OFF ;PORTB<4:0> pins are configured as digital I/O on Reset
CONFIG XINST = OFF ;Instruction set extension and Indexed Addressing mode disabled (Legacy mode)
CONFIG LVP = OFF ;Single-Supply ICSP disabled
CONFIG STVREN = ON
CONFIG CP0 = ON
CONFIG CP1 = ON
CONFIG CP2 = ON
CONFIG CP3 = ON
#ENDCONFIG
Define USE_LFSR 1
DEFINE OSC 8
DEFINE DEBUG_REG PORTB
DEFINE DEBUG_BIT 4
DEFINE DEBUG_BAUD 9600
DEFINE DEBUG_MODE 0
OSCCON =%01110000
Led VAR PORTB.3
inbuff VAR BYTE[100]
x VAR BYTE
y VAR BYTE
LS0 VAR Word
LS1 VAR Word
goto Start
ASM
LoadString macro Text, Dest
movlw low Text
movwf _LS0
movlw High Text
movwf _LS0 + 1
movlw low Dest
movwf _LS1
movlw High Dest
movwf _LS1 + 1
L?CALL _Lstr
endm
ENDASM
Lstr:
y=0
repeat
peekcode LS0, x
LS1(y)=x
y=y+1
LS0=LS0+2
until x=0
return
Start:
@ LoadString _ROM_CfgString, inbuff
debug str inbuff\100,13,10
pause 500
high led
pause 500
low led
goto start
end
ROM_CfgString: PokeCode "This a test string",0
Bookmarks