PDA

View Full Version : RTS# & CTS# pins



bryan costanich
01-26-2007, 11:22 AM
I have the UM232R from ftdi: http://www.ftdichip.com/Products/EvaluationKits/UM232R.htm and i'm interfacing it with the basic chip.

According to the datasheet (http://www.ftdichip.com/Documents/DataSheets/Modules/DS_UM232R.pdf) pins 3 and 10 go to CTS# and RTS# on the MCU respectively. the datasheet says this is for handshaking.

question: are there pins on the basic chip for this?

i was looking at the schematic for the bs2e (http://www.parallax.com/dl/docs/prod/schem/BS2pe24SchematicRevB.pdf) and while i see that pin 4 (ATN) goes to DTR on the serial port, i don't really know what this means.

anyone have an idea?

allanlane5
01-27-2007, 12:20 AM
Sure. When talking to a modem, the RTS (Ready To Send) is sent by the PC to tell the Modem it has a byte ready to send. The Modem then sends back a CTS (Clear To Send) to tell the PC that it's ok to send that byte. This is called "hardware handshake". Should the modem's buffer get too full, it would lower "CTS" to tell the PC to wait a bit before sending more data.

Now, most BS2 serial uses don't use RTS/CTS or "hardware handshake" (same thing). Instead, the BS2 sends data using the TX line, and just expects the 'target' to be fast enough to deal with the small amount of data the BS2 can send.

So usually you don't need to worry about the RTS/CTS lines, and in fact can use them as additional TX/RX drivers.

Oh, and the BS2 DOES implement a 'hardware handshake' on its SEROUT/SERIN, but I've found it such a pain in the butt I don't use it. But the BS2 does support it.

Chris Savage
01-27-2007, 05:20 AM
Bryan,

To answer your question about DTR, the Stamp Editor uses it to RESET the BASIC Stamp. So that line is brought HIGH briefly during Identification or Programming. For communication it is not used. It is by default another type of handshaking line called, “Data Terminal Ready”. Take care.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support

bryan costanich
02-12-2007, 06:46 AM
so when connecting it to the UM232R, does the DTR get connected to anything, or is that not possible with the USB interface?

Mike Green
02-12-2007, 06:54 AM
There are two issues here. If you're connecting the UM232R to the Stamp for programming purposes, the DTR does get connected (through a capacitor and transistor) to the Reset pin. The RTS pin isn't connected as I recall. If you're connecting the UM232R for some kind of data transfer (other than programming), you connect the UM232R pins to ordinary Stamp I/O pins and use the SERIN and SEROUT statements. For a lot of uses, you don't need DTR and RTS. For some uses, you do use them and the SERIN and SEROUT statements have options for Flow Control. You specify the pin where DTR (SERIN) and RTS (SEROUT) are connected as well as the pins for received data (SERIN) and transmitted data (SEROUT). Read the section of the manual on the SERIN and SEROUT statements.

bryan costanich
02-12-2007, 03:20 PM
yeah, i use serin and serout all the time, i'm familiar with that.

for the DTR to Reset#, is that documented someplace? .e.g what are the values for the capacitor and resistor?

allanlane5
02-12-2007, 09:11 PM
Some programs (like Hyperterminal) put DTR high, and leave it high, when the program runs. Now, the BS2 'programming port' (the one with the DB-9 on the BOE) uses DTR to reset the BS2 in preparation for programming.

So, on your own circuit, if you wire DTR directly, and then try to use hyperterminal, hyperterminal holding DTR high will hold the BS2 in reset. Your program won't run.

So, to get around this, on the BOE Parallax has installed two 0.1 uF capacitors -- one in parallel, one in series -- in the DTR line. These two capacitors insure that when a 'stupid' program like Hyperterm raises DTR, the BS2 sees only a 'blip' -- enough to reset the BS2, but it won't then hold the BS2 in reset. ('Stupid' above because there's no way to turn off DTR in Hyperterm.).

For the actual schematic, you can look at the BOE schematic (I think it's in the PBasic manual).

bryan costanich
02-13-2007, 05:16 AM
ah, makes sense.

however, if i'm only using the bs2 stamp editor to program, i can dispense with that, yes? and if i hook the DTR to the RESET# and use the usb drivers, will it send the reset command to the reset# pin?

bryan costanich
03-10-2007, 01:11 PM
ok, i'm going through this again and i'm still confused. where does the reset "high" come from on the UM232R? what pin specifically? i see a RST# pin on it, which is pin #20, however, the UM232R documentation has this to say:

----
In order to meet requirement (i) the USB Bus Power is used to control the RESET# Pin of the FT232R device. When the USB Host or Hub is powered up the internal 1.5kΩ resistor on USBDP is pulled up to 3.3V, thus identifying the device as a full speed device to USB. When the USB Host or Hub power is off, RESET# will go low and the device will be held in reset. As RESET# is low, the internal 1.5kΩ resistor will not be pulled up to 3.3V, so no current will be forced down USBDP via the 1.5kΩ pull-up resistor when the host or hub is powered down. To do this pin 14 (USB) is connected to PU2 and PU1 is connected to RST#. Failure to do this may cause some USB host or hub controllers to power up erratically.
----

which leads me to believe that Pin20 on the 232R is for the resetting of the 232r itself, not for the attached microcontroller. if that is the case, how is the reset sent from the 232R to the microcontroller.

i need to be able to program the stamp from this interface, so i need to know how to send the reset pulse.

bryan costanich
03-11-2007, 06:58 AM
ok, i poured over all this again today and went through all the docs. what i understand now is this: on the UM232R, pin 2 is the DTR pin. (this isn't in the schematic for the mcu interface they provided, but the doc does have a pin out description and says that there.) however, because it may go high and sit at high, (per allanlane5's post) i have to install two capacitors (as it shows in the BS2 to pc schematic) so that it pulses rather than sits high. that then connects to pin 3 on the basic stamp (the ATN pin).

so, i built that and still can't seem to get the chip to identify in the basic stamp editor. i'm going to load up eagle and put the schematic together and post it to see if anyone can see what's wrong.

-b

Chris Savage
03-11-2007, 08:26 AM
A schematic diagram (portion) that will do what you need is shown on our USB-BOE page. That schematic uses the FTDI chip to connect to a BASIC Stamp.

http://www.parallax.com/detail.asp?product_id=28850

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support

bryan costanich
03-11-2007, 09:05 AM
Ok, i took a look at the schematic, and i have some more questions. doesn't look like the schematic is complete, but there are a couple things on there. first, pin 4 of the BS2 (ATN) has "ATN" coming in, but the schematic is missing a reference to where it's coming from. also, on pin 24 of your unnamed chip on the left (i assume it's the FTDI chip) has USB TXD, USB RXD, and USB DTR all on the same pin. is that supposed to be 3 different pins?

I've attached the schematic of how i've got mine currently setup based on the conversations that we've had. i've got pin 4 of the bs2 (ATN) connected to pin2 of the UM232R (DTR) with the capacitors as specified. Is this incorrect?

Chris Savage
03-11-2007, 10:07 AM
Bryan, in the circuit on that page the chip is labeled FT232BM (This is the older model chip). You don't have the transistors in your schematic...It doesn't look like it will work the way you have it since the RX/TX lines will be inverted and the DTR line won't properly activate the reset circuit.

http://www.parallax.com/dl/docs/prod/boards/BoeUSBrevB.pdf

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support

bryan costanich
03-11-2007, 10:09 AM
Gotcha. i'm looking at the BOE schematic again, for some reason, when i printed it, half of the stuff dropped out, so i dind't see any of the transistors etc. must have been a weird PDF issue.

thanks for your help.

-b

Unsoundcode
03-11-2007, 10:14 AM
Hi bryan, this is the schematic I found under Chris's link, http://www.parallax.com/dl/docs/prod/boards/BoeUSBrevB.pdf
the chip is marked on the print as a F232BM I assume yours is F232R. Looks like you have the same pins though with different pin numbers. On the Parallax print TXD TXR and DTR come off pins 25 24 21 respectively and ATN comes off the collector of Q1.

Jeff T.

bryan costanich
03-11-2007, 10:32 AM
got it. does this look right now?

gotta go to radioshack to get some pnp transistors before i can test it.

Chris Savage
03-11-2007, 10:43 PM
Bryan, you still don't have the transistors on the RX/TX lines and you have an extra capacitor on the DTR line.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support

Rick Brooks
03-12-2007, 12:17 AM
This thread talks about inverting the TXD, RXD, and DTR with transistors. Could the same results be obtained by reprogramming the FT232R to invert TXD, RXD, and DTR?

Rick Brooks

bryan costanich
03-12-2007, 02:43 AM
Chris, your schematic shows two capacitors on the DTR to ATN line. there's one in the DTR to ATN callout, and then one down ont the schematic of the BS2 hookup.

I'll add the 5v amplification/deamplification circuits tot eh TXD and RXD lines today. i was under the impression that it wasn't needed for the USB module i have, but i think they just omitted it from their schematics.

Rick, why would you want to invert TXD and RXD? one device's transmit is another's reception, no?

Chris Savage
03-12-2007, 03:16 AM
Bryan,

You are correct…I forgot this version (Rev B) had the extra capacitor…But the transistors aren’t just drivers…They invert the signal…The Stamp Module is looking for an inverted signal so without those transistors you would have to reprogram the EEPROM on the FTDI chip to invert these lines for you.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support

bryan costanich
03-12-2007, 03:48 AM
oh shyte, i didn't know that. (about the inversion).

hmm...

what's the extra capacitor for?

if i program the ftdi chip to invert the lines, do i still need to build transistor circuits for the 5v amp/deamp?

bryan costanich
03-12-2007, 06:41 AM
all right. 3rd time's a charm?

by the way, thanks everyone for your help. i'm a software guy, so this has been a fun challenge for me.

i think i even understand what i've designed here. :) hahahhaha.

Chris Savage
03-12-2007, 10:20 PM
Bryan, of course I recommend testing any design before committing it to PCB. Let us know how it works out. Take care.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support

bryan costanich
03-13-2007, 03:35 AM
yeah, i always do. :)

bryan costanich
03-13-2007, 07:55 AM
yay, it worked!

attached is a photo of it.

by the way, is there a repository someplace to put schematics and such related to the basic stamp someplace? this is a working BS2 to UM232R design, so if someone else is thinking of doing that, then this schematic can serve them.

-b

Jamie_McIntyre
03-14-2007, 05:30 AM
Hi everybody,

joining late in this discussion, - I have just read everything to get caught up.

My situation is similar to Bryan (except for the working part, of course). I am using the 232R, trying to communicate directly to a 2p40 IC (just the interpreter, not the stamp module). I can't get a response from the interpreter.

I am trying to follow a schematic from one of Chris's earlier posts (OEM BS2.zip). I can see the low pulse come in on the RESET and RX lines on the interpreter - but no action.

Any hints, suggestions.

thanks in Advance
Jamie