Okay. Below is my new code (I've added an LED to port b.6). Here's what happens. A capital 'A' shows on the terminal window, the LED goes on, the LED then goes out, another 'A' shows on the terminal, the LED goes on and there is where it stays. I never touched the keyboard during this time. After this process, it doesn't matter what I type in the terminal window, the light stays on and nothing else happens. Any thoughts?
Include "modedefs.bas"
DEFINE OSC 3
define HSER_RCSTA 90h
define HSER_TXSTA 24h
DEFINE HSER_SPBRG 92
DEFINE HSER_CLROERR 1
OSCCON= $08
'this is the layout for portb.5 - RB5/AN11/RX/DT
'turn off analog input for port b.5
ANSELH=0
'and any other analog stuff
ANSEL=0
'there's several analog comparators - lets shut them off
'I dont know which one - shut them all off
CM1CON0 =0
CM2CON0 =0
CM2CON1 =0
adcon1=0
'now set it for input
trisb.5 = 1
trisc.0 =1
rxPin VAR portB.5
txPin VAR portB.7
rxVal Var Byte
txVal Var Byte
loop:
pause 1000
'serout txPin,T2400,["A"]
hserout ["A"]
Pause 1000
High Portb.6
Pause 1000
'Low portb.6
hserin [rxVal]
'serin rxPin,T2400,rxVal
'pause 500
'serout txPin,T2400,[rxVal]
hserout [rxVal]
Low portb.6
pause 1000
goto loop
end
Bookmarks