|
Home > Archive > Electrical Engineering > November 2006 > how to do it? RS232
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
how to do it? RS232
|
|
|
| Please anybody can give me a brief idea that using oscilloscope how i
can capture the waveform on a serial link, tranmitting the ASCII letter
'R' with 1 start bit, 1 end bit, 1 parity, with 1200 Baud.?
I have connected oscilloscope with serial interface then? then selected
the CH1 & CH2 then changed some setting on oscilloscope for RS232 , the
wt to do?
waiting for ur reply?
regards
| |
| John Popelish 2006-11-18, 1:25 pm |
| RsK wrote:
> Please anybody can give me a brief idea that using oscilloscope how i
> can capture the waveform on a serial link, tranmitting the ASCII letter
> 'R' with 1 start bit, 1 end bit, 1 parity, with 1200 Baud.?
>
> I have connected oscilloscope with serial interface then? then selected
> the CH1 & CH2 then changed some setting on oscilloscope for RS232 , the
> wt to do?
>
> waiting for ur reply?
You need a terminal emulator program to capture the
character stream into a file (that you name). Depending on
what file format you set the scope to use to format the
image, you use an image viewer to look at the resulting
file. The details are dependent on the scope model and the
terminal emulator program you have.
| |
| Jerry Avins 2006-11-18, 1:25 pm |
| John Popelish wrote:
> RsK wrote:
>
> You need a terminal emulator program to capture the character stream
> into a file (that you name). Depending on what file format you set the
> scope to use to format the image, you use an image viewer to look at the
> resulting file. The details are dependent on the scope model and the
> terminal emulator program you have.
Does the OP want to see the letter, or the waveform? The ASCII letter R
in hexadecimal is 52. RS-232 standard levels are +/- 12 volts, with
"mark" = +12 and "space" = -12. The line protocol is "mark idle", which
means that a quiet line is +12. ASCII characters begin with a start bit
(space), followed by 7 or 8 or 9 data bits (including parity if any),
and one, 1.5, or two stop bits. The usual is 8 data bits and one stop
bit. Hex 52 = 0101 0010, which in RS-232 becomes +-+-++-+. When framed
with start and stop bits, the sequence becomes -+-+-++-++. I generally
use letter U (hex 55) for testing. It's sequence is -+-+-+-+-+.
Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
| |
| Jan Panteltje 2006-11-18, 1:25 pm |
| On a sunny day (18 Nov 2006 07:26:52 -0800) it happened "RsK"
<rizkhan7@gmail.com> wrote in
<1163863612.012437.59900@e3g2000cwe.googlegroups.com>:
>Please anybody can give me a brief idea that using oscilloscope how i
>can capture the waveform on a serial link, tranmitting the ASCII letter
>'R' with 1 start bit, 1 end bit, 1 parity, with 1200 Baud.?
>
>I have connected oscilloscope with serial interface then? then selected
>the CH1 & CH2 then changed some setting on oscilloscope for RS232 , the
>wt to do?
>
>waiting for ur reply?
OK
>regards
really
As was pointed out you need some terminal program to send the 'R' repeatedly.
When you connect the scope to the serial out RS232 line, the following applies:
1200 Baud is 1200 bits / second, so the time for one bit is about 830 uS.
If you have the terminal program and press 'R' with short intervals, and
trigger the scope on the start bit (pos or negative depends on where you
measure), and set the trace so one division is exactly 1/1200 sec (830us),
then you should be able to see a full character plus start and parity bit
(10 bits in your case = 10 divisions), on the scope.
Works both with a normal and with a storage scope, analog or digital.
If the picture is faint (dim) use auto-repeat..... stick a match in the 'R' key
to hold it down.
Now what you will see is one start bit, the ASCII code for 'R', and a parity bit.
the ASCII code for 'R' is 52 hex, or in binary, with MSB first:
0101 0010
The start bit added
0 0 1 0 1 0 0 1 0
Parity added (you do not say odd or even):
0 0 1 0 1 0 0 1 0 x
The stop bit added:
0 0 1 0 1 0 0 1 0 x 1
^
scope trigger point
This is what the scope will display.
On the scope you will not see the last '1' if 10 divisions and 1 bit per division, no problem,
that bit is always the same.
| |
|
| In article <1163863612.012437.59900@e3g2000cwe.googlegroups.com>,
rizkhan7@gmail.com says...
> Please anybody can give me a brief idea that using oscilloscope how i
> can capture the waveform on a serial link, tranmitting the ASCII letter
> 'R' with 1 start bit, 1 end bit, 1 parity, with 1200 Baud.?
>
> I have connected oscilloscope with serial interface then? then selected
> the CH1 & CH2 then changed some setting on oscilloscope for RS232 , the
> wt to do?
- Connect CH1 to TXD
- Select CH1
- Select CH1 as the trigger source
- Select trigger slope = negative
- Vertical amplifier = 1 to 5V/div, depending on the situation
- Time base = 1msec/div
You should see the initial positive to negative transition with the
signal low for the start bit. The rest of the bits should follow
at 833usec (a little less than a division) intervals. The ten bits
should almost fill up the display (8.3 divisions). If the
characters are being sent one after another the display may be a
bit unstable. Depending on the scope, playing with the trigger
holdoff may help.
--
Keith
| |
|
|
RsK wrote:
> Please anybody can give me a brief idea that using oscilloscope how i
> can capture the waveform on a serial link, tranmitting the ASCII letter
> 'R' with 1 start bit, 1 end bit, 1 parity, with 1200 Baud.?
>
> I have connected oscilloscope with serial interface then? then selected
> the CH1 & CH2 then changed some setting on oscilloscope for RS232 , the
> wt to do?
>
> waiting for ur reply?
>
> regards
Hi, RsK. You might want to consider using a "U" (0x55), because each
bit changes (01010101).
Set your timing so you send the character every 50ms. or so, then put
your scope on RxD and set your scope for auto trigger, 5V/div, 5ms/div.
Tweak your PGT trigger level to +3V, and you should be good to go
Are you having trouble setting the scope, your terminal program
settings, or what?
Cheers
Chris
| |
| Palindrâğme 2006-11-18, 1:25 pm |
| John Popelish wrote:
> RsK wrote:
>
>
>
<piggyback> Sorry, didn't get the OP.
http://www.picotech.com/experiments...ta/results.html
A letter R in ASCII is 01010010 in binary. (8 bit - leave off the
leading zero for 7 bit)
Reversing that to put the least significant bit first, this is 01001010
- this is the order in which the bits will be sent down the line.
At 1200 Baud, there will be a maximum of 1200 transitions in voltage
level a second.
Initially, the scope will show a steady input of -12v.
The first transition will be the beginning of the start bit, which will
take the input to +12v.
~0.8mSec later the least significant bit of the character is sent, as
this is a 0, the input will go to -12v.
~0.8mSec later, the next least significant bit will be sent - this time
a 1, so the input will rise to +12v.
The other bits will then be sent, at the same spacing. The parity bit,
assuming even parity, will be sent as a 1. Then the end bit will be sent
-this is just a period at -12v to ensure that the next start bit can be
recognised.
--
Sue
| |
|
| Jerry Avins wrote:
> John Popelish wrote:
>
> Does the OP want to see the letter, or the waveform? The ASCII letter R
> in hexadecimal is 52. RS-232 standard levels are +/- 12 volts, with
> "mark" = +12 and "space" = -12. The line protocol is "mark idle", which
> means that a quiet line is +12. ASCII characters begin with a start bit
> (space), followed by 7 or 8 or 9 data bits (including parity if any),
> and one, 1.5, or two stop bits. The usual is 8 data bits and one stop
> bit. Hex 52 = 0101 0010, which in RS-232 becomes +-+-++-+. When framed
> with start and stop bits, the sequence becomes -+-+-++-++. I generally
> use letter U (hex 55) for testing. It's sequence is -+-+-+-+-+.
>
> Jerry
Minor correction; a marking line is -3 <> -15V (logical 1) 
Cheers
PeteS
| |
| Jerry Avins 2006-11-18, 1:25 pm |
| PeteS wrote:
...
> Minor correction; a marking line is -3 <> -15V (logical 1) 
Of course. Sometimes my head gets stuffed with current loop facts.
Thanks.
Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
| |
|
| RsK wrote:
> Please anybody can give me a brief idea that using oscilloscope how i
> can capture the waveform on a serial link, tranmitting the ASCII letter
> 'R' with 1 start bit, 1 end bit, 1 parity, with 1200 Baud.?
>
> I have connected oscilloscope with serial interface then? then selected
> the CH1 & CH2 then changed some setting on oscilloscope for RS232 , the
> wt to do?
>
> waiting for ur reply?
>
> regards
>
To assist in your reading the replies here, I posted a PDF of a
simulated scope trace of the letter 'R' (assuming it to be the only
transmission) on RS232.
Cheers
PeteS
| |
|
| PeteS wrote:
> RsK wrote:
>
> To assist in your reading the replies here, I posted a PDF of a
> simulated scope trace of the letter 'R' (assuming it to be the only
> transmission) on RS232.
>
> Cheers
>
> PeteS
Helps if I identify where, of course
On a.b.s.e.
Cheers
PeteS
| |
| Jan Panteltje 2006-11-18, 1:25 pm |
| On a sunny day (18 Nov 2006 07:26:52 -0800) it happened "RsK"
<rizkhan7@gmail.com> wrote in
<1163863612.012437.59900@e3g2000cwe.googlegroups.com>:
Now what you will see is one start bit, the ASCII code for 'R', and a parity bit.
the ASCII code for 'R' is 52 hex, or in binary, with MSB first:
0101 0010
Correction, seems it is transmitted LSB first:
see
http://www.acumeninstruments.com/Su...index_pg6.shtml
| |
|
| On 2006-11-18, Jerry Avins <jya@ieee.org> wrote:
> John Popelish wrote:
>
> Does the OP want to see the letter, or the waveform? The ASCII letter R
> in hexadecimal is 52. RS-232 standard levels are +/- 12 volts, with
> "mark" = +12 and "space" = -12.
T'other way round. mark is negative.
--
Bye.
Jasen
| |
| Jerry Avins 2006-11-18, 8:25 pm |
| jasen wrote:
> On 2006-11-18, Jerry Avins <jya@ieee.org> wrote:
>
> T'other way round. mark is negative.
Yes. Sorry. Sometimes the TTL version sticks in my head. It's been a
long time.
Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
| |
| Jerry Avins 2006-11-18, 8:25 pm |
| Jerry Avins wrote:
From provate email. because I don't see it here:
Patrick Klos wrote:
> To: jya@ieee.org
> Subject: Re: how to do it? RS232
> Newsgroups:
comp.robotics.misc,sci.engr.control,sci.electronics.basics,alt.engineering.electrical,sci.electronics.design
> In-Reply-To: <f8udnWF5wKqDpMLYnZ2dnUVZ_tCdnZ2d@rcn.net>
> References: <1163863612.012437.59900@e3g2000cwe.googlegroups.com>
<hqGdnSs2ZtLdtcLYnZ2dnUVZ_s2dnZ2d@adelphia.com>
<pJ6dnYD4NK_ns8LYnZ2dnUVZ_q-dnZ2d@rcn.net>
<9NG7h.10349$Fv1.4670@newsfe2-win.ntli.net>
> Organization: Klos Technologies, Inc.
> Cc:
>
> In article <f8udnWF5wKqDpMLYnZ2dnUVZ_tCdnZ2d@rcn.net> you write:
>
> Correct me if I'm wrong, but I'm pretty sure the serial bits are
> transmitted LSB first? Your picture gave the impression that MSB
> is sent first. Am I remembering that correctly?
>
> Patrick
> =========== For PPP Protocol Analysis, check out PacketView Pro!
===========
> Patrick Klos Email: patrick@klos.com
> Klos Technologies, Inc. Web: http://www.klos.com/
>
============================================================================
Patrick,
These followups belong in the newsgroup with the rest of the thread. The
most significant bit is sent first and appears on the left of the scope
trace. http://francis.courtois.free.fr/jc1...RawSignals.html
might be helpful
--
A quitter never wins. A winner never quits. A fool never does either.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
| |
|
| On 2006-11-18, RsK <rizkhan7@gmail.com> wrote:
> Please anybody can give me a brief idea that using oscilloscope how i
> can capture the waveform on a serial link, tranmitting the ASCII letter
> 'R' with 1 start bit, 1 end bit, 1 parity, with 1200 Baud.?
>
> I have connected oscilloscope with serial interface then? then selected
> the CH1 & CH2 then changed some setting on oscilloscope for RS232 , the
> wt to do?
assuming you're using 7 data bits even parity and one stop bit
(which is a fairly common line protocol)
idle line is negative , then 7 data bits (1 is negative 0 is positive)
then the stop parity and then the stop bit.
start 0
data (lsb first) 0100101
parity 1
stop 1
set you scope for positive triggering, and about 2ms/division scan rate
and 5V/division vertical gain (assuming a "X10" probe)
connect it to pin 3 of the 9-pin serial port, pin 5 is your ground.
you'll get something like this.
(view with fixed font)
S D0 D1 D2 D3 D4 D5 D6 P S
-------- -------- ----
---- ---- -------------...
|
after the stop bit the voltage will stay low until
the start bit of the next symbol...
if your terminal program has such a feature you can program one of the
function keys to send RRR and then wedge it down
which will give a brighter trace and also show the start bit coming
right after the stop bit.
with the keyboar repeat at about 16 per second (fairly normal) you'll see
some idle time and
some start bit immediatley after the stop bit.
Bye.
Jasen
| |
|
| RsK wrote:
> Please anybody can give me a brief idea that using oscilloscope how i
> can capture the waveform on a serial link, tranmitting the ASCII letter
> 'R' with 1 start bit, 1 end bit, 1 parity, with 1200 Baud.?
Your can see the waveform for any serial data with this program:
http://www.miscel.dk/MiscEl/miscelS...munication.html
If your want to capture it live on an oscilloscope your need a scope
with storage (a PC based digital scope is fine) or your must send the
data repeatedly.
| |
| john jardine 2006-11-19, 1:25 pm |
|
"HKJ" <henrik.k.jensen@miscel.dk> wrote in message
news:45601883$0$182$157c6196@dreader1.cybercity.dk...
[...]
>
> Your can see the waveform for any serial data with this program:
>
> http://www.miscel.dk/MiscEl/miscelS...munication.html
>
Nice idea you have there, hope you stick with it.
Use it when I'm just too bone idle to pick up the calculator.
The "Attenuators" section (nice!). Any chance of offering say 3 digits of
resistor precision in addition to the E12 rounding?. Or maybe offer an
E12/E24/E96 rounding option?.
john
--
Posted via a free Usenet account from http://www.teranews.com
| |
| john jardine 2006-11-19, 1:25 pm |
|
"john jardine" <john@jjdesigns.fsnet.co.uk> wrote in message
news:45607fc7$0$21121$88260bb3@free.teranews.com...
>
> "HKJ" <henrik.k.jensen@miscel.dk> wrote in message
> news:45601883$0$182$157c6196@dreader1.cybercity.dk...
> [...]
[...][color=darkred]
> The "Attenuators" section (nice!). Any chance of offering say 3 digits of
> resistor precision in addition to the E12 rounding?. Or maybe offer an
> E12/E24/E96 rounding option?.
Ignore that. Just spotted all the rounding options 
--
Posted via a free Usenet account from http://www.teranews.com
| |
|
| john jardine wrote:
> "HKJ" <henrik.k.jensen@miscel.dk> wrote in message
> news:45601883$0$182$157c6196@dreader1.cybercity.dk...
> [...]
> Nice idea you have there,
Thanks,
> hope you stick with it.
I plan to.
> Use it when I'm just too bone idle to pick up the calculator.
> The "Attenuators" section (nice!). Any chance of offering say 3 digits of
> resistor precision in addition to the E12 rounding?. Or maybe offer an
> E12/E24/E96 rounding option?.
It is already there, use the "System, Preferede component" page to
select it.
http://www.miscel.dk/MiscEl/miscelP...Components.html
In the System menu your also have a search function, that can be used to
locate the correct page to do something. Write E96 in it at it will tell
your to look at the "Prefered component" page.
| |
| john jardine 2006-11-19, 8:25 pm |
|
"HKJ" <henrik.k.jensen@miscel.dk> wrote in message
news:456094a2$0$183$157c6196@dreader1.cybercity.dk...
[...]
>
> It is already there, use the "System, Preferede component" page to
> select it.
> http://www.miscel.dk/MiscEl/miscelP...Components.html
>
> In the System menu your also have a search function, that can be used to
> locate the correct page to do something. Write E96 in it at it will tell
> your to look at the "Prefered component" page.
Thanks. Spotted it just after posting. Looks like my "ignore previous post"
post, went to that big bit bucket in the sky.
john
--
Posted via a free Usenet account from http://www.teranews.com
| |
| Rich Grise 2006-11-20, 8:25 pm |
| On Sat, 18 Nov 2006 21:08:41 -0500, Jerry Avins wrote:
> Jerry Avins wrote:
>
> From provate email. because I don't see it here:
>
> Patrick Klos wrote:
> comp.robotics.misc,sci.engr.control,sci.electronics.basics,alt.engineering.electrical,sci.electronics.design
> <hqGdnSs2ZtLdtcLYnZ2dnUVZ_s2dnZ2d@adelphia.com>
> <pJ6dnYD4NK_ns8LYnZ2dnUVZ_q-dnZ2d@rcn.net>
> <9NG7h.10349$Fv1.4670@newsfe2-win.ntli.net>
> ===========
> ============================================================================
>
> Patrick,
>
> These followups belong in the newsgroup with the rest of the thread. The
> most significant bit is sent first and appears on the left of the scope
> trace. http://francis.courtois.free.fr/jc1...RawSignals.html
> might be helpful
Oddly, the spec specifically says that it doesn't care what the bit order
is, or parity, or even bit rate.
So, I'd pick a handy UART, and see which way they do it. ISTR always
hearing "low bit first", but according to the spec, it's the user's
call.
Cheers!
RIch
| |
| Jerry Avins 2006-11-21, 3:25 am |
| Rich Grise wrote:
> On Sat, 18 Nov 2006 21:08:41 -0500, Jerry Avins wrote:
>
>
> Oddly, the spec specifically says that it doesn't care what the bit order
> is, or parity, or even bit rate.
>
> So, I'd pick a handy UART, and see which way they do it. ISTR always
> hearing "low bit first", but according to the spec, it's the user's
> call.
The spec doesn't call out a particular connector, either. It must have
25 pins, though, of either sex. RS-232C and later specify a slightly
positive threshold and voltage limits that allow TTL to just meet spec
for short quiet lines. The receiver must withstand at least +/-15 volts.
There is (was?) no rise-time spec. All that is convention.
Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
|
|
|
|
|