Go to Post Ha, our 2009 robot's nickname was Sparky, for the same reason...we now have EXTRA fire extinguishers because of it ;P - Karibou [more]
Home
Go Back   Chief Delphi > Technical > Control System
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 18-02-2006, 23:13
Eldarion's Avatar
Eldarion Eldarion is offline
Electrical Engineer / Computer Geek
AKA: Eldarion Telcontar
no team (Teamless Orphan)
Team Role: Alumni
 
Join Date: Nov 2005
Rookie Year: 2005
Location: Númenor
Posts: 558
Eldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond repute
Send a message via AIM to Eldarion Send a message via Yahoo to Eldarion
Exclamation Camera glitch / failure

I am having a problem with the 2005 camera code and the 2006 controller. The camera will "glitch" randomly and never recover. I have had the thing run for 30 minutes with no problems, and yet sometimes it will give out in five seconds!

It is giving all the appearences of a receive failure, and resetting the RC is the only thing that can make it recover. I have tried 2 different camera boards, with and without the TTL converter (made a special cable for without!). I have tried software and hardware resetting the camera board, to no avail. (It resets the camera board, but the RC never seems to receive anything, including the power-on ACKs, after the failure).

Can anyone help me on this? It is frustrating me to no end. When I say random, I mean random!

EDIT:
I wonder if this will clear up the problem? It looks as if maybe we are setting the RX overflow bit now and them (maybe due to a coincidental firing of a lot of interrupts in a short period of time), and this will halt the RX completely until the following code is called.

Kevin, could you please help me with this? I haven't worked directly with the PIC USARTs before.

Code:
if(RCSTA2bits.OERR)
  {
    RCSTA2bits.CREN = 0;		// Make sure the receive is still enabled!
    RCSTA2bits.CREN = 1;
    RXINTE2 = 1;
  }
__________________
CMUCam not working? Tracks sporadically? Try this instead: http://www.falconir.com!
PM me for more information if you are interested (it's open source!).

Want the FIRST Email blasts? See here: http://www.chiefdelphi.com/forums/sh...ad.php?t=50809

"The harder the conflict, the more glorious the triumph. What we obtain too cheaply, we esteem too lightly; it is dearness only that gives everything its value."
-- Thomas Paine

If it's falling apart it's a mechanical problem. If it's spewing smoke it's a electrical problem.
If it's rampaging around destroying things it's a programming problem.

"All technology is run on 'Magic Smoke' contained within the device. As everyone knows, whenever the magic smoke is released, the device ceases to function."
-- Anonymous

I currently speak: English, some German, Verilog, x86 and 8051 Assembler, C, C++, VB, VB.NET, ASP, PHP, HTML, UNIX and SQL

Last edited by Eldarion : 19-02-2006 at 02:45. Reason: Added some info
  #2   Spotlight this post!  
Unread 19-02-2006, 11:18
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Cañada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Cañada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Camera glitch / failure

Quote:
Originally Posted by Eldarion
I am having a problem with the 2005 camera code and the 2006 controller. The camera will "glitch" randomly and never recover. I have had the thing run for 30 minutes with no problems, and yet sometimes it will give out in five seconds!

It is giving all the appearences of a receive failure, and resetting the RC is the only thing that can make it recover. I have tried 2 different camera boards, with and without the TTL converter (made a special cable for without!). I have tried software and hardware resetting the camera board, to no avail. (It resets the camera board, but the RC never seems to receive anything, including the power-on ACKs, after the failure).

Can anyone help me on this? It is frustrating me to no end. When I say random, I mean random!

EDIT:
I wonder if this will clear up the problem? It looks as if maybe we are setting the RX overflow bit now and them (maybe due to a coincidental firing of a lot of interrupts in a short period of time), and this will halt the RX completely until the following code is called.

Kevin, could you please help me with this? I haven't worked directly with the PIC USARTs before.

Code:
if(RCSTA2bits.OERR)
{
RCSTA2bits.CREN = 0;		// Make sure the receive is still enabled!
RCSTA2bits.CREN = 1;
RXINTE2 = 1;
}
Make sure the serial port receive interrupts are the first to get serviced in the low-priority ISR. If it is an overrun error, you can only fix it by resetting the serial port Rx circuit with this code:

Code:
 
// if the interrupt handler was disabled while data was being received,
// data may have backed-up in the receiver circuitry, causing an overrun
// condition. So let's check the OERR bit to see if this has happened
// and if it has, we'll need to reset the serial port receiver circuitry
// to get data flowing again.
if(RCSTA1bits.OERR)
{
// reset by turning off the receiver circuitry, then...
RCSTA1bits.CREN = 0;
 
// ...turn it back on
RCSTA1bits.CREN = 1;
 
// indicate that we've had an error
RX_1_Overrun_Errors++;
}
If you're using my serial port driver, this is automatically handled in the Rx ISRs. If you aren't using my code, you can place this code in the fast loop.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #3   Spotlight this post!  
Unread 19-02-2006, 18:43
Eldarion's Avatar
Eldarion Eldarion is offline
Electrical Engineer / Computer Geek
AKA: Eldarion Telcontar
no team (Teamless Orphan)
Team Role: Alumni
 
Join Date: Nov 2005
Rookie Year: 2005
Location: Númenor
Posts: 558
Eldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond repute
Send a message via AIM to Eldarion Send a message via Yahoo to Eldarion
Re: Camera glitch / failure

OK, thanks. That worked just great!

It is maddening to waste a few days trying to fix an error that can be fixed by flipping one bit.
__________________
CMUCam not working? Tracks sporadically? Try this instead: http://www.falconir.com!
PM me for more information if you are interested (it's open source!).

Want the FIRST Email blasts? See here: http://www.chiefdelphi.com/forums/sh...ad.php?t=50809

"The harder the conflict, the more glorious the triumph. What we obtain too cheaply, we esteem too lightly; it is dearness only that gives everything its value."
-- Thomas Paine

If it's falling apart it's a mechanical problem. If it's spewing smoke it's a electrical problem.
If it's rampaging around destroying things it's a programming problem.

"All technology is run on 'Magic Smoke' contained within the device. As everyone knows, whenever the magic smoke is released, the device ceases to function."
-- Anonymous

I currently speak: English, some German, Verilog, x86 and 8051 Assembler, C, C++, VB, VB.NET, ASP, PHP, HTML, UNIX and SQL
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
CMU Camera kills robot controller if not found. Chris_Elston Programming 21 27-03-2006 14:30
Camera shows no love to drive motors anifinder Programming 4 13-02-2006 10:31
How To Use the Google Camera generalbrando Kit & Additional Hardware 2 07-02-2006 16:00
Camera Is Spazzing Out! BrittanyV Programming 15 04-02-2006 13:39
Scripting Setup and the Camera + Serial Port Drivers CJO Programming 22 11-01-2006 17:42


All times are GMT -5. The time now is 03:48.

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