wip
Member
Hi everyone,
What I am trying to do
Outputting 12 simultaneous & unique frequencies (ie: 220hz, 440hz + 10 others).
What I am using
Atmega640
2x 8-bit timers
4x 16-bit timers
12 PWM channels
Problem 1) 8-bit timers
In "Fast PWM" mode, using the 8-bit timers, I cannot set the TOP value (it's fixed at 255). So I can only change the "prescaler" (1024,256,128,64,32,8,1). Doesn't correspond to my frequencies. I was looking at the CTC mode, from what I understand, I could set the compare on match and toggle a pin, but will I be able to use 2 simultaneous & unique value for compare on match?
Problem 2) 16-bit timers
With the 16-bit timers, I can set the TOP value in a register, but this value is shared for both channels (A/B). It won't be possible to have 2 simultaneous & unique frequency for each channel?
Any suggestion or info would be much appreciated,
Thanks!
What I am trying to do
Outputting 12 simultaneous & unique frequencies (ie: 220hz, 440hz + 10 others).
What I am using
Atmega640
2x 8-bit timers
4x 16-bit timers
12 PWM channels
Problem 1) 8-bit timers
In "Fast PWM" mode, using the 8-bit timers, I cannot set the TOP value (it's fixed at 255). So I can only change the "prescaler" (1024,256,128,64,32,8,1). Doesn't correspond to my frequencies. I was looking at the CTC mode, from what I understand, I could set the compare on match and toggle a pin, but will I be able to use 2 simultaneous & unique value for compare on match?
Problem 2) 16-bit timers
With the 16-bit timers, I can set the TOP value in a register, but this value is shared for both channels (A/B). It won't be possible to have 2 simultaneous & unique frequency for each channel?
Any suggestion or info would be much appreciated,
Thanks!