I have:
#chip 16F688, 12 'mhz
#config MCLRE=off, WDT=off
#define USART_BAUD_RATE 9600
'#define USART_BLOCKING
CREN = 1
SYNC = 0
SPEN = 1
RCIE = 1
InitUsart
On Interrupt RCIF call serial_in
lcdcon = 0
dim loc as byte
loc= 1
'Set the pin directions
'dir porta.0 in '
'dir porta.1 out '
'dir porta.2 out '
'dir porta.3 in '
'dir porta.5 out '
'dir porta.4 out '
dir portc.5 in ' serial 5
'dir portc.4 in '
'dir portc.3 out '
'dir portc.2 in '
'dir portc.0 out '
dir portc.1 out 'up led
'Main routine
Start:
wait 50 ms
set portc.1 off
goto start
sub serial_in
INDATA = rcreg
epwrite loc, indata
loc= loc + 1
if loc = 8 then loc = 1
set portc.1 on
End sub
but when i read the rom there is no data there, i want to store 8 bits for later reading
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have:
#chip 16F688, 12 'mhz
#config MCLRE=off, WDT=off
#define USART_BAUD_RATE 9600
'#define USART_BLOCKING
CREN = 1
SYNC = 0
SPEN = 1
RCIE = 1
InitUsart
On Interrupt RCIF call serial_in
lcdcon = 0
dim loc as byte
loc= 1
'Set the pin directions
'dir porta.0 in '
'dir porta.1 out '
'dir porta.2 out '
'dir porta.3 in '
'dir porta.5 out '
'dir porta.4 out '
dir portc.5 in ' serial 5
'dir portc.4 in '
'dir portc.3 out '
'dir portc.2 in '
'dir portc.0 out '
dir portc.1 out 'up led
'Main routine
Start:
wait 50 ms
set portc.1 off
goto start
sub serial_in
INDATA = rcreg
epwrite loc, indata
loc= loc + 1
if loc = 8 then loc = 1
set portc.1 on
End sub
but when i read the rom there is no data there, i want to store 8 bits for later reading
i think if you take "´" synblol on #define USART_BLOCKING, the RCIF start working