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
Has thanked: 2 times
Been thanked: 21 times
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 229 times

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
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
Has thanked: 2 times
Been thanked: 21 times
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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
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 249 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
Has thanked: 2 times
Been thanked: 21 times
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