I'd like to use 14-bit phase corrected PWM to generate some audio from stored tables. I understand I can use two PWM channels with some external resistors to add them together to produce a higher bit depth signal. If it were two 8 bit channels to give me 16 bit audio that would be easy since sending the high 8 bits of the int to the High channel and the low 8 bits to the Low channel.
Where I'm stumped is how to split it up for anything else. I'm interested in 14 bit audio divided into two 7 bit channels. if I start with a int and limit it to 16383 how do I split that between two 7 bit channels. 16383 is 14 one bits so I'll put them in two PWM registers do they go 01111111 01111111 or 01111111 11111110, or 00111111 11111111 (straight move) a straight move doesn't seem to work. I've been playing around with it and the sine wave is very jittery which means I'm not splitting the data properly Since I'm generating the tables if I need to move the bits around in the int to allow me to do straight moves into the registers that would make things less complicated and hopefully run faster.