Go to Post You are certainly welcome to demonstrate your geekiness on a regular basis! :) - Cynette [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 16-01-2008, 08:44
gnormhurst's Avatar
gnormhurst gnormhurst is offline
Norm Hurst
AKA: gnorm
#0381 (The Tornadoes)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Trenton, NJ
Posts: 138
gnormhurst will become famous soon enoughgnormhurst will become famous soon enough
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.
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the USPTO.
My favorite error message from gcc: main is usually a function
My favorite error message from Windows: There is not enough disk space available to delete this file.
  #2   Spotlight this post!  
Unread 16-01-2008, 08:59
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,567
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: after reset, terminal window prints garbage

Which serial port code are you using?
  #3   Spotlight this post!  
Unread 16-01-2008, 11:10
gnormhurst's Avatar
gnormhurst gnormhurst is offline
Norm Hurst
AKA: gnorm
#0381 (The Tornadoes)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Trenton, NJ
Posts: 138
gnormhurst will become famous soon enoughgnormhurst will become famous soon enough
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
	}
}
I'm not sure exactly how the various ENABLE_SERIAL_PORT_xxx_xx macros are set (I don't have a copy of the code with me) -- I'll have to check. But even if all four were enabled, that should not do bad things, should it?

And why should the startup conditions after download be different than after a reset?
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the USPTO.
My favorite error message from gcc: main is usually a function
My favorite error message from Windows: There is not enough disk space available to delete this file.
  #4   Spotlight this post!  
Unread 16-01-2008, 12:33
jerry w's Avatar
jerry w jerry w is offline
Free Agent Mentor
no team (Team Krunch)
Team Role: Engineer
 
Join Date: Nov 2003
Rookie Year: 2002
Location: dunedin fl
Posts: 113
jerry w has much to be proud ofjerry w has much to be proud ofjerry w has much to be proud ofjerry w has much to be proud ofjerry w has much to be proud ofjerry w has much to be proud ofjerry w has much to be proud ofjerry w has much to be proud ofjerry w has much to be proud of
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
__________________
Happiest when people tell the truth... However, I am blessed with many friends.
  #5   Spotlight this post!  
Unread 16-01-2008, 13:09
gnormhurst's Avatar
gnormhurst gnormhurst is offline
Norm Hurst
AKA: gnorm
#0381 (The Tornadoes)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Trenton, NJ
Posts: 138
gnormhurst will become famous soon enoughgnormhurst will become famous soon enough
Re: after reset, terminal window prints garbage

That sounds very likely. I will check it at my next work session (Thursday).

Thanks!
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the USPTO.
My favorite error message from gcc: main is usually a function
My favorite error message from Windows: There is not enough disk space available to delete this file.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 23:14.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi