Problem with Average analogue component macro?

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

Moderator: Benj

Post Reply
Chris_MIRA
Posts: 186
Joined: Wed Jan 23, 2013 3:43 pm
Contact:

Problem with Average analogue component macro?

Post 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
Attachments
Flasher and Brake Debug.fcfx
(39.41 KiB) Downloaded 99 times

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

Re: Problem with Average analogue component macro?

Post 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.

Chris_MIRA
Posts: 186
Joined: Wed Jan 23, 2013 3:43 pm
Contact:

Re: Problem with Average analogue component macro?

Post 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

User avatar
Benj
Matrix Staff
Posts: 14865
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: Problem with Average analogue component macro?

Post 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 119 times
The file needs to live here "C:\Program Files (x86)\Flowcode 6\CAL\PIC16BIT".

Chris_MIRA
Posts: 186
Joined: Wed Jan 23, 2013 3:43 pm
Contact:

Re: Problem with Average analogue component macro?

Post by Chris_MIRA »

Hi,
All working properly now (thanks for your help :-) )
Regards,
Chris

Post Reply