Hi,
In various bits of PWM related code, I've seen people setting the PWM clock divisor with:
PWMCLK_DIV , setting the clock source with PWMCLK_CNTL etc.
The normal PWM registers are defined in the broadcom PDF on here, but I can't find anywhere that defines these registers?
What I particularly want to know is whether the divisor is purely integer (as most code seems to assume it is), or whether it has a fractional part / potential for extra delay of some kind, as the code on https://github.com/octachrome/piberry/b ... ster/pwm.c seems to assume. I can't map from the clock divisor in that code to the frequency he talks about.
The reason I'm asking, is that the PWM in serial mode seems like it would work just fine coupled to an LED to generate a TOSLINK SPDif output, but obviously for this to work without the signal needing some kind of dynamic re-clocking, it really needs to be as close to 48000*32 * 2 * 2 hz (6144000hz) as possible. It'd then be possible to generate a TOSLink optical SPDIF signal with just software plus an LED and resistor (like http://scanlime.org/2011/04/spdif-digit ... ontroller/ does on a microcontroller), which could potentially make quality audio way cheaper than the current quite expensive add-on boards.The SPDIF signal generation itself is pretty straightforward, and the DMA support for the PWM FIFO, in conjunction with the serial mode of the PWM chip seems like it would do the job just fine.