Go to Post I think Team 45 is cloning Andy. Anybody who has pitted next to them should agree that they are first class students running a first class team. - IKE [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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 23-08-2008, 03:01
knine143 knine143 is offline
Registered User
FRC #1047
 
Join Date: Feb 2008
Location: Irvine
Posts: 15
knine143 is on a distinguished road
Serial communication between RC's

We are making a hexapod robot. There are 6 legs with 3 servos on each leg. This requires 18 pwm outputs. Unfortunately, an RC only has 16. Our solution to this is to send a string of PWM values through a serial cable to another RC and have that slave RC output PWM values.

We have connect the two RCs with a serial cable and we have a null modem between them. We have tested with and without the null modem.

The baud rates are both set to 115200.

In our master RC, we call Write_To_Serial_Port_One() and in our slave RC we call Serial_Port_One_Byte_Count() and Read_Serial_Port_One().

We cannot retrieve the data sent by the master to the slave.

Our program has been simplified to the master continuously sending out '@' on each iteration of Default_Routine() and our slave turns on a light on the OI if it receives that character.

The master is definitely writing the '@' because I can see it show up on the terminal on my computer. Therefore, the problem must be that the slave isn't reading it.

Any ideas?

Thanks in advance.
  #2   Spotlight this post!  
Unread 23-08-2008, 03:56
Pat Fairbank's Avatar
Pat Fairbank Pat Fairbank is offline
Circuit Breaker
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2001
Location: San Jose, CA
Posts: 2,132
Pat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond repute
Send a message via MSN to Pat Fairbank
Re: Serial communication between RC's

For receiving on the serial port to work you need to have ENABLE_SERIAL_PORT_ONE_RX defined and to call Init_Serial_Port_One() in the initialization, but I'm assuming from the content of your post that you've got that covered.

Are you confident in the integrity of your null modem cable? If you're receiving input on the computer terminal, that's fine, but that's presumably with a different plain serial cable. Try hooking up the slave to the computer and sending the '@' from the terminal.

Also, if I were trying to debug this problem I would put some temp code to flash the lights directly in the serial port rx interrupt handler in user_routines_fast.c, just to verify that the serial port is receiving independently of what's being sent.

Lastly, when you say "null modem cable", you do mean a male-male serial cable that has the TX and RX pins swapped along the length and not just a normal serial cable with a gender-bender, right? Just checking.
__________________
Patrick Fairbank
Team 254 | Mentor (2012-)
Team 1503 | Mentor (2007-2011)
Team 296 | Alumnus (2001-2004) | Mentor (2005-2006)

patfairbank.com
  #3   Spotlight this post!  
Unread 23-08-2008, 09:40
tdlrali tdlrali is offline
Registered User
FRC #0469 (Las Guerrillas)
Team Role: Programmer
 
Join Date: Sep 2006
Rookie Year: 2006
Location: MI
Posts: 377
tdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud of
Re: Serial communication between RC's

Along with Pat's suggestions, you could also try lighting your indicator when Serial_Port_One_Byte_Count() > 0. (do this before you call the read fxn)

I'm 99% sure you have ENABLE_SERIAL_PORT_ONE_RX defined, otherwise you could not call Read_Serial_Port_One() without the compiler throwing errors.
  #4   Spotlight this post!  
Unread 23-08-2008, 19:50
knine143 knine143 is offline
Registered User
FRC #1047
 
Join Date: Feb 2008
Location: Irvine
Posts: 15
knine143 is on a distinguished road
Re: Serial communication between RC's

We got it working, thanks.

We weren't including serial.h... which is odd because MPLab still let us compile. Thanks for the help guys

check out some pictures near the bottom of the page http://www.teamechoes.com/index.php?page=9
  #5   Spotlight this post!  
Unread 23-08-2008, 23:36
ChuckDickerson's Avatar
ChuckDickerson ChuckDickerson is offline
Mentor / Bayou & CMP Division LRI
FRC #0456 (Siege Robotics)
Team Role: Mentor
 
Join Date: May 2004
Rookie Year: 2004
Location: Vicksburg, MS
Posts: 877
ChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond repute
Re: Serial communication between RC's

You guys might also check into the Parallax Servo Controller: http://www.parallax.com/Store/Microc...%2cProductName

It might be a cheaper and lighter way to control additional servos from one RC using the serial port. Looks like an easy way to add 16 more servo outputs and you can connect two of them together to get 32 servo outputs.
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
FAHA: Communication between mentors Bharat Nain General Forum 5 01-01-2008 12:38
Serial Communication to a Cmucam3 Lawrey Programming 0 03-09-2007 21:38
RS232 (Serial) Communication To OI bglass Programming 9 07-07-2007 04:04
Serial Communication in C++ Adam Shapiro Programming 8 21-01-2003 12:49
serial communication using c++ Malakili Programming 31 01-05-2002 15:51


All times are GMT -5. The time now is 00:10.

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