Page 1 of 1

Problem with Average analogue component macro?

Posted: Thu Jun 18, 2015 1:17 pm
by Chris_MIRA
Hi,
I may be doing something wrong, but the component macro "get average byte" seems to hang the programme attached. The offending bit is commented and is in the macro "sign_get", Ive tried using the "get byte" instead and this works fine. Ive also tried disabling Timer 1 just before and re-enabling after the component macro. The problem still exists, the system simulates fine but does NOT work in the hardware.

Regards,
Chris

Re: Problem with Average analogue component macro?

Posted: Sat Jun 20, 2015 12:29 pm
by hyperion007
I've had similar problems with the dsPICs and the average ADC macros. Both the Get Average and Raw Average functions made the program freeze up. Worked fine on 8 bit PICs but not 16 bit.
The Get Byte or Get Int worked fine if I remember correctly.

Also, you can try to increase the delay from 2us to maybe 200 or 2000us just to test it out.

Re: Problem with Average analogue component macro?

Posted: Mon Jun 22, 2015 2:11 pm
by Chris_MIRA
Sorry to push, but is there any progress on this? (Im now confident it is a bug as others have experienced the same problem)
Regards,
Chris

Re: Problem with Average analogue component macro?

Posted: Mon Jun 22, 2015 5:00 pm
by Benj
Hi Chris,

Please can you give this file a go, it seems to be working well for me.
PIC16BIT_CAL_ADC.c
(37.22 KiB) Downloaded 252 times
The file needs to live here "C:\Program Files (x86)\Flowcode 6\CAL\PIC16BIT".

Re: Problem with Average analogue component macro?

Posted: Tue Jun 23, 2015 8:37 am
by Chris_MIRA
Hi,
All working properly now (thanks for your help :-) )
Regards,
Chris