Effacer les filtres
Effacer les filtres

Send and receive analog signal in Serial port

2 vues (au cours des 30 derniers jours)
Majid kh
Majid kh le 2 Fév 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?

Réponse acceptée

Walter Roberson
Walter Roberson le 2 Fév 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.

Plus de réponses (0)

Catégories

En savoir plus sur Analog Input and Output dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by