heres the new cleaned up version of the old code. I haven't hooked it up to the pc but this one seems to work just great (it pulses the pin selected for output). I did that stuff you were talking about with the goto command. thanks for the help.
as for the xtal, yeah, I'm going to have to condede to that. I was hoping to see if I could just get by without one, but I'm going to probably have to give those pins back to the xtal. I was kinda getting away without needing an xtal due to the fact that nothing else was hooked to it whilst I was testing this code.
I've also been looking for a tutorial on setting all pins on the device to digital. it seems the settings I have do that, but I really don't have a clear understanding off the following ansel, anselh and adcon. I looked in the microchip pdf but it was rather confusing.
thanks for the help with the code.
Code:
INCLUDE "modedefs.bas"
define osc 4
@ device PIC16f690, MCLR_OFF
info var byte[5]
trisa = %00000000
trisb = %00000000
trisc = %00000000
ansel = 0
anselh = 0
poll:
pause 100
SERIN portc.5, N2400, 1000, nxt, ["r"], info[0] 'Get input
SERIN portc.5, N2400, info[1] 'get the word "relay"
SERIN portc.5, N2400, info[2]
SERIN portc.5, N2400, info[3]
SERIN portc.5, N2400, info[4]
SEROUT portb.7, N2400, [info[1], info[2], info[3], info[4] ]
pause 500
goto poll
nxt:
serout portb.7, N2400, ["timeout"]
goto poll
Bookmarks