ADC Base freezes the PIC
Posted: Wed Dec 17, 2014 7:12 pm
I use pic24fj64ga at 32mhz FRC with PLL
and use ADC Base with parameters:
Conv speed: Tcy/2
Asq time: 1
VDD
Created a int timer at 8khz and do only one function ADC.GetByte and it works ok, captures 8000 times in a second.
Howerver when I raise timer to 16khz I see that it actually captures only around 6k bytes.
I did timer slower to 4khz - it captures ok 4000 bytes exactly.
Played with timer frequency more and less and saw that problem occurs after timer frequency at 10-12khz. Less - result is ok, more - result is not correct. Seems like the ADC base gets overloaded.
I tried to increase conv.speed to Tcy and Tcy*x but the whole PIC freezes forever on the step ADC.GetByte. According to datasheet this pic's ADC can get data upto 400khz samples. What may be wrong? Isn't it a bug?
and use ADC Base with parameters:
Conv speed: Tcy/2
Asq time: 1
VDD
Created a int timer at 8khz and do only one function ADC.GetByte and it works ok, captures 8000 times in a second.
Howerver when I raise timer to 16khz I see that it actually captures only around 6k bytes.
I did timer slower to 4khz - it captures ok 4000 bytes exactly.
Played with timer frequency more and less and saw that problem occurs after timer frequency at 10-12khz. Less - result is ok, more - result is not correct. Seems like the ADC base gets overloaded.
I tried to increase conv.speed to Tcy and Tcy*x but the whole PIC freezes forever on the step ADC.GetByte. According to datasheet this pic's ADC can get data upto 400khz samples. What may be wrong? Isn't it a bug?