diff --git a/source/bsp/TTSSbsp/bsp_config.h b/source/bsp/TTSSbsp/bsp_config.h index 81808b4..dd5edc2 100644 --- a/source/bsp/TTSSbsp/bsp_config.h +++ b/source/bsp/TTSSbsp/bsp_config.h @@ -166,7 +166,8 @@ //串口配置 /// #define D_UART1_BRT BRT_460800 /// #define D_UART1_BRT BRT_921600 -#define D_UART1_BRT BRT_115200 +// #define D_UART1_BRT BRT_115200 +#define D_UART1_BRT BRT_9600 #define D_UART1_SBIT SBIT_1 #define D_PIN_UART1 PIN_UART1_Rxd_30_Txd_31 #define D_UART2_BRT BRT_115200///BRT_921600///BRT_115200/// diff --git a/source/debug/debug_drv.c b/source/debug/debug_drv.c index b285916..aee8ee8 100644 --- a/source/debug/debug_drv.c +++ b/source/debug/debug_drv.c @@ -119,7 +119,7 @@ u8 L3_tpc_hex(void) return 1; } } - printfs("\r\n cmd error!!"); + // printfs("\r\n cmd error!!"); return 0; } #endif @@ -132,7 +132,7 @@ vtype L2_debug_ONcomand(void) { ts_Urec[D_UART1].debugok = 0;////解析协议 /// printf("\r\nw ts_Urec[D_UART1].max = %d num = %d",(int)ts_Urec[D_UART1].rmax,(int)ts_Urec[D_UART1].num); - printf1("\r\ndebugok %2x",(int)ts_Urec[D_UART1].debugok); + // printf1("\r\ndebugok %2x",(int)ts_Urec[D_UART1].debugok); } if(1 == ts_Urec[D_UART1].ok) diff --git a/source/msp/uart/msp_uart1.c b/source/msp/uart/msp_uart1.c index 568d3e9..73b54e1 100644 --- a/source/msp/uart/msp_uart1.c +++ b/source/msp/uart/msp_uart1.c @@ -105,6 +105,18 @@ msp/uartx.c 底层代码 和cpu相关 缓存发送也放在里面 #elif(BRT_19200 == D_UART1_BRT) #elif(BRT_9600== D_UART1_BRT) + void L0_uart1_init(void) //9600bps@22.1184MHz + { + SCON = 0x50; //8位数据,可变波特率 + AUXR |= 0x40; //定时器时钟1T模式 + AUXR &= 0xFE; //串口1选择定时器1为波特率发生器 + TMOD &= 0x0F; //设置定时器模式 + TL1 = 0xC0; //设置定时初始值 + TH1 = 0xFD; //设置定时初始值 + ET1 = 0; //禁止定时器中断 + TR1 = 1; //定时器1开始计时 + } + #warning "MainFre_22M BRT_115200" #else///9600 #endif//)