const uint16_t Sine12bit[32] = {
2047, 2447, 2831, 3185, 3498, 3750, 3939, 4056, 4095, 4056,
3939, 3750, 3495, 3185, 2831, 2447, 2047, 1647, 1263, 909,
599, 344, 155, 38, 0, 38, 155, 344, 599, 909, 1263, 1647};
正弦波
const uint16_t Tri12bit[32] = {
0, 0, 0, 0, 0, 0, 0, 0, 200, 400,
600, 800, 1000, 1200, 1400, 1600, 1800, 2000, 2200, 2400,
2600, 2800, 3000, 3200, 3400, 3600, 3800, 4000, 3000, 2000, 1000, 0};
锯齿波
for (Idx = 0; Idx < 32; Idx++)
{
DualSine12bit[Idx] = (Tri12bit[Idx] << 16) + (Sine12bit[Idx]);
}
对双DAC12位右对齐通道赋值,相对于野火的例程,我只是修改了DAC2通道的值,然后两路输出还是一样,而且既不是正弦波,也不是锯齿波。求大侠指点。
|
|