send via RS232 code

I want to send xy coordinates from my matlab code to FPGA board via RS232. Can somebody help me with this code,I want to add it to my existing code.

Respuestas (2)

Walter Roberson
Walter Roberson el 1 de Jun. de 2011

0 votos

serial() to associate the port with an identifier. set() to configure things like speed. fopen() to open the port. fprintf() or fwrite() to send the data.
Greg
Greg el 16 de Ag. de 2011

0 votos

thax i connected scope to my pc to check the transmited data and i get strange bit string ..

1 comentario

Walter Roberson
Walter Roberson el 16 de Ag. de 2011
Strange how so? For example what do you get if you fwrite(s,char(0)) ?
Note that the start and stop bits have their logic levels reversed compared to data bits, and note that a data bit representing 1 is sent as a negative voltage with a 0 represented by a positive voltage. Also note that RS232 sends the least significant bit first.

Iniciar sesión para comentar.

Etiquetas

Preguntada:

el 1 de Jun. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by