Send and receive analog signal in Serial port
1 view (last 30 days)
Show older comments
Majid kh
on 2 Feb 2019
Answered: Walter Roberson
on 2 Feb 2019
Hi there, I can produce sine signal and send it to sound card or receive signal by microphone and see it on MATLAB, is there any way that i can do it for serial port?
0 Comments
Accepted Answer
Walter Roberson
on 2 Feb 2019
No, not unless the data was low rate binary and you were willing to encode it by asserting or retracting DSR or DTR, as those can be detected. This assumes that you are using a true serial port and not USB emulating serial: those only transmit one DSR and DTR state per packet rather than each time the pins change.
Although voltages can vary for RS232 / RS422 / TTL transmit pins, serial drivers have no way of seeing those voltages, and can only get at the decoded pulse trains of start bit, 7 or more data bits, and then stop bit.
Now, if you had a sensor device such as an arduino that was reading the sine wave for you, and transferring a representation of it as data over RS232 / RS422 / TTL pins or USB, then that would be a different situation.
For the purpose of reading raw analog without a specific data acquisition device, you would have more success in connecting to microphone and examining the audio inputs. A microphone input is a form of analog to digital convertor.
0 Comments
More Answers (0)
See Also
Categories
Find more on Analog Input and Output in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!