Go to Post If you are playing foozball and your ball bounces back out of the goal, do you expect the table's manufacturer to fix it? No - you groan and keep playing! Nothing's different here. Like Dave said, it's part of the challenge of playing the game. - petek [more]
Home
Go Back   Chief Delphi > Technical > Control System > FRC Control System
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 03-02-2009, 23:31
s0crates s0crates is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2009
Location: Australia
Posts: 52
s0crates is on a distinguished road
bit banging on cRio?

I want to wire up a COM port to the gpio - one pin per input, using 9 total. How would I wire that? Would I conect ground and +, and have the signal pin as the only one connected to the serial?

-jonathan
Reply With Quote
  #2   Spotlight this post!  
Unread 04-02-2009, 08:42
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: bit banging on gpio?

I'm sorry, but I don't understand. I recognize all the words, and the question should make sense, but things just don't add up.

I usually think of "COM port" as referring to a computer's serial port. Is that what you mean?

Where do you have "9 total" inputs?

Do not connect ground and +. That's a short circuit, and you'll trigger the Digital Sidecar's overcurrent shutdown.

The voltage on a computer serial port follows the RS-232 standard, and is not directly compatible with the TTL-level signals of the Digital Sidecar. You'd need a level translator such as the MAX232 series.
Reply With Quote
  #3   Spotlight this post!  
Unread 04-02-2009, 08:48
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: bit banging on gpio?

I think the number "9" came from the number of pins on a standard DE9 RS-232 connector.

You will need one of these: http://en.wikipedia.org/wiki/MAX232

So you would only need a maximum of 4 signal lines between the MAX232 chip and the GPIO pins - Rx, Tx, RTS, CTS. RTS and CTS are optional (you probably won't need them for PC communication). This is in addition to +5V and GND needed by the MAX232.

Here is a kit which comes with easy-to-assemble components to go from a serial cable to your microcontroller. And it costs all of $7.

Last edited by Jared Russell : 04-02-2009 at 08:50.
Reply With Quote
  #4   Spotlight this post!  
Unread 04-02-2009, 10:43
s0crates s0crates is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2009
Location: Australia
Posts: 52
s0crates is on a distinguished road
Re: bit banging on gpio?

Quote:
Originally Posted by Abwehr View Post
I think the number "9" came from the number of pins on a standard DE9 RS-232 connector.

You will need one of these: http://en.wikipedia.org/wiki/MAX232

So you would only need a maximum of 4 signal lines between the MAX232 chip and the GPIO pins - Rx, Tx, RTS, CTS. RTS and CTS are optional (you probably won't need them for PC communication). This is in addition to +5V and GND needed by the MAX232.
That mostly answers my question, but how do I wire the digital io board to the 4 signal lines from from the DE9 (via the max232)? Just leave the other two?
Thanks for the tip about the max232, I think I would have embarrassed myself without that.

-jonathan
Reply With Quote
  #5   Spotlight this post!  
Unread 04-02-2009, 11:49
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: bit banging on gpio?

Quote:
Originally Posted by s0crates View Post
That mostly answers my question, but how do I wire the digital io board to the 4 signal lines from from the DE9 (via the max232)? Just leave the other two?
You're using terms that don't match the names of the 2009 FRC Control System components, and that's keeping me from fully understanding what you want to do.

When you say "digital io board", do you mean the Digital Sidecar? If so, then you wire signals to the "signal" pins of the GPIO headers.

What "other two" are you referring to?

If you want to connect to a computer's serial port for communication to and from the cRIO, you really only need two signals: TX and RX.
Reply With Quote
  #6   Spotlight this post!  
Unread 04-02-2009, 12:21
s0crates s0crates is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2009
Location: Australia
Posts: 52
s0crates is on a distinguished road
Re: bit banging on gpio?

Quote:
Originally Posted by Alan Anderson View Post
When you say "digital io board", do you mean the Digital Sidecar? If so, then you wire signals to the "signal" pins of the GPIO headers.

What "other two" are you referring to?
sorry, digital sidecar. The other two I'm talking about are the two pins used for power - the two that are closer to the edge of the sidecar.

-jonathan

Last edited by s0crates : 04-02-2009 at 12:22. Reason: broken quote
Reply With Quote
  #7   Spotlight this post!  
Unread 04-02-2009, 13:58
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: bit banging on gpio?

You can get power from the +5 and GND pins of any unused digital input. Connect the Rx and Tx lines to two unused digital input signal pins.
Reply With Quote
  #8   Spotlight this post!  
Unread 04-02-2009, 14:57
s0crates s0crates is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2009
Location: Australia
Posts: 52
s0crates is on a distinguished road
Re: bit banging on cRio?

I guess it wasn't very clear - do I need to wire up the two unused pins in some specific way, or do I only connect something to the signal pin and leave the other two unwired and in the same state as when they're unused?

-jonathan
Reply With Quote
  #9   Spotlight this post!  
Unread 04-02-2009, 15:22
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: bit banging on cRio?

Before you get too far down this path, have you done the research to verify that it is possible to bit-bang a serial port on the cRio? Bit-banging RS232 requires very precise timing that may be difficult to achieve on the cRio, depending on how quickly the signal gets through the FPGA and into the cRio, how quickly your timer ISR is called by the OS, how quickly an output pin really changes after you tell the FPGA to change it, etc.

I haven't done any experiments yet to see what these delays look like, but it wouldn't take much to screw up the tight timings necessary for serial, especially at higher baudrates.
Reply With Quote
  #10   Spotlight this post!  
Unread 04-02-2009, 15:30
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,582
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: bit banging on cRio?

Quote:
Originally Posted by Dave Flowerday View Post
Before you get too far down this path, have you done the research to verify that it is possible to bit-bang a serial port on the cRio? Bit-banging RS232 requires very precise timing that may be difficult to achieve on the cRio, depending on how quickly the signal gets through the FPGA and into the cRio, how quickly your timer ISR is called by the OS, how quickly an output pin really changes after you tell the FPGA to change it, etc.

I haven't done any experiments yet to see what these delays look like, but it wouldn't take much to screw up the tight timings necessary for serial, especially at higher baudrates.
My first thought was to take advantage of the SPI/I2C interface with something like a MAX3110.
Reply With Quote
  #11   Spotlight this post!  
Unread 04-02-2009, 15:36
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: bit banging on cRio?

Quote:
Originally Posted by Joe Ross View Post
My first thought was to take advantage of the SPI/I2C interface with something like a MAX3110.
Exactly. I recently designed an I2C->Serial converter board using an Atmel ATtiny AVR for a situation similar to this. The necessary microcontroller and MAX232 clone cost less than $5 together.
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
pic: A "Bit" of a problem. Herodotus Extra Discussion 26 11-10-2007 01:53
A bit of humor... 114Klutz Chit-Chat 0 01-04-2006 17:34
16 bit math on PIC sciguy125 Programming 17 07-10-2005 02:57
A bit unfair... Martin General Forum 61 26-02-2002 07:48
i am a bit miffed Zeinin 3D Animation and Competition 3 18-01-2002 13:39


All times are GMT -5. The time now is 16:42.

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