Go to Post However, it is logistically impossible, so it's now just a joke. - EricH [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-12-2005, 21:35
AJBelayer AJBelayer is offline
Registered User
no team
 
Join Date: Dec 2005
Location: Colorado
Posts: 3
AJBelayer is an unknown quantity at this point
User input via serial port

I am working on a special project for my vex robot but for this project to work I need to be able to accept input from a computer via the serial port (or other means but serial port seems easiest). Has anyone found a way to recive input from the serial port, I have tried using the stdio.h file as you would normally in c to get input from the keyboard but the stdio.h file included with mcc18 doesn't have that feature.

The other key that would help in solving this problem would be finding a copy of the "online test code" but from what I gather this has not been released to the general public.

Any help would be greatly appreiceated.

AJBelayer
Reply With Quote
  #2   Spotlight this post!  
Unread 14-12-2005, 08:12
foobert foobert is offline
Registered User
no team
 
Join Date: May 2005
Location: oakland, ca
Posts: 87
foobert is a jewel in the roughfoobert is a jewel in the roughfoobert is a jewel in the rough
Re: User input via serial port

you'll probably want to take a look at the 18f8520 data sheet for information regarding control of the vex serial ports. then you'll probably want to consider doing interrupt driven i/o, because the vex has, for lack of a better term, blackout periods when it's generating pwm for the motor ports and listening at the spi port for data from the radio from the master controller. this blackout is about 4ms out of every 18.5. seems like you could drop a byte here or there at higher baud rates.

you would need to keep your interrupt service routines tight so as not to cause glitches in the motor control or lose data from the radio.

anyway, a guy name of kevin watson has done most of the work for you. he has libraries for the first controller that ought to work without modification on the vex controller. i'm sure someone out there can tell you where to find them.

best o' luck...
Reply With Quote
  #3   Spotlight this post!  
Unread 14-12-2005, 18:54
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,370
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: User input via serial port

The Pic has a hardware buffer for the serial port. The interrupt is generated when data is received. Kevin Watson wrote a serial routine that should work for the vex controller. There might be some minor changes need. A software serial routine will not work for the VEX or FRC because of the Timer 0 interrupt.
Reply With Quote
Reply


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
Scripting Setup and the Camera + Serial Port Drivers CJO Programming 22 11-01-2006 17:42
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
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


All times are GMT -5. The time now is 12:21.

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