audio tones up to 10kHz on a 16Fxx architecture with a 20Mhz OSC
16Fxx isn't the best choice
For comparison:
16Fxx @ 20MHz executes instructions at 5 MIPS,
16F1xxxx @ 32MHz -> 8 MIPS,
18F @ 64MHz -> 16 MIPS
Looking back at your original pseudo code with lookup table SINB array in ram:
Code:
loop1:
lookbyte=timebyte and 31
ampvar=SINB(lookbyte)
PORTB=ampvar
timebyte=timebyte+1
goto loop1
On a PIC18F @ 64MHz this executes in 1us/loop (1MHz update rate)
If you put the SINB table in ROM (which is more likely) it slows down to 1.25us/loop (800KHz update rate)
I didn't do those evaluations using PBP, so I don't know if it's much slower than that.
Bookmarks