use HSERIN [CHAR] and HSEROUT[CHAR] may solve few things. And you should DEFINE RCSTA as well... even if by default it's 2400 baud. Not sure how DEFINE LOADER_USED affect the whole thing.
try...
Code:
DEFINE OSC 4
DEFINE LOADER_USED 1
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
DEFINE HSER_SPBRG 25 ' 2400 Baud @ 4MHz, 0.17%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
Char VAR BYTE
LEDB var PORTD.1
LEDG var PORTD.2
LEDR VAR PORTD.4
main:
GOSUB standby
LOW LEDB
HSEROUT [Char]
HIGH LEDG
PAUSE 5000
LOW LEDG
GOTO main
Standby:
High ledb
HSERIN [Char]
RETURN
Error:
END
What do you really want to do with the above? Learn something, or doing something useful?
Last edited by mister_e; - 1st October 2007 at 21:04.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks