RELOAD_COUNT的值是怎么算出来的?
如下代码,#defineRELOAD_COUNT0xd9//12.000MHz,12T,SMOD=0,9600bpsvoidserial_port_one_initial...
如下代码,#define RELOAD_COUNT 0xd9 //12.000MHz,12T,SMOD=0,9600bpsvoid serial_port_one_initial(){ SCON = 0x50; //0101,0000 8位可变波特率,无奇偶校验位// TMOD = 0x21; //0011,0001 设置顶时器1为8位自动重装计数器// TH1 = RELOAD_COUNT; //设置定时器1自动重装数// TL1 = RELOAD_COUNT;// TR1 = 1; //开定时器1BRT = RELOAD_COUNT;// BRTR = 1, S1BRS = 1, EXTRAM = 1 ENABLE EXTRAM//AUXR = 0x11; // T0x12,T1x12,UART_M0x6,BRTR,S2SMOD,BRTx12,EXTRAM,S1BRSAUXR = 0x15; //For 12MHz OSC ES = 1; //允许串口中断 EA = 1; //开总中断}RELOAD_COUNT的值是怎么算出来的
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询