Send and receive analog signal in Serial port

8 visualizaciones (últimos 30 días)
Majid kh
Majid kh el 2 de Feb. de 2019
Respondida: Walter Roberson el 2 de Feb. de 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?

Respuesta aceptada

Walter Roberson
Walter Roberson el 2 de Feb. de 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.

Más respuestas (0)

Categorías

Más información sobre Digital Input and Output en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by