Hi there
I have a strange problem in trying a pic16F688 to communicate over the usart.
When I use the HSEROUT command the pic sort of freezes, my led stops blinking. When using the SEROUT command all is fine. It must be something simple, I just don't see it. Anyone ?
thanks. I'm using PBP2.45. Here's my code:
[code]
@ device pic16F688, pwrt_on, mclr_off, protect_off, wdt_on, intrc_osc
'INCLUDE "modedefs.bas" ' for serial output macro
define osc 4
' Set receive register to receiver enabled
DEFINE HSER_RCSTA 90h
' Set transmit register to transmitter enabled
DEFINE HSER_TXSTA 20h
' Set baud rate
DEFINE HSER_BAUD 1200
DEFINE HSER_CLROERR 1
ANSEL = %00000000 ' no analog inputs
CMCON0 = %00000111 ' comparators off
TRISA = %00000000
PORTA = %00000000
TRISC = %00100000
PORTC = %00000000
led VAR PORTA.5
loop:
' SerOut PORTC.4,T1200,["this works",10,13]
HSEROUT ["this not",10,13]
pause 200
toggle led
GoTo loop
Bookmarks