digital to RS-232

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Post Reply
crashcup
Posts: 1
Joined: Wed Jun 01, 2005 1:01 am
Location: Michgan
Contact:

digital to RS-232

Post by crashcup » Wed Jun 01, 2005 3:11 pm

I need a basic digital to RS-232 circuit.<p>I mean I want to have around 8 digital inputs that I can poll with via RS-232. I want to read the state of the digital inputs into my PC via Visual BASIC.

User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Re: digital to RS-232

Post by philba » Wed Jun 01, 2005 5:42 pm

This isn't so simple if you want to build it. if you want a circuit, you'll need to read the 8 digital signals, convert them to serial I/O and then level shift to RS232. I'd use a cheap microcontroller with serial and a max232 drs232 driver. But that will require microcontroller capability. Maybe a basic stamp would do it but that's still going to take some programming (easy, though). <p>Look here for prepackaged solutions
http://www.superlogics.com/cpseries.asp if you dont want to do programming.

rshayes
Posts: 1286
Joined: Tue Mar 04, 2003 1:01 am
Contact:

Re: digital to RS-232

Post by rshayes » Wed Jun 01, 2005 9:05 pm

This is basically what the old 6402 UART did. Eight parallel bits in and a serial output stream with start and stop bits added.<p>These were quite widely used, and surplus supplies may still be available.<p>To generate the RS-232 levels you can use one of the Maxim interface chips. Most of these have an internal charge pump to provide the higher voltages needed for RS-232 from a 5 volt supply.<p>An alternate is to use a programmable logic device such as the Xilinx parts sold by DigiKey. All you really need is a ten or eleven bit shift register and some logic to control the load process. Or you can do a parallel load during the start bit and let the register run continuously. This will give you a continuous series of samples.

User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Re: digital to RS-232

Post by philba » Wed Jun 01, 2005 9:49 pm

Yeah, the 6402 could be made to work (what a monster chip!). BG Micro seems to have them. The transmit load line would need to get strobed (use cts, maybe) to get the data in and start the transmit. <p>By the way, there may be some characters that VB may not pass to you (what does it do with 0, for example).

rstofer
Posts: 115
Joined: Sun May 15, 2005 1:01 am
Contact:

Re: digital to RS-232

Post by rstofer » Wed Jun 01, 2005 10:41 pm

Ah, but you said "polled". How do you intend to implement polling? Sure the UARTs will convert parallel to serial and the driver chip will change it to RS232 but something has to cause the UART to send data.<p>It would be pretty easy to connect a 555 timer to continuously strobe the UART so it will send the data as a continuous stream. But that is not polled.<p>Now, were it me (and it's not) I would use the parallel port in EPP mode. This is pretty easy to set up but you need a parallel port DLL if you are using Windows XP, NT or 2000. I would recommend you study "Parallel Port Complete" by Axelson and visit www.lvr.com. And download inpout32.dll for use in VB.<p>One other possibility, you could fire the 555 as an astable with data you send to the com port. This could pulse the UART and cause it to send a reply. The pulse width would need to be longer than a single character time so it only triggers once per char, not on each bit.<p>I haven't looked at the datasheets for these things in many years. It MIGHT be possible to use the data received flag to trigger the transmission. In this case you would just send a char and receive a reply.

User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Re: digital to RS-232

Post by philba » Thu Jun 02, 2005 1:01 am

polled - I'd use CTS. the PC lowers and then raises RTS. The sender uses the CTS pulse (I think that's how it sees the RTS signal) to clock the transmit data and start the transmission (transmit load pin). Its not clear if RTS/CTS is seen inverted or not so a little experimentation may be in order.<p>edit: oops - got it backwards - switch RTS and CTS. Poller says "request to send" and sender sees "clear to send".<p>[ June 02, 2005: Message edited by: philba ]</p>

User avatar
Dave Dixon
Posts: 436
Joined: Thu May 01, 2003 1:01 am
Location: Wichita, KS
Contact:

Re: digital to RS-232

Post by Dave Dixon » Thu Jun 02, 2005 6:27 am

This may be a little overkill, but ready for expansion. Last I checked, IEEE-488 GPIB interface cards were getting really cheap. Lots of features, and back in the day, worked well with BASIC and such. A search will give you tons of info.
Dave

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 54 guests