adc and pic24

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

adc and pic24

Post by mikn »

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
Attachments
sc-adc-2.gif
sc-adc-2.gif (17.69 KiB) Viewed 5259 times
sc-adc-1.png
(4.91 KiB) Downloaded 2847 times
FC 6.1.3.2 (18.02.2016)

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: adc and pic24

Post by Rudi »

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
;-)

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: adc and pic24

Post by mikn »

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.
sc-adc-dead1.GIF
sc-adc-dead1.GIF (18.79 KiB) Viewed 5234 times
sc-adc-dead.GIF
(106.71 KiB) Downloaded 598 times
FC 6.1.3.2 (18.02.2016)

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: adc and pic24

Post by Rudi »

mikn 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.
You are not allone ;-) i am with you ;-) ;-) ;-)
http://www.matrixmultimedia.com/mmforum ... 885#p60221
;-)

I work in PIC18F2550, because PIC24 do not like me ;-) but i think this is a general goes wrong.
Best wishes
Rudi
;-)

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: adc and pic24

Post by mikn »

yeah, seems like FC is more friendly to atmel rather than to microchip.. ;)
FC 6.1.3.2 (18.02.2016)

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: adc and pic24

Post by Rudi »

mikn wrote:yeah, seems like FC is more friendly to atmel rather than to microchip.. ;)
ha ha ha .... ;-) an advantage does that have: You learn a lot in this short time. Try Serach Try ... Try Search Try :-) i am sure ..everything will be fine.. and If the test phases of the woods, then FC6 is the best thing ever. While it sucks immensely - but it seems to us also benefit - ;-) ... Microchip users :-) :-) :-)

Post Reply