it must work AS IS but maybe your PIC programmer software is not set correctly.
Check for a PROGRAM EEPROM location or something like that.
Code:
'
' PIC Configuration
' =================
DEFINE LOADER_USED 1
DEFINE OSC 20
'
' Hardware configuration
' ======================
TRISC = %10111111
'
' Serial Communication definition
' ===============================
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_SPBRG 129 ' 9600 Bauds
'
' Variables definition
' ===================
ByteA var byte
ByteB var byte
ByteC var byte
WordA var word
WordB var Word
'
' Internal EEPROM assignement
' ===========================
DATA @10,10,20,30
DATA @60,$AB,$01,$CD,$02 ' Must split WORD sized in 2 BYtes
' '
' ''' addr = 62
'
''''''''''' addr = 60
'
' ////////////////////////////////|\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'
' Program Start Here
'
' ////////////////////////////////|\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'
START:
read 10,bytea
read 11,byteb
read 12,bytec
read 60,worda.highbyte
read 61,worda.lowbyte
read 62,wordb.highbyte
read 63,wordb.lowbyte
hserout ["ByteA:",dec bytea,13,10,_
"ByteB:",dec byteb,13,10,_
"ByteC:",dec bytec,13,10,_
"WordA:",hex Worda,13,10,_
"WordB:",hex WordB,13,10,_
rep "*"\50,13,10]
pause 1000
goto start
Bookmarks