Using the below code and two PIC 16F684s I don't get the results I am looking for.
The DEBUGIN doesn't appear to be working. What have I missed?
Code:
'----MASTER CODE-------
DEFINE DEBUG_REG PORTC
DEFINE DEBUG_BIT 2
DEFINE DEBUG_BAUD 2400
DEFINE DEBUG_MODE 0
bvar var byte
Pause 2000
bvar = 1
Loop:
DEBUG bvar
Goto Loop:
'----SLAVE CODE-------
DEFINE LOADER_USED 1
DEFINE DEBUGIN_REG PORTC
DEFINE DEBUGIN_BIT 2
DEFINE DEBUG_BAUD 2400
DEFINE DEBUGIN_MODE 0
bvar var byte
TRISA = %001000
PORTA = %000001
Pause 2000
Loop:
DEBUGIN 4000, timesup, [bvar]
IF (bvar = 1) then
PORTA = %000010
Pause 4000
ENDIF
Pause 2000
PORTA = %000100
Pause 2000
PORTA = %100000
Pause 2000
Goto Loop:
timesup:
PORTA = %010000
Pause 2000
PORTA = %000001
Return
Bookmarks