I am using Oshonsoft PIC Simulator IDE v5.33 to Monitor the Hardware UART for the Following Code. I only get an Output When I Execute the HSEROUT and I haven't a clue why this is, any Ideas Please
you can even write..
TXSTA=$20
RCSTA=$90
SPBRG=15
this will do the same thing as
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_SPBRG 15 ' 9600 Bauds
If you don't use HSERIN/HSEROUT you MUST write to the register directly as i already wrote in the example i post to you yesterday.
Be sure of your SPBRG value... it's important and it's different for every crystal speed and baudrate. look the datasheet for that AND/OR use the calc i did in attachement.
REPEAT
UNTIL PIR1.4 = 1
TXREG = "A"
??????
Did you really look the example i posted before?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Its working, the confusion was caused by the DEFINE. Its seems with my compilier PICBasic PRO the TXSTA=$20 type expession works well but the DEFINE HSER_TXSTA 20h type expression Fails to Run but Compiles without Error. Looking back I can see that I had actually got it right but I chose to use DEFINE HSER_TXSTA 20h which I later change to DEFINE UART_TXSTA 20h in desperation/frustraction after seeing a reference of this type on the Web. Again thanks for getting me back on the rails. I am off to bed now and I will get the USART Interrupt working correctly in the morning.
Bookmarks