Go to Post This, right here, is why I participate in FRC. Changing lives, one corndog at a time. - Jared Russell [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 28-12-2007, 22:51
weinbergmath's Avatar
weinbergmath weinbergmath is offline
Mentor to China FTC/FLL, FRC1230
AKA: Evan Weinberg
FRC #1230
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Hangzhou, China
Posts: 22
weinbergmath is a splendid one to beholdweinbergmath is a splendid one to beholdweinbergmath is a splendid one to beholdweinbergmath is a splendid one to beholdweinbergmath is a splendid one to beholdweinbergmath is a splendid one to beholdweinbergmath is a splendid one to beholdweinbergmath is a splendid one to behold
Vex/Arduino Serial Port Help

Hi everyone,

I've been working on an idea I've had for a while now of using an Arduino board as a navigation coprocessor for our team's FRC robot. The board works quite well for its current purpose, which is to read encoder counts, calculate distance, orientation, and potentially other important quantities related to navigation. My plan is to have the board output this data to the serial port using the same format as the CMU camera, allowing me to use and tweak Kevin Watson's code for grabbing camera data for this application.

Right now I am prototyping this on a Vex RC using the TTL serial port and the camera software written for the edubot that HAS previously worked with the camera. (We used it last year for prototyping.) I have connected the grounds between the Arduino and Vex and the Vex rx pin to the Arduino TX output. As a test, I sent the letter 'k' continuously through serial port 2, and wrote another program on the arduino to turn on an led when it receives a 'k'.

The problem is (as you might have guessed) that the two are not talking to each other in this simple test. I have configured the arduino at 9600 bps, 8-N-1 as is default in the serial port software for serial port two. I have tested the serial port with another arduino board at both 9600 and 115200 bps to show that the serial port functions. I have also tried 115200 bps out of the vex from both serial ports one and two.

By connecting a dumb terminal to the output, I've been able to read directly the output of the vex serial port. On serial port one, the characters come out correctly when I call "Write_Serial_Port_One('k'), but the serial data is clearly not read by the arduino since the LED does not go on. With serial port two, things become a bit more strange - the only way to send the 'k' is by sending the character code in Write_Serial_Port_Two(), and not with 'k' in the parentheses. When I call Write_Serial_Port_Two('k') it sends a blank character, and this is independent of the speed I tell it to send at.

I guess the deal breaker is that I can't verify that the serial ports are communicating, and without this, there's no chance the arduino can send the data back to the RC.

My question for the experts: If the pins are correctly connected (RX to TX, grounds connected together) and the port speeds are the same, is there anything ELSE that would also have to be configured to make two serial ports talk to each other? Is there a reason why the Write_Serial_Port functions would not be able to send a character ('k') out of serial port 2, but would be able to out of serial port 1?

Please let me know if you can think of things to try....

Thanks!

Evan
 


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
Programming the vex microcontroller to respond to commands on the serial port crashoverride02 Programming 1 20-10-2006 14:17
Serial Port Help? StargateFan Programming 12 05-07-2006 14:06
Programming Vex Starter Kit To Recieve From Serial Port firetrap FIRST Tech Challenge 0 26-09-2005 17:27
TTL port to a serial port on a demo board ImmortalAres Programming 16 09-07-2005 23:44
USB to 9-pin serial port (HELP!!) n00b Technical Discussion 10 01-02-2004 21:25


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

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