ARRRRGH. A request for prehead-through-wall help with serial communications
BigWaveDave
Posts: 3
Alright, I give.· The darn thing has me beat.· I've got a board set up to send out a simple little serial communication using the simplest of serial commands using the default serial pin.· I get exactly the response I need with the debug screen, but connect it to my PC com port and hyperterminal or the target device and I get nothing.· Connect the target device directly to the computer and they talk.· Anyone have any·suggestions why the debug screen would show communication but hyperterminal would not?
Stamp = BS2, baud = 19.2k Hyperterminal on Com1, TTY 19.2k
'program starts here
SerialOutPin CON 16
Baud CON 32
'activeButton a byte number 0 - 7 defined by the button command
SEROUT SerialOutPin, Baud, [noparse][[/noparse]"play00",DEC activeButton, CR]
Stamp = BS2, baud = 19.2k Hyperterminal on Com1, TTY 19.2k
'program starts here
SerialOutPin CON 16
Baud CON 32
'activeButton a byte number 0 - 7 defined by the button command
SEROUT SerialOutPin, Baud, [noparse][[/noparse]"play00",DEC activeButton, CR]
Comments
I use a product called RS232 Hex Com Tool and it works perfectly for me. Sends exactly what I tell it to, no more no less. You can download a fully functional trial here: www.download.com/RS232-Hex-Com-Tool/3000-2383_4-10064973.html
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Roger Pierson
Senior Electronics Technicain
DTI Assoicates
Jeff T.
I have a similar issue - and I thought someone had mentioned a FREE terminal program that works/behaves just like the Debug (i.e. responds to the same screen commands). Unfortunately, I have not been able to find this program.
Does anyone know where to find such an emulator?
However, many Hyperterminal/computer combinations require a jumper on pins CTS-RTS at the computer end to let the computer know it should be listening.
I use Hyperterminal in real-time data logging systems, which with the file capture feature gives a simple, cheap logger that is available on nearly every laptop and desk box. It also works well in 132 char wide format.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
Tom,
Thanks for the response.
I would love to be able to use Hyperterminal in this application because it's free and there! My problem is the fact that the screen formatting doesn't work the same as the DEBUG screen. For example, one of the routines for setting default parameters uses DCA - but in Hyperterminal, it's just a stream of data - looks terrible! SO, I am looking for something [noparse][[/noparse]free] that will correctly respond to the DEBUG commands.
Paul
Hyperterminal will talk to my target device, a Brookshire RAPU with or without the jumper
Hyperterminal will not talk to my basic stamp with or without the CTS/RTS jumper (pins 7 and 8 which I understand are the two center ones on the four pin side)
RS232 program will talk to my basic stamp
RS232 will not talk to my Brookshire RAPU
The stamp editor Debug window will talk to both
They will not talk to each other
All items/programs are set up with the same baud, parity, etc and have been checked (as much as is possible) at different speeds. I am, in the end, limited to 19.2k because of RAPU requirements.
What magic (read background format/processing) do Debug or hyperterminal do to do what they do?
Is this something stupid like a null modem cable or a combination of null modem and jumpering CTS/RTS that debug automatically takes care of?
1. The PC is a "DTE" device (Data Terminal Equipment). This means it 'talks' on the TX pin, and 'listens' on the RX pin.
2. The BS2 board is a "DCE" device (Data Communication Equipment). This means it 'listens' on the TX pin, and 'talks' on the RX pin (it assumes there's going to be a DTE device on the other end, you see).
3. The BS2 uses the "DTR" pin as a 'reset' pin for the BS2. There are a couple of capacitors to 'decouple' this signal (like when Hyperterm holds DTR 'active') so that you only get one reset when DTR is pulled high (Active).
4. The BS2 only 'listens' when it's actually in a SERIN instruction. Thus it can easily lose data if you don't program for this.
5. If you've left out the two capacitors on the DTR line, then Hyperterminal will hold the BS2 in 'reset', and your program won't run. Most other serial devices don't care about the DTR line.
6. If you try to connect two DCE devices together, then yes, you'll need a "null modem" cable, who's purpose in life is to swap TX to RX, RX to TX, and the handshake signals.
7. However, the BS2's programming port uses the "TX" signal coming in to power the "RX" signal going out. This means the hardware echo's everything sent to it. Hopefully you can program around this. If not, you can add a MAX232 chip to the BS2 to get true RS-232 levels on some other I/O pins (ie NOT the programming port).
8. Oh, yes, and the DEBUG terminal KNOWS about the DTR line, and will only 'blip' it to reset the BS2 when you connect. This is one big difference between Hyperterminal and the DEBUG window.
Alright - I slimmed down the cable to three lines to take care of the DTR line and everybody will talk to Hyperterminal now. Since the computer will talk to either unit I figure they are both DCE devices and have a null modemish cable that runs TX to RX and vice versa, but still can't seem to get the two units to talk. I'm generally sending from the stamp to the other unit so the receive on the stamp isn't used much so the echo shouldn't be a problem.
Does the programming port do a full RS-232 emulation (with positive and negative voltage)? I'm hoping to avoid the MAX32 and reprogram around another pin.
Thanks
And no, the programming port doesn't talk "real" RS-232. It uses the negative 'idle' voltage coming in the TX line, and 'bounces' that to +5 volts when it wants to send a bit. But this is usually a pretty good RS-232 voltage emulation.
Note several people make $10 or so small adapter boards which hold a MAX232 and the needed capacitors -- check out KronosRobotics for one.
You probably want to use an "Inverted" baud mode on the programming port. In any event, it sounds like you're really close to getting this to work.
Jeff T.
Having said that, since the MAX233 chip does meet the RS-232 specification, and signals at +-10 volt levels, probably you will get better results if you want faster data or longer distances with it.
But as I say, most people would not benefit from this.
Using a bs2p and the SPSTR function is the most efficient way to receive data in packets,
Cheers,
Chris
You know, I battled with RS232 comms until I made a cable with a breakout board. This breakout board enables me to quickly make up any configuration of the 9 pin cable. I just plug jumpers between the appropriate pins.
Recipe for RS232 Breakout cable:
1. Take a 16 pin IC holder and solder it onto a piece of Vero Board (punchboard whatever)
2. Solder pins 2 to 9 of a female D9F connector and cable to the left pins 1 to 8
3. and solder pins 2 to 9 of a male D9M connector to the right pins 16 to 9 of the IC holder
The Vero board, mustard and tomato sauce are optional, you can use wire wrap if you prefer.
I didn't bother with pin 1 because it is seldom used
You can now use jumper on your RS232 the same way you do with a protoboard. For example, you need a simple cross-over cable. You put a jumper from IC holder socket 1 to socket 15, this links pin 2F to pin 3M. You put another from socket 2 to socket 16 and this links pin 3F to pin 2M. You put a third from socket 4 to socket 13 to connect Ground Pins 5F and 5M. You place a final jumper between socket 6 and socket 7 to bridge out F7 to F8 at the computer and thus connect CTS to RTS. Oh sh@# it's not a crossover, no problem, just move the two jumpers. Now you find CTS/RTS are not needed, remove the jumper.
I've soldered another cable on IC holder pins 16 to 9 with a female D9F because I've needed to connect two DTE's (computers) together. This cable lives in my junk box but it gets used surprisingly often. I have also made a number of them for my friends.
Another tip. As you know, the pin that transmits the data (in normal mode) is high when idle. Is the device a DTE or a DCE? You can find out by using a multimeter. Just disconnect the cable and check the voltage between pins 2 and 5 (ground) and again between pins 3 and 5. When you get a reading approaching 12 volts, you’ve found the pin that transmits the data.
If all else fails, I find Aspirin helps with the headache.
Kind Regards from Darkest Africa. Ever wondered why it is called Darkest Africa. Well, a typical example is our Electricity Supply Commission forgot to build power stations when the new government came to power. Their solution, they’ll just turn off electricity supply to large areas of the country during periods of peak demand, between 6pm and 8:30 pm each evening…. Hey, that almost beats South Africa Minister of Health’s claim that eating Garlic and Beetroot cures Aids!!!
John Bond
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jeff T.