Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   FIRST Tech Challenge (http://www.chiefdelphi.com/forums/forumdisplay.php?f=146)
-   -   User input via serial port (http://www.chiefdelphi.com/forums/showthread.php?t=40877)

AJBelayer 13-12-2005 21:35

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

foobert 14-12-2005 08:12

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...

Gdeaver 14-12-2005 18:54

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.


All times are GMT -5. The time now is 17:49.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi