xnorit:public:dependencies:xnorserial
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| xnorit:public:dependencies:xnorserial [2021/04/06 08:52] – [Protocol:] timdv91 | xnorit:public:dependencies:xnorserial [2023/02/26 04:55] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 17: | Line 17: | ||
| } | } | ||
| - | void serialEvent1(){XS.SerialEventProc(); | + | void serialEvent1(){XS.SerialEventProc(); |
| + | // Edit Serial-number accordingly! XS.SerialEventProc(); | ||
| void loop(){...} | void loop(){...} | ||
| Line 31: | Line 32: | ||
| ==== Downloads ==== | ==== Downloads ==== | ||
| - | * Download of embedded device code: {{ : | + | * Download of embedded device code: {{ : |
| \\ | \\ | ||
| Line 46: | Line 47: | ||
| To read data from the embedded device the host has to send an SOH-byte followed by 2 protocol bytes. Those 2 bytes configure the start index and amount of data we request from the embedded device' | To read data from the embedded device the host has to send an SOH-byte followed by 2 protocol bytes. Those 2 bytes configure the start index and amount of data we request from the embedded device' | ||
| - | {{ : | + | {{ : |
| * ** First byte: ** \\ The SOH-byte, can be send in conjunction with other data-bytes or as separate byte. | * ** First byte: ** \\ The SOH-byte, can be send in conjunction with other data-bytes or as separate byte. | ||
| Line 57: | Line 58: | ||
| * Orange: Request starting from byte 0, request 3 bytes in total. | * Orange: Request starting from byte 0, request 3 bytes in total. | ||
| * Red: Request starting from byte 3, request 3 bytes in total. | * Red: Request starting from byte 3, request 3 bytes in total. | ||
| + | |||
| + | \\ | ||
| + | \\ | ||
| + | \\ | ||
| + | \\ | ||
| === Write request: === | === Write request: === | ||
| - | To write data to to the embedded device, the host has to send an SOH-byte before sending 2 protocol bytes. The last protocol byte is then followed by data bytes. The first 2 bytes keep the same logic as in read mode, following bytes are written to the ' | + | |
| + | {{ : | ||
| + | |||
| + | To write data to the embedded device, the host has to send an SOH-byte before sending 2 protocol bytes. | ||
| + | The last protocol byte is then followed by data bytes. The first 2 bytes keep the same logic as in read mode, following bytes are written to the ' | ||
| * ** First byte: ** \\ The SOH-byte, can be send in conjunction with other data-bytes or as separate byte. | * ** First byte: ** \\ The SOH-byte, can be send in conjunction with other data-bytes or as separate byte. | ||
| Line 65: | Line 75: | ||
| * ** Third byte: ** \\ Determines the amount of bytes we want to write. \\ | * ** Third byte: ** \\ Determines the amount of bytes we want to write. \\ | ||
| * **For example: ** \\ When the second byte is set to ' | * **For example: ** \\ When the second byte is set to ' | ||
| + | |||
| + | * ** Image explanation: | ||
| + | * Orange: Requesting 5 bytes from the embedded device' | ||
| + | * Purple: Writing 5 bytes to the embedded device' | ||
| + | * Note how before writing the data in-between the ACK and EOT bytes are all equal to zero, while after writing they represent the same 1,2,3,4,5 values that we wrote to them. Additionally you can also note how a write action does not return data, except for the ACK reply and EOT byte automatically send by the embedded device. | ||
| \\ | \\ | ||
xnorit/public/dependencies/xnorserial.1617699165.txt.gz · Last modified: (external edit)
