|
|
View previous topic :: View next topic |
Author |
Message |
adtec Guest
|
Dummy TX char at bootup |
Posted: Wed Feb 07, 2007 7:01 am |
|
|
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
|
|
Posted: Wed Feb 07, 2007 7:59 am |
|
|
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
|
|
Posted: Wed Feb 07, 2007 8:32 am |
|
|
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
|
|
Posted: Wed Feb 07, 2007 9:34 am |
|
|
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 |
|
|
|
|
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
|