Problem with Average analogue component macro?

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

Moderator: Benj

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?

Postby Chris_MIRA » Thu Jun 18, 2015 1:17 pm

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 80 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?

Postby hyperion007 » Sat Jun 20, 2015 12:29 pm

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?

Postby Chris_MIRA » Mon Jun 22, 2015 2:11 pm

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: 14432
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4499 times
Been thanked: 4182 times
Contact:

Re: Problem with Average analogue component macro?

Postby Benj » Mon Jun 22, 2015 5:00 pm

Hi Chris,

Please can you give this file a go, it seems to be working well for me.

PIC16BIT_CAL_ADC.c
(38.79 KiB) Downloaded 92 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?

Postby Chris_MIRA » Tue Jun 23, 2015 8:37 am

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