Go to Post It is crucial to keep experience and keeping collected under pressure as high points that can't be measured in a test. - jnelly [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 06-23-2004, 07:49 PM
Max Lobovsky's Avatar
Max Lobovsky Max Lobovsky is offline
Fold em oval!
FRC #1257 (Parallel Universe)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Scotch Plains, NJ
Posts: 1,026
Max Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant future
Send a message via AIM to Max Lobovsky
Using the TTL and program port

Now I know the gut reaction of all you good, community-minded CD users is to point me to a search of the forums for this information, but I have already done that. After spending an hour or two looking on several websites, I could not find a complete explanation of how the TTL (and program) port works and how to use it. I understand the topic might be too big for a single resource to cover it, but even an introduction is lacking. Some of the things I'd like to know are
  • what does the protocol specify (i understand it is very loose)
  • pin out chart (specific to RC/Robovation)
  • What do the functions in usart.h actually do
  • a (well) documented example of its use
Of course, you can help the whole community out by recording this information in a FIRSTwiki article about the TTL port. Thanks.
__________________
Learn, edit, inspire: The FIRSTwiki.
Team 1257


2005 NYC Regional - 2nd seed, Xerox Creativity Award, Autodesk Visualization Award
2005 Chesapeake Regional - Engineering Inspiration Award
2004 Chesapeake Regional - Rookie Inspiration award
2004 NJ Regional - Team Spirit Award

Last edited by Max Lobovsky : 06-23-2004 at 09:52 PM.
  #2   Spotlight this post!  
Unread 06-23-2004, 07:52 PM
dez250 dez250 is offline
54... What a good number!
no team
 
Join Date: Dec 2002
Rookie Year: 2000
Location: Upstate NY / Manchester, NH
Posts: 1,721
dez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond repute
Send a message via AIM to dez250
Re: Using the TTL port

im guessing by ttl port you mean a computers parallel port and if thts truely what you mean then here http://computer.howstuffworks.com/parallel-port.htm

Hope that helps
__________________
#5

-Michael Dessingue
  #3   Spotlight this post!  
Unread 06-23-2004, 08:06 PM
Tristan Lall's Avatar
Tristan Lall Tristan Lall is offline
Registered User
FRC #0188 (Woburn Robotics)
 
Join Date: Aug 2001
Rookie Year: 1999
Location: Toronto, ON
Posts: 2,484
Tristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond repute
Re: Using the TTL port

I think he's talking about the TTL serial port on the EDU-RC. It should be functionally identical to a regular serial port, except with much lower voltage levels required for signalling.
  #4   Spotlight this post!  
Unread 06-23-2004, 08:58 PM
Max Lobovsky's Avatar
Max Lobovsky Max Lobovsky is offline
Fold em oval!
FRC #1257 (Parallel Universe)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Scotch Plains, NJ
Posts: 1,026
Max Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant future
Send a message via AIM to Max Lobovsky
Re: Using the TTL port

Quote:
Originally Posted by Tristan Lall
I think he's talking about the TTL serial port on the EDU-RC. It should be functionally identical to a regular serial port, except with much lower voltage levels required for signalling.
Yes, I'm talking the FIRST-sepcific ttl port. Also, as I understand it, both the RC and the Robovation have a ttl serial port.
__________________
Learn, edit, inspire: The FIRSTwiki.
Team 1257


2005 NYC Regional - 2nd seed, Xerox Creativity Award, Autodesk Visualization Award
2005 Chesapeake Regional - Engineering Inspiration Award
2004 Chesapeake Regional - Rookie Inspiration award
2004 NJ Regional - Team Spirit Award

Last edited by Max Lobovsky : 06-23-2004 at 09:01 PM.
  #5   Spotlight this post!  
Unread 06-23-2004, 08:33 PM
AlbertW's Avatar
AlbertW AlbertW is offline
harker robotics :. 1072
AKA: Aonic
#1072 (Harker Robotics)
Team Role: College Student
 
Join Date: Oct 2002
Rookie Year: 2003
Location: San Jose, CA
Posts: 323
AlbertW is on a distinguished road
Send a message via AIM to AlbertW
Re: Using the TTL port

He's talking about the TTL (Transistor-Transistor Logic) port on the 2004 Robot Controller.

The TTL port is a direct link to the User Processor in the RC and is basically a non-level-shifted version of the program port (which is RS232). Both of them can be used (with or without level-shifting) to communicate with other serial devices like CMUcams, computers, other RCs, and so forth.

In short, it's another serial port. How do you use it in the progrmaming? Don't ask me.

Oh, and the pinout (as copied from the Innovation FIRST RC reference guide) is

From left to right, +5v, TX (transmit), RX (recieve), B (ground)
__________________

We were the first seeded first-year team at a first-year FIRST regional.

Last edited by AlbertW : 06-23-2004 at 08:36 PM. Reason: adding information
  #6   Spotlight this post!  
Unread 06-23-2004, 09:56 PM
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Using the TTL port

I can tell you more about hardware than software.

The Program port is a standard DCE RS-232 port.

To my knowledge, TTL uses an almost identical format as RS-232, the difference is that it uses different voltages. The wave forms are identical, though.
RS-232 is 1 = -3v to -25v; 0 = 3v to 25v.
TTL is (generally) 1 = 5v; 0 = 0v.

My favorite site on this is Beyond Logic, and Thier serial article.

In the RCs, the Prog port is USART1 in api, the TTL is USART2.

In the MCC18 Libraries Doc (C:\mcc18\doc\MPLAB-C18-Libraries.pdf), the API info can be found in section 2.10 (p. 58). There is probably more info on Microchip's web site, but that's down at the moment.
  #7   Spotlight this post!  
Unread 06-25-2004, 12:44 PM
Gene F's Avatar
Gene F Gene F is offline
FIRST Fanatic
AKA: Gene Falendysz
#0343 (Metal in Motion)
Team Role: Engineer
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Oconee County, SC
Posts: 218
Gene F is a splendid one to beholdGene F is a splendid one to beholdGene F is a splendid one to beholdGene F is a splendid one to beholdGene F is a splendid one to beholdGene F is a splendid one to beholdGene F is a splendid one to beholdGene F is a splendid one to behold
Send a message via AIM to Gene F
Re: Using the TTL port

Astronouth7303,
Here is the code we used to talk to a second micro that was keeping track of our position. It uses the TTL port. The documentation supplied didn't mention setting the port directio registers (See the first couple of lines in the SensorInitializePort() routine). The EDU Bot did it for you but the RC requires that you do it yourself. If you want the source files PM me and I'll email you the files.

Gene F. Team 343 Metal in Motion

AAARRRGGG!!! The tabs all got removed when I posted the code! If anyone needs/wants the actual source code PM me.

#include "ifi_aliases.h"
#include "ifi_default.h"
#include "ifi_utilities.h"
#include "sensors.h"
#include "printf_lib.h"
// Added by Gene
#include <usart.h>
#include "delays.h"

SensorPackType Sensors;

/************************************************** *****************************
* FUNCTION NAME: InitializeSensorPort
* PURPOSE: Opens the serial port 2 for communicating with the scensors at
* 19.2k baud, 8 bits, no parity, one stop bit, and no flow control.
* CALLED FROM: user_routines.c
* ARGUMENTS: none
* RETURNS: void
************************************************** *****************************/
void SensorInitializePort (void)
{
// Set up TX pin as an output and RX as an input.
TRISGbits.TRISG1 = 0;
TRISGbits.TRISG2 = 1;

Open2USART(USART_TX_INT_OFF &
USART_RX_INT_OFF &
USART_ASYNCH_MODE &
USART_EIGHT_BIT &
USART_CONT_RX &
USART_BRGH_HIGH,
128);

Delay1KTCYx( 50 ); /* Settling time */
}

/* Code to read Bills device. */
/************************************************** *****************************
* FUNCTION NAME: ReadSensorPack
* PURPOSE: Talks to the sensor pack to read the current data
* CALLED FROM: user_routines.c
* ARGUMENTS: none
* RETURNS: void
************************************************** *****************************/
void SensorPackRead (void)
{
int i, j;
RCSTA2bits.CREN = 1; // Re-enable the receiver
// Send an STX to the sensor pack to tell it to send the data
putc2USART(STX);

// Loop for the number of characters in the sensor pack data
for ( j = 0; j < 8/*sizeof(SensorPackType)*/; j++ )
{
// Wait a finite amount of time for the next character to arrive.
for ( i = 0; i < 2500; i++ )
if ( DataRdy2USART())
break;

// If a character arrived (we didn't timeout)
if ( i != 2500 )
{
// Grab the next charcter from the USART and place it in our data structure
Sensors.chars[j] = getc2USART();
}
else
{
// If it failed then clear any possible errors
RCSTA2bits.CREN = 0; // Disable the receiver
RCSTA2bits.CREN = 1; // Re-enable the receiver
printf("Rx Fail DataRdy = %d\n",(int)DataRdy2USART()); /* printf EXAMPLE */
}
}
RCSTA2bits.CREN = 0; // Disable the receiver
// printf("x=%6d,y=%6d,pe=%6d,dd=%4d,ae=%4d\n", Sensors.LeftOdom, Sensors.RightOdom, Sensors.PosError, (int)(unsigned char)Sensors.DDCompass, (int)( char)Sensors.AngleError );
}

/************************************************** *****************************
* FUNCTION NAME: ensorEnterAutoMode
* PURPOSE: Puts the sensor pack into automatic mode sending the desired x
* and y coordiantes.
* Format of command: A<xl><xl><yl><yh>
* CALLED FROM: user_routines.c
* ARGUMENTS: none
* RETURNS: void
************************************************** *****************************/
void SensorEnterAutoMode (int x, int y)
{
volatile int i;
printf("x=%d y=%d\r",x,y);

while (Busy2USART());
putc2USART('A');
for(i=0;i<1000;i++);
while (Busy2USART());
putc2USART((char)(x & 0xff));
for(i=0;i<1000;i++);
while (Busy2USART());
putc2USART((char)((x >> 8) & 0xff));
for(i=0;i<1000;i++);
while (Busy2USART());
putc2USART((char)(y & 0xff));
for(i=0;i<1000;i++);
while (Busy2USART());
putc2USART((char)((y >> 8) & 0xff));
for(i=0;i<1000;i++);
while (Busy2USART());
putc2USART('\0');
}
__________________
- Gene Falendysz
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
Having trouble with TTL port Gene F Programming 12 02-10-2004 03:23 PM
TTL pins Dave... Control System 3 02-07-2004 11:59 PM
Fried program slots? Jeff Waegelin Programming 18 03-19-2003 06:08 PM
Dashreader.dll: A Visual Basic .NET user control to read the dashboard port Ameya Programming 4 01-12-2003 11:40 PM
Change to Initializing Inputs and Outputs Jferrante Programming 4 01-07-2003 11:36 AM


All times are GMT -5. The time now is 04:14 PM.

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