The program are simply. To receive serially @ 115.2kbps data, and sometimes send serially (not hardware) data out.
initialization of hserin works well!
INCLUDE "bs2defs.bas"
DEFINE OSC 20
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_CLOERR 1
DEFINE HSER_BAUD 115200
start:
hserin 100, start, [c, a, b]
rcsta.4 = 0 : rcsta.4 = 1
if c = "d" and a = "+" then sound portb.4, [119,7]
if c = "e" and a = ":" then hpwm 1, b, 400
if c = "s" then serout portc.4, t9600, [255, 8, 100]
goto start
------------------------------------------
everything work good and fine until c="s" and pic needs to transmit three bytes out of portc.4.
PIC just hangs up until reset
is something special about portC.4? am i missed something important?
18LF4680 hardware TR RX are C6 and C7
Bookmarks