Can't you calc the parity yourself based on if you want it? I realize this is not as clean as lettine PBP do it, but it will solve you problem and still allow HSERIN/OUT. I think.
Can't you calc the parity yourself based on if you want it? I realize this is not as clean as lettine PBP do it, but it will solve you problem and still allow HSERIN/OUT. I think.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
I tried to sidestep this issue by using HSERIN set up for 9 bits with even parity for my reception routine and debug at 9600,8,N,1 for my serial lcd driver routine.
But debug output stops working as soon as the hserin defines are enabled. The debug output is on the Asuart TX side as i was hoping to use HSEROUT so perhaps there is a conflict there?
Any more ideas?
What about this:
Do the defines and set it up for pairity. This will make PBP do the math for it.
Then set the registers to 8 bit before HSEROUT and set them back when done.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Now THAT is a good idea! I'll have to play with that in particular application and see how it works.
Thanks!
/Henrik.
Agreed that is a good idea. can you post your code example when tested.
I'll do the same If i get round to it first
OK so assuming i set up HSERIN/OUT for 9 bit even parity
I do my 9 bit recieve then just before I want to do my 8bit transmit i clear the TXSTA TX9 flag
Just a thought though if we clear the TXSTA TX9 flag just before we do the HSEROUt won't it just overwrite it immediately?
Is the TXSTA only loaded once during program execution when the define is executed? I appreciate the parity bit is changed to suit.
Or am I confused.
Last edited by retepsnikrep; - 17th March 2011 at 23:37.
Hmmm, good point. I was/am assuming PBP sets and forgets it. setting it on each transmission seems like wasted code.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
I'm going to try
See if that works as clearing the 9 bit mode bit for the txd should hopefullyCode:DEFINE HSER_BAUD 9600 'Set Baud rate to 9600bps DEFINE HSER_BITS 9 'Set to 9 bit mode DEFINE HSER_EVEN 1 'Set Even Parity DEFINE HSER_CLROERR 1 'Clear overflow error automatically TXSTA.6 = 0 'Clear 9 Bit Txd Mode
leave the rxd unaffected and in 9 bit mode.
Perhaps we can ask the pbpro author to support seperate defines for rxd and txd ausart.
Bookmarks