代码如下:16M主频的_DELAY_TABLE table[] 设置, 根据注释里的公式算出来和程序里的数字不对啊,大神帮忙看看呗,如果是25M的应该怎么计算啊????
#if F_CPU == 16000000L
//formula is roughly rxintra=rxstop=tx = F_CPU / baud / 3 - 5/3
// so, delay = 16000000 / 3 / baud - 5/3
// and, rxcenter = 1/2 rxintra
_DELAY_TABLE table[] =
{
// baud rxcenter rxintra rxstop tx
{115200, 15, 32, 32, 32, },
{57600, 38, 78, 78, 78, },
{38400, 61, 123, 123, 123, },
{31250, 72, 155, 155, 155, },
{28800, 80, 170, 170, 170, },
{19200, 126, 262, 262, 262, },
{14400, 177, 353, 353, 353, },
{9600, 265, 540, 540, 540, },
{4800, 547, 1095, 1095, 1095, },
{2400, 1103, 2190, 2190, 2190, },
{1200, 2200, 4400, 4400, 4400, },
{300, 8881, 17762, 17762, 17762, },
};
const int XMIT_START_ADJUSTMENT = 5;
#else
#error This version of SoftwareSerial supports only 16MHz processors
#endif
此帖出自
小平头技术问答
一周热门 更多>