CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

18f45j10 usart RX corruption

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
prondeau



Joined: 26 Mar 2008
Posts: 11

View user's profile Send private message

18f45j10 usart RX corruption
PostPosted: Wed Mar 26, 2008 8:54 am     Reply with quote

Hello,

I've been using an 18f45j10 for a project. I noticed that occasionally some of the characters I send to it are corrupt when received. I checked my connections and everything looked good so I checked the chip errata. There is a note in the errata:

Quote:
In asynchronous duplex communication, the
reception can get corrupted if any bit of the TXSTA
register is modified during a reception.
Work around
The CSRC (TXSTA<7>) bit should not be set.
Though this is a “don’t care” bit in Asynchronous
mode, make sure that this bit is not set.


I checked the disassembly listing and found that TXSTA (0xFAC) bit 7 is set:


Code:
  2C6E    0EA6     MOVLW 0xa6
  2C70    6EAC     MOVWF 0xfac, ACCESS


In lieu of a fix, what is the cleanest way to override what appears to be the default PCH behavior (just downloaded 4.069 and found the same result) so that I can continue my testing?

Thanks!

Pete Rondeau
Ttelmah
Guest







PostPosted: Wed Mar 26, 2008 9:22 am     Reply with quote

Just clear the bit.

#bit CSRC=0xFAC.7

Before using the UART (after the initialisation), add:

CSRC=0;

Best Wishes
prondeau



Joined: 26 Mar 2008
Posts: 11

View user's profile Send private message

PostPosted: Wed Mar 26, 2008 9:54 am     Reply with quote

I was concerned that if I cleared the bit manually, when the code compiled that I wouldn't be able to guarantee that the clear bit code would end up after the initialization code.

I should probably have not over-thought it so much and just tried it.
Very Happy
Thanks for the suggestion- now to see if it clears up the corruption problem.

Pete
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group