Specification Sheet

BWT61CL | Datasheet v20-0630 | http://wiki.wit-motion.com/english
- 19 -
6.4 Data Analysis Sample Under Embedded
Environment
The code is divided into two parts, one of them is interrupt reception. Find the
header of the data and then put the data-packet into an array. The other one
is data analysis, which is put into the main program section.
Interrupt unit(The following is AVR microcontroller code, different MCU reads
the register a little different):
unsigned char Re_buf[11],counter=0;
unsigned char sign;
interrupt [USART_RXC] void usart_rx_isr(void) //USART serial receiving
interrupt
{
Re_buf[counter]=UDR; //Different micro-controller is slightly
Different
if(counter==0&&Re_buf[0]!=0x55) return; //NO.0 data is not a frame
header ,skip.
counter++;
if(counter==11) //11 data has been received
{ counter=0; // Reassigned,ready for the next frame data reception
sign=1;
}