Hi. I've looked at mega328p data sheet/reading adc. It mentions modes like continuous and if interrupt is caused on capture complete.
I tried adval=readad(an0)
array(ptr)=adval
in a loop but if I input a 3KHz siganal on playback on a glcd it seems the waveform in the array is only 6 samples per cycle, ie 1 cycle is 6 points joined.
The adc is supposed to work to 30KHz...to me.
If I got it free running and set an interrupt to occur when it had completed it's capture and store then stored the value and incremented the pointer to next storage would it sample faster?
I tried on interrupt ADCReady call adcint
val-readad(an0)
with sub adcint
val=readad(an0) etc
Didn't work.
Before I waste time, how often can I get an 8 bit sample?
Is it better to use #define ADReadPreReadCommand to set readad up on mega328p?
I'm not sure if the GCB adc commands are only for pic.
I've tried various code before posting here but if it takes 25 us for 1st sample then 13 us after thats 80 per ms or 80KHz. I think I misinterpretted that but anyway I'm not getting that sort of sampling speed.
Any advice welcome.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I posted the other day - you are on a hybrid release and we need to get you on a release that others have. I offered you v0.98.00 last night - your choice but it is hard for others to help you as only folks with v0.97.02 RC4 have the same adc.h library as you.
However, answers.
Index
Question
Answer
1
How often can I get an 8 bit sample?
The minimum sample period is in the datasheet. 13 - 260μs Conversion Time
2
Is it better to use #define ADReadPreReadCommand to set readad up on mega328p?
Not really. ADReadPreReadCommand is intended to debug or provide a workaround when we find an issue.
3
I'm not sure if the GCB adc commands are only for pic.
AVR and PIC. AVR ADC is supported.
4
I've tried various code before posting here but if it takes 25 us for 1st sample then 13 us after thats 80 per ms or 80KHz. I think I misinterpretted that but anyway I'm not getting that sort of sampling speed.
What is the code?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi. I've looked at mega328p data sheet/reading adc. It mentions modes like continuous and if interrupt is caused on capture complete.
I tried adval=readad(an0)
array(ptr)=adval
in a loop but if I input a 3KHz siganal on playback on a glcd it seems the waveform in the array is only 6 samples per cycle, ie 1 cycle is 6 points joined.
The adc is supposed to work to 30KHz...to me.
If I got it free running and set an interrupt to occur when it had completed it's capture and store then stored the value and incremented the pointer to next storage would it sample faster?
I tried on interrupt ADCReady call adcint
val-readad(an0)
with sub adcint
val=readad(an0) etc
Didn't work.
Before I waste time, how often can I get an 8 bit sample?
Is it better to use #define ADReadPreReadCommand to set readad up on mega328p?
I'm not sure if the GCB adc commands are only for pic.
I've tried various code before posting here but if it takes 25 us for 1st sample then 13 us after thats 80 per ms or 80KHz. I think I misinterpretted that but anyway I'm not getting that sort of sampling speed.
Any advice welcome.
Some many questions. Back to a table.
I posted the other day - you are on a hybrid release and we need to get you on a release that others have. I offered you v0.98.00 last night - your choice but it is hard for others to help you as only folks with v0.97.02 RC4 have the same adc.h library as you.
However, answers.