Mr T.
We want to sample at 8KHz and do not need to bother with the ADC interrupt. Seriously if you can do it easier with a special event trigger I want to see it as I have not used them.
Code:
TIMER ISR:
READ CONVERTED VALUE
RELOAD TIMER IF NOT DONE BY THE HARDWARE
START CONVERSION
SET XFLAG IF WE HAVE ENOUGH DATA FOR A PACKET
RTI
MAIN:
SETUP HARDWARE
REPEAT
IF (XFLAG) SEND PACKET
CLEAR XFLAG
john_19
Are you getting the correct audio on the other side of the internet link it you string together the packets without a delay between them. Like save a 100 packets then play them.
The one thing that bothers me is the interaction between the above code and the stack. I am not sure what the stack uses for interrupts. But it
might be possible to make the TIMER interrupt a high priority and any stack interrupts low priority. The idea is it lets you continue collecting data during the packet transmission. For this to work you need to keep the TIMER ISR short as possible.
Good luck and keep us posted.