Software UART for PIC18F

Status
Not open for further replies.

alanh

New Member
Hello all,

My first post, please be gentle

I'm trying to adapt Mike's PIC 16F819 full duplex software uart code to an 18F, but it's not working yet, but it's crashing in the IRQ handler. Wonder if someone can take at this code snipped.

The baud rate I need is 7812.5 and it's XTAL is at 8MHz.

I've changed some instructions like FSR, to FSR0L and FSR0H and saving those including PCLATH and PCLATU etc. I've not updated the timing information per instruction yet, but I calculated the value of 85 for PR2 for 7812.5 baud.

Also, I think I've fixed up the jump table correctly by doing RLNCF WREG, W before loading PCL.


Does this look right ?

Thanks.
 
Hi,


For ISR context saving use the Template example file found in your MpASM\Template\Code folder.

Typically you need to save W,Status and BSR plus any other key resisters you ISR code is likely to affect.

You do not say which chip you are using and seeing your code in full will probably be better that just the isr snippet.
Also you do not give a link to Mikes (?) project code ..?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…