Serial data capture question

JSDL

Senior Member
Hi all, just learning to use a scope and I created a simulation with Picaxe VSM to decode serial data. I have created a simple program using "serout" to send the letter "Q" out pin C.1 on a Picaxe 08M2 in a continuous loop, then captured the data on a virtual scope. I have attached a screenshot of the scope showing the byte, but it doesn't appear to me what it should look like. The letter Q in binary is 01010001, so I would expect to see:

LOW->Start Bit
LOW
HIGH
LOW
HIGH
LOW
LOW
LOW
HIGH
HIGH -> Stop Bit

Does VSM show TTL serial signals or RS-232 level, in other words is a binary 1 represented by a high or low in VSM? Also, am I correct in that the LSB comes immediately after the start bit, if so then am I looking at the byte backwards?

Please correct me if I am missing something. Thanks in advance.

scope.jpg

Code:
main:

pause 1000
serout c.1, n4800,("Q")
goto main
 

inglewoodpete

Senior Member
The data you are looking at is correct. The people who invented ASCII serial transmission never realised the confusion they had created. I still struggle with ASCII serial data 40 years after my first microprocessor project!

The data is sent LSBit first and in your case, inverted. So, if you stand on your head and look at the oscilloscope image in a mirror it all makes sense.

The oscilloscope shows 1(Start), 0111 0101, 0(End). First, invert the polarity: 1000 1010; next reverse the data: 0101 0001 = $51 = ASCII 'Q'

Magic :)
 
Last edited:

JSDL

Senior Member
thanks for the great explanation, I get it now! One last question, when sending multiple characters via serial comms and capturing the data, how can you determine where the start and stop bits occur? For example, here I sent the string "AB" (using TRUE, non-inverted polarity) and this is what I got:

Code:
main:

pause 1000
serout c.1, t4800,("AB")

goto main
scope.jpg
 

hippy

Technical Support
Staff member
One last question, when sending multiple characters via serial comms and capturing the data, how can you determine where the start and stop bits occur?
One can look at the smallest bit pulse and then, knowing how many bits per character, work out how long each character lasts to figure out where one ends and the next starts. It's not always easy with some data, but gets easier with practice and experience.

Some logic analysers and scopes may be able to decode and display what the characters are, indicate where they start and end.

There are also other tools which can be used instead or as well as. It's rare to need to look at a lot of characters on a scope or logic analyser. Once one is happy that things are right for one character, a Virtual Terminal can be used to show what the characters are.
 
Top