6/17/2018

Simple Serial Interface

94
Simple Serial Interface Average ratng: 8,4/10 2627votes
Serial Communication Protocols

The Theory Understanding the theory of RS232 serial communication, means looking down deep into the actual signals being transmitted. I hooked up an oscilloscope to capture two characters being transmitted, 1 and 5. A standard single transmission of RS232 serial communication will contain a start bit, 8 bits of information and a stop bit. Since there's only 8 bits of information, a system was invented called ASCII which is short for ~>The American Standard Code for Information Interchange. The table seen above encodes every bit of information necessary for transferring standard english communication, grammar and formatting. Specifically we are interested in the encoding for numbers '1' and '5'.

Find Drivers Through Hardware Id Acpi here. Example #1: Sending '5' via RS232 Serial Communication When you want to send the character '5' over serial communcation, each bit of that encoded character is sent one at a time, starting with the 'least significant bit' up to the 'most significant bit'. The picture above illustrates this process: • [1] Send Start Bit (+5v ~>+0v) • [2] Send 8 bit encoded character, LSB first • [3] Send Stop Bit (+0v) • [4] Finished Transmission (+0v ~>+5v) Example #2: Sending '1' via RS232 Serial Communication When you want to send the character '1' over serial communcation, each bit of that encoded character is sent one at a time, starting with the 'least significant bit' up to the 'most significant bit'. The picture above illustrates this process: • [1] Send Start Bit (+5v ~>+0v) • [2] Send 8 bit encoded character, LSB first • [3] Send Stop Bit (+0v) • [4] Finished Transmission (+0v ~>+5v) It is important to understand at this level what is happening, that way if the Serial port on the receiver (PIC) or the sender (Laptop) is not working properly, we know what exactly should be happening at the lowest level.

Ideally, we should never have to debug at this low of a level, but sometimes things just go wrong and we have to.

Hi New day = >new problem I try to put a flow of byte in a buffer using the simple serial interface and the max3430 for rs-485 It works when i send $AAFF13 or $AA13 But if i send more than 3 bytes it doesn't works. VAR LONG Chan Byte Range Byte Bip Byte MyStr[noparse][[/noparse]1024] the way i receive ptr:=0 repeat while (MyStr[noparse][[/noparse]ptr]:=ser2.rx)$13 ptr++ the way i send ptr2:=0 repeat ptr+1 ser2.tx(MyStr[noparse][[/noparse]ptr2]) ptr2++ Thanks for your help. Laurent Post Edited (Laurent R): 4/3/2009 7:55:21 AM GMT. Thanks Andy and Peter but it seems that your answers doesn't work for me. I don't undersdand my problem because if i try to look after the CR caracter, it works for 3 Bytes transmission not more ptr:=0 repeat while (MyStr[noparse][[/noparse]ptr]:=ser2.rx)$13 ptr++ But if I try this MyStr[noparse][[/noparse]0]:=ser2. Cichowicz Trumpet Flow Studies Pdf To Jpg there. rx MyStr:=ser2.rx MyStr:=ser2.rx MyStr:=ser2.rx MyStr:=ser2.rx MyStr:=ser2.rx the prop wait that I send 5 caracter and send me back so I know that he has received a CR caracter. Post Edited (Laurent R): 4/1/2009 9:16:11 AM GMT.

Hello Laurent, restart the serial communication that's shooting with canons on little birds question: how many bytes are you receiving as ONE STRING as a maximum? I assumed from your original code MyStr[noparse][[/noparse]1024] that you receive up to 1024 bytes as ONE STRING if your string-length is below 16 you can use the standard-objects ANYWAY: did you watch your incoming strings with a terminalsoftware? Did you check with a terminalsoftware that your sending device is sending SINGLE commands? I have attached an archive with democode that works with PST.EXE as well as with brays terminal using serial-mirror for receiving the string on Rx-Pin 26 and Tx-Pin 25 and send it to Rx-Pin 31, Tx-Pin 30 if you want to attach code use the archive-function of the propellertool select your top-object-file (here main-test.spin) and then cklick file - archive - project. This creates a ZIP-file that contains ALL files needed to compile the whole project best regards Stefan. Hi together, i'm pretty new in the business with Propeller and Programming in general, but i created a little program in Spin, which creates several lines and shows it on my screen, it works really good.

ezbio – 2018