Hi
When I set interrupt frequency to 8khz and use adc base to catch analog input then save it to file, it works. But when I try to set interrupt to more frequent value (16khz or faster) it reboots the controller. Even I am not using save to file function (just accumulate values and calculate the average for every 5 catches).
Also there's another problem. When I try to use GetAverageByte it freezes the whole chip. I've played with adc settings but nothing helped.
This is the reason why I've made my own average algorythm in adc_read macro.
Some screenshots are below. The whole project is big so I don't publish it here.
Any advices are appreciated.
chip is pic24fj64ga
adc and pic24
Moderator: Benj
- mikn
- Posts: 209
- Joined: Mon Mar 03, 2014 10:11 pm
- Has thanked: 54 times
- Been thanked: 41 times
- Contact:
adc and pic24
- Attachments
-
- sc-adc-2.gif (17.69 KiB) Viewed 5360 times
-
- sc-adc-1.png
- (4.91 KiB) Downloaded 2847 times
FC 6.1.3.2 (18.02.2016)
Re: adc and pic24
mikn wrote:Hi
When I set interrupt frequency to 8khz and use adc base to catch analog input then save it to file, it works. But when I try to set interrupt to more frequent value (16khz or faster) it reboots the controller. Even I am not using save to file function (just accumulate values and calculate the average for every 5 catches).
Also there's another problem. When I try to use GetAverageByte it freezes the whole chip. I've played with adc settings but nothing helped.
This is the reason why I've made my own average algorythm in adc_read macro.
Some screenshots are below. The whole project is big so I don't publish it here.
Any advices are appreciated.
chip is pic24fj64ga
Hi,,
have you seen this
http://www.matrixmultimedia.com/mmforum ... 790#p59641
can you try this ?
Best wishes!
Rudi
![Wink ;-)](./images/smilies/icon_wink.gif)
- mikn
- Posts: 209
- Joined: Mon Mar 03, 2014 10:11 pm
- Has thanked: 54 times
- Been thanked: 41 times
- Contact:
Re: adc and pic24
Some more troubles.
I've added cal_adc to my project.
Pressed twice on current macro block, changed it from adc_base.getbyte to cal_adc.sample.
Then when I press to field Sample I get error and FC closes.
I've added cal_adc to my project.
Pressed twice on current macro block, changed it from adc_base.getbyte to cal_adc.sample.
Then when I press to field Sample I get error and FC closes.
FC 6.1.3.2 (18.02.2016)
Re: adc and pic24
You are not allonemikn wrote:Some more troubles.
I've added cal_adc to my project.
Pressed twice on current macro block, changed it from adc_base.getbyte to cal_adc.sample.
Then when I press to field Sample I get error and FC closes.
![Wink ;-)](./images/smilies/icon_wink.gif)
![Wink ;-)](./images/smilies/icon_wink.gif)
![Wink ;-)](./images/smilies/icon_wink.gif)
![Wink ;-)](./images/smilies/icon_wink.gif)
http://www.matrixmultimedia.com/mmforum ... 885#p60221
![Wink ;-)](./images/smilies/icon_wink.gif)
I work in PIC18F2550, because PIC24 do not like me
![Wink ;-)](./images/smilies/icon_wink.gif)
Best wishes
Rudi
![Wink ;-)](./images/smilies/icon_wink.gif)
- mikn
- Posts: 209
- Joined: Mon Mar 03, 2014 10:11 pm
- Has thanked: 54 times
- Been thanked: 41 times
- Contact:
Re: adc and pic24
yeah, seems like FC is more friendly to atmel rather than to microchip.. ![Wink ;)](./images/smilies/icon_wink.gif)
![Wink ;)](./images/smilies/icon_wink.gif)
FC 6.1.3.2 (18.02.2016)
Re: adc and pic24
ha ha ha ....mikn wrote:yeah, seems like FC is more friendly to atmel rather than to microchip..
![Wink ;-)](./images/smilies/icon_wink.gif)
![Smile :-)](./images/smilies/icon_smile.gif)
![Wink ;-)](./images/smilies/icon_wink.gif)
![Smile :-)](./images/smilies/icon_smile.gif)
![Smile :-)](./images/smilies/icon_smile.gif)
![Smile :-)](./images/smilies/icon_smile.gif)