Answer the question
In order to leave comments, you need to log in
How to send error code via UART?
Good afternoon.
there is a digital photo-video camera with uart, jtag, usb.
I create a diagnosable device in theory.
The parameters to be diagnosed include:
- battery health
- flash,
etc. It is
necessary to transfer an 8-bit error code from the camera to the Arduino.
I initially chose UART, from the RX port on the camera I transfer to the TX port on the Arduino ...
but along the way I realized that everything is transmitted bit by bit - error codes can mix up ..
Tell me, is there a way out of this situation?
Answer the question
In order to leave comments, you need to log in
Number the bytes in the message - for example, in the first byte, the high bit should never be raised, in the second byte - always raised. Then you will have as many as 2^14 error options. And the third byte can be used to send XOR of the first two, then everything will be clear for sure.
0XXX XXXX
1YYY YYYY
1CCC CCCC
There are as many as 14 bits per message and integrity check. (C=XxorY)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question