Go to Post Dave has said that straight out. Well, straight by dave standards. - phrontist [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 24-01-2006, 13:58
tribotec_ca88's Avatar
tribotec_ca88 tribotec_ca88 is offline
FIRST-a-holic
AKA: Camila Fitzgibbon
FRC #1382 (Tribotec Team)
Team Role: Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: São José dos Campos, Brazil
Posts: 194
tribotec_ca88 is just really nicetribotec_ca88 is just really nicetribotec_ca88 is just really nicetribotec_ca88 is just really nicetribotec_ca88 is just really nice
Send a message via ICQ to tribotec_ca88 Send a message via MSN to tribotec_ca88 Send a message via Yahoo to tribotec_ca88
Question Serial Commands on MPLAB

Just to check and see if i'm thinking straightforward here...
our team started to work with a few serial commands on MPLAB used to communicate with the camera. As an example, we wrote the following code for the SL (sleep) command:

void Sleep_Mode(unsigned char active)
{
Write_Camera_Serial_Port('S');
Write_Camera_Serial_Port('L');
Write_Camera_Serial_Port(1);
Write_Camera_Serial_Port(active);
Write_Camera_Serial_Port('\r');
}

First off, one point we were discussing was related as to whether the "Write_Camera_Serial_Port('\r');" was necessary or not. Secondly, should the function return any values whatsoever?...

Any help at all would be greatly appreciated, as we're still a bit unsure as to how these serial commands work properly...so here's just a callout to all of you programmers out there who are less "confused"...

Thanks ...
__________________
1382 Tribotec Team - Brazil
-----------------------------------------------
2005 NJ Regional GM Industrial Design Award
2005 NJ Regional Website Excellence Award
2004 NJ Regional Semifinalists
-----------------------------------------------

Last edited by tribotec_ca88 : 24-01-2006 at 14:08.
  #2   Spotlight this post!  
Unread 24-01-2006, 14:53
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Serial Commands on MPLAB

Kevin's code puts the camera in "raw" mode, which does not want the '\r' after the parameters. The first byte after the command (here it's a 1) says how many more bytes will follow. I'm pretty sure an extraneous return at that point will have a real chance of waking the camera up immediately after you tell it to sleep.

I don't have a camera handy to test whether or not an ACK comes back after a sleep command, but it's easy for you to connect the camera serial port directly to a terminal and try it for yourself.
  #3   Spotlight this post!  
Unread 24-01-2006, 16:26
tribotec_ca88's Avatar
tribotec_ca88 tribotec_ca88 is offline
FIRST-a-holic
AKA: Camila Fitzgibbon
FRC #1382 (Tribotec Team)
Team Role: Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: São José dos Campos, Brazil
Posts: 194
tribotec_ca88 is just really nicetribotec_ca88 is just really nicetribotec_ca88 is just really nicetribotec_ca88 is just really nicetribotec_ca88 is just really nice
Send a message via ICQ to tribotec_ca88 Send a message via MSN to tribotec_ca88 Send a message via Yahoo to tribotec_ca88
Talking Re: Serial Commands on MPLAB

Quote:
Originally Posted by Alan Anderson
The first byte after the command (here it's a 1) says how many more bytes will follow.
OK... that was something that wasn't stated clearly in the code (or at least I don't recall it being so), but we had a pretty good idea it had something to do with the number of bytes after we noticed there was a "6" in the TC (Track Color) command ...

Quote:
Originally Posted by Alan Anderson
I don't have a camera handy to test whether or not an ACK comes back after a sleep command, but it's easy for you to connect the camera serial port directly to a terminal and try it for yourself.
I imagine an ACK string should be returned (as explained in the "Serial Commands" part of the manual) ... but does anyone know for sure?

Quick thought...on commands such as GS (Get servo) where you get a return value (in this case, the last position sent to a specific servo), where exactly should these values show up ? (on MPLAB, because on Hyperterminal i believe they show up after the ACK message, if i'm not mistaken...) Would they appear right on the Terminal window on IFI Loader??? Or would I have to set some sort of variable ready to receive the command's return value?
__________________
1382 Tribotec Team - Brazil
-----------------------------------------------
2005 NJ Regional GM Industrial Design Award
2005 NJ Regional Website Excellence Award
2004 NJ Regional Semifinalists
-----------------------------------------------
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
CMUcam2 Serial Port Diagnostics Kevin Watson Programming 13 18-02-2006 15:05
Scripting Setup and the Camera + Serial Port Drivers CJO Programming 22 11-01-2006 17:42
Updated: Serial Port Driver Code Kevin Watson Programming 4 05-02-2005 18:39
New Serial Port Driver Kevin Watson Programming 16 09-01-2005 01:56
using the MPLAB IDE MPLAB SIM simulator WizardOfAz Programming 1 03-11-2003 01:24


All times are GMT -5. The time now is 18:11.

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