大家帮忙看看嘞 CPLD产生115200波特率问题
parameter ClkFrequency = 25000000; // 25MHzparameter Baud = 115200;
parameter RegisterInputData = 1; // in RegisterInputData mode, the input doesn't have to stay valid while the character is been transmitted
// Baud generator
parameter BaudGeneratorAccWidth =16;
reg BaudGeneratorAcc;
`ifdef DEBUG
wire BaudGeneratorInc = 17'h10000;
`else
wire BaudGeneratorInc = ((Baud<<(BaudGeneratorAccWidth-4))+(ClkFrequency>>6))/(ClkFrequency>>5);
`endif
wire BaudTick = BaudGeneratorAcc;
wire TxD_busy;
always @(posedge clk) if(TxD_busy) BaudGeneratorAcc <= BaudGeneratorAcc + BaudGeneratorInc;
这段是25MHZ产生115200波特率的代码 如果改成30MHZ 如何修改使产生115200的波特率呢?跪求指导 回复【楼主位】lingcw
-----------------------------------------------------------------------
修改个地方,正确的应为:((Baud<<(BaudGeneratorAccWidth-4))+(ClkFrequency>>5))/(ClkFrequency>>4); 回复【1楼】lingcw
-----------------------------------------------------------------------
哎呀自个弄明白了 就是分频 求步进值 fpga4fun上的 呵呵 挺不错的程序 回复【3楼】denike
-----------------------------------------------------------------------
是啊我现在也发现了。。。。。
页:
[1]