|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||||
|
|||||
|
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. |
|
#3
|
|||||
|
|||||
|
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. |
|
#4
|
|||
|
|||
|
Re: bit banging on gpio?
Quote:
Thanks for the tip about the max232, I think I would have embarrassed myself without that. -jonathan |
|
#5
|
|||||
|
|||||
|
Re: bit banging on gpio?
Quote:
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. |
|
#6
|
|||
|
|||
|
Re: bit banging on gpio?
Quote:
-jonathan Last edited by s0crates : 04-02-2009 at 12:22. Reason: broken quote |
|
#7
|
|||||
|
|||||
|
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.
|
|
#8
|
|||
|
|||
|
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 |
|
#9
|
||||
|
||||
|
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. |
|
#10
|
||||||
|
||||||
|
Re: bit banging on cRio?
Quote:
|
|
#11
|
||||
|
||||
|
Re: bit banging on cRio?
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.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |