here is what i have:
#chip 16F916, 4 'mhz
#config OSC=INTOSC, MCLRE=off, WDT=off
#mem 256 'Chip has 256 bytes
On Interrupt ExtInt0 call serial_in
IntOn
lcdcon = 0
dim temp as byte
dim temp2 as byte
#define RecAHigh portb.0 off
#define RecAlow portb.0 on
Initser 1,r1200,1+waitforstart, 8, 1, none, invert
dir portc.1 out
dir portb.0 in 'serial
main:
epread 1, aa
if aa = 1 then set portc.1 on
if aa = 0 then set portc.1 off
goto main
Sub serial_in
SerReceive 1, temp
SerReceive 1, temp2
temp = temp - 96 'a=1 b=2, etc
temp2 = temp2 - 48 ' sets number to actual not ascii value
EPWrite temp, temp2
End Sub
it works sometimes, but the values it recieves are not consistant, I write to location temp but the location is not always consistant even though i send the same value to it, and i find i can send it several 1's or 0's and get it to activate also I'm not sure why
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
here is what i have:
#chip 16F916, 4 'mhz
#config OSC=INTOSC, MCLRE=off, WDT=off
#mem 256 'Chip has 256 bytes
On Interrupt ExtInt0 call serial_in
IntOn
lcdcon = 0
dim temp as byte
dim temp2 as byte
#define RecAHigh portb.0 off
#define RecAlow portb.0 on
Initser 1,r1200,1+waitforstart, 8, 1, none, invert
dir portc.1 out
dir portb.0 in 'serial
main:
epread 1, aa
if aa = 1 then set portc.1 on
if aa = 0 then set portc.1 off
goto main
Sub serial_in
SerReceive 1, temp
SerReceive 1, temp2
temp = temp - 96 'a=1 b=2, etc
temp2 = temp2 - 48 ' sets number to actual not ascii value
EPWrite temp, temp2
End Sub
it works sometimes, but the values it recieves are not consistant, I write to location temp but the location is not always consistant even though i send the same value to it, and i find i can send it several 1's or 0's and get it to activate also I'm not sure why