本帖最后由 15651621702 于 2015-10-16 13:55 编辑
xiangtian134 发表于 2015-10-16 12:20
串口你预编译了吗
谢谢你的解答,问题找到了。是我对忽略了引脚映射,以为P0.4和P0.5是UART1的发射和接收端口~~~其实不然,由于定义HAL_UART_ISR =2了,那么发送和接收引脚变为了P1.6和P1.7{:1_101:}
#if (HAL_UART_ISR == 1)
#define HAL_UART_PERCFG_BIT 0x01 // USART0 on P0, Alt-1; so clear this bit.
#define HAL_UART_Px_RX_TX 0x0C // Peripheral I/O Select for Rx/Tx.
#define HAL_UART_Px_RTS 0x20 // Peripheral I/O Select for RTS.
#define HAL_UART_Px_CTS 0x10 // Peripheral I/O Select for CTS.
#else
#define HAL_UART_PERCFG_BIT 0x02 // USART1 on P1, Alt-2; so set this bit.
#define HAL_UART_Px_RTS 0x20 // Peripheral I/O Select for RTS.
#define HAL_UART_Px_CTS 0x10 // Peripheral I/O Select for CTS.
#define HAL_UART_Px_RX_TX 0xC0 // Peripheral I/O Select for Rx/Tx.
#endif