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 support@ccsinfo.com

Dummy TX char at bootup

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







Dummy TX char at bootup
PostPosted: Wed Feb 07, 2007 7:01 am     Reply with quote

How can I solve my problem? When PIC starting, after uart init finished - send a dummy (usually 0x08 or 0xFF) char out on TX pin. In my application - time to time I have to software reset the PIC, but the other side stuff doesn't tollerant for fault characters. I have tried a lot of code variant, but cannot filter the dummy chars. ??
Ttelmah
Guest







PostPosted: Wed Feb 07, 2007 7:59 am     Reply with quote

Without seeing your code, and hardware, it is difficult to be 'sure', but the odds are, this is caused by the pin becoming an input temporarily during boot. Depending on how the circuit being driven behaves, if this is seen as a 'low', it'll be detected as a start bit, resulting in a garbage character being received. The solution, in which case, is a hardware one. A pull up resistor of a few k-ohms, on the line.

Best Wishes
adtec
Guest







PostPosted: Wed Feb 07, 2007 8:32 am     Reply with quote

Thank you Ttelmah, but you missunderstood me. Every time when I restart the PIC it's physicaly sends out dummy chars, after the #useRS232 .... setup finished. I can recognise it connecting PC with a terminale programme.
Ttelmah
Guest







PostPosted: Wed Feb 07, 2007 9:34 am     Reply with quote

Are you sure.
I have never seen a dummy character after the hardware wakes up. There are though problems with the wake up. If you are using a MAX232, this has a charge pump, which takes a very significant fraction of a second to start working. Also (as I mentioned), the PIC itself, if connected directly, has the output go high-impedance for a moment, when it wakes up as an input. I'd be suspicious on hyperterminal, that this is the output charge pump on the MAX232, not being awake yet, and you are seeing this come up 'after' the software initialisation.
The PIC itself, specified that the TXREG, wakes, containing 0, after a reset, and TXIF, is set (hardware buffer is empty). This is why, if you are using interrupt driven transmission, the interrupt, must be disabled, till you have characters to send, otherwise you could load a garbage character (sevicing TXIF). Also, if you transmit characters, you need to wait for the MAX232 to get up to operating voltage, or garbage could result.


Best Wishes
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