KL43 LPUART接收数据时不能进中断函数,但是我们试过发送数据时是可以进中断函数的。另外,接收数据时STAT寄存器中RDRF位始终未置1,可能是这个导致没有进中断。
21
RDRF
Receive Data Register Full Flag
RDRF is set when the receive buffer (LPUART_DATA) is full. To clear RDRF, read the LPUART_DATA
register.
A character that is in the process of being received does not cause a change in RDRF until the entire
character is received. Even if RDRF is set, the character will continue to be received until an overrun
condition occurs once the entire character is received.
0 Receive data buffer empty.
1 Receive data buffer full.
1.GPRS发出来的数据,波特率是对的。
2.你指的是在PC端用串口助手给MCU发数据吗?这个我们也想过,但是PC端是RS232信号,MCU是TTL信号,我们没法将RS232转成TTL信号,所以没法试。
3.这个官方例程我们有,但是keil工程编译不过,主要错误是:
..\..\..\..\src\cpu\device.h(40): error: #5: cannot open source input file "core_cm0.h": No such file or directory
#include "core_cm0.h"