|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
after reset, terminal window prints garbage
Here's a question: What does DOWNLOADING do that RESET does not do?
Here's the story: After I download new code, the code starts running and printf-ing to the terminal window -- everything is fine. If I press RESET on the RC, the terminal window continues to show output, but it's unreadable -- instead of letters and numbers there are weird symbols and other characters. The rhythm of the output is unchanged (I only printf() stuff every 20th cycle, so it's about twice a second). But it's unreadable junk -- garbage. Downloading again (the same code or different) clears up the problem until the next RESET. But that's not a solution, it's just a clue. What does DOWNLOADING do that RESET does not do? What's going on? I've searched the archives and found someone with the same problem, but there was no answer. |
|
#2
|
||||||
|
||||||
|
Re: after reset, terminal window prints garbage
Which serial port code are you using?
|
|
#3
|
|||||
|
|||||
|
Re: after reset, terminal window prints garbage
I'm using <stdio.h> and not "printf_lib.h". Is that what you meant?
My InterruptHandlerLow() is the usual: Code:
void InterruptHandlerLow ()
{
if (PIR1bits.RC1IF && PIE1bits.RC1IE) // rx1 interrupt?
{
#ifdef ENABLE_SERIAL_PORT_ONE_RX
Rx_1_Int_Handler(); // call the rx1 interrupt handler (in serial_ports.c)
#endif
}
else if (PIR3bits.RC2IF && PIE3bits.RC2IE) // rx2 interrupt?
{
#ifdef ENABLE_SERIAL_PORT_TWO_RX
Rx_2_Int_Handler(); // call the rx2 interrupt handler (in serial_ports.c)
#endif
}
else if (PIR1bits.TX1IF && PIE1bits.TX1IE) // tx1 interrupt?
{
#ifdef ENABLE_SERIAL_PORT_ONE_TX
Tx_1_Int_Handler(); // call the tx1 interrupt handler (in serial_ports.c)
#endif
}
else if (PIR3bits.TX2IF && PIE3bits.TX2IE) // tx2 interrupt?
{
#ifdef ENABLE_SERIAL_PORT_TWO_TX
Tx_2_Int_Handler(); // call the tx2 interrupt handler (in serial_ports.c)
#endif
}
}
And why should the startup conditions after download be different than after a reset? |
|
#4
|
||||
|
||||
|
Re: after reset, terminal window prints garbage
when downloading code, the baud rate is set by the download control. at the end of the load, the serial port is left at the download rate.
after reset, you must properly set the baud rate in your code. it sounds like the serial port init is not running in your code. jerry w |
|
#5
|
|||||
|
|||||
|
Re: after reset, terminal window prints garbage
That sounds very likely. I will check it at my next work session (Thursday).
Thanks! |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Com Terminal 1 Window Problem. | groovy69 | Programming | 4 | 25-01-2007 22:58 |
| Terminal Window | teh_pwnerer795 | Programming | 1 | 02-01-2007 00:21 |
| Terminal Window | Idaman323 | Programming | 0 | 20-02-2006 19:28 |
| Code Error after reset | iplayfast | Programming | 2 | 20-02-2006 12:35 |
| Is Terminal Window Evil? | Fat Alex | Programming | 1 | 20-07-2004 10:57 |