Is it possible to generate 4 channel SPWM signal with controlled amplitude and frequency using 328p?
If "S"PWM means sine.
Is 4 channel correct instead of 3 phase?
I think software PWM is does it can, but ...
Does amplitude mean duty cycle?
How want is the frequency range and duty cycle resolution?
Do all frequencies need to be each different?
Yes 4 channel
only duty cycle...
switching frequency in terms of KHz
output frequency 50Hz
First, below is in my sloppy head, not tested.
I feel 50Hz 4ch Sinewave from PWM seems to be able to output if all timers are used.
Use Timer0 and Timer2 for the actual output.
Both timer is 8-bit and each has 2ch output.
And use Timer1 to control timing for change the duty cycle to generate Sinewave.
However, Arduino cannot output a negative voltage, so a DC bias of half that of VCC is required.
So half wave resolution is 7-bit.
But... for variable amplitude, I feel that the CPU resource for calculation is bit serious.
If not possible in 328p
is it possible in atmega 2560?
Which one is best for this application? 328p or 2560?
I'm not saying it's impossible with the 328P, but I think it will be easier with a board with uC that operates at a higher clock.
Also, It can obtain a smoother sine wave.
Perhaps when using 328P, It needs fixed lookup-table for Sine and you need to multiply the amplitude at each pulses.
Maybe it may not be in time at calculate the duty of each pulse from the phase and amplitude each time.
MEGA (ATmega2560) has more peripherals such as timers and much more ROM and RAM.
But the processing speed and performance are the same to Uno (ATmega328P).
Both are 8-bit AVR and operate at 16MHz.
It may be better and simpler to use a STM32 series microcontroller.
can any body provide example?