- 打卡等级:初来乍到
- 打卡总天数:4
- 最近打卡:2025-05-01 06:58:22
金牌会员
- 积分
- 1335
|
发表于 2023-9-28 16:20:31
|
显示全部楼层
The normal PWM channels all have a common zero, so you cannot use those.
The PCA does have a mode called High Speed pulse output mode, that toggles a pin on a match.
With 3 pins possible, you need to create a PCA interrupt, that writes 3 pairs of compares, one write for each edge on each pin.
You have 6 interrupts spread over 20ms,which is a light CPU load.
If your clock is a 2^16 multiple of 50Hz, the compare points will simply swap.
If the clock is not a 2^16 multiple, you can add (Sysclks in 10ms) to each compare interrupt, after setting the initial phase carefully |
|