Page 1 of 1

Expansion Modules dspMIAC - Error

Posted: Sat Feb 09, 2019 6:11 pm
by gavo4
Hi Leigh and Benj,

I have a strange issue with the advanced expansion module, I keep getting an error:

C:\Program Files (x86)\Flowcode\Common\Compilers\pic16\batchfiles\pic16_C30_comp.bat reported error code 1

When I try the example file Leigh sent before it works perfectly, the minute I take out all the references to the expansion module (initialize and Digital output macro) and re-compile it, it compiles 100%, do you know why i would get this error and when I use the example code for the expansion module it works 100%?.
MIAC_Expansion.jpg
MIAC_Expansion.jpg (11.37 KiB) Viewed 12525 times

Re: Expansion Modules dspMIAC - Error

Posted: Sat Feb 09, 2019 6:13 pm
by gavo4
Running the code below on its own run perfectly with no errors
MIAC_Expansion_2.jpg
MIAC_Expansion_2.jpg (26.29 KiB) Viewed 12524 times

Re: Expansion Modules dspMIAC - Error

Posted: Mon Feb 11, 2019 9:11 am
by LeighM
Hi,
Could you post the project that gives the error?
Re-creating the above images I do not get any errors
Thanks
Leigh

Re: Expansion Modules dspMIAC - Error

Posted: Mon Feb 11, 2019 11:01 am
by LeighM
Hi Gavin,
When you use Expansion modules, the project target needs to be "MIAC (dsPIC) System"
Leigh

Re: Expansion Modules dspMIAC - Error

Posted: Mon Feb 11, 2019 11:07 am
by gavo4
Oops thanks Leigh!,

Do you know why the program would reset (every 5-10 minutes) if left idle plugged in to my USB?

Re: Expansion Modules dspMIAC - Error

Posted: Mon Feb 11, 2019 11:45 am
by LeighM
Does this only happen when USB connected?

Re: Expansion Modules dspMIAC - Error

Posted: Mon Feb 11, 2019 1:18 pm
by gavo4
Hi Leigh,

Both with USB connected and unconnected, I have run the simulations and can't find a reset?

Regards,

Gavin

Re: Expansion Modules dspMIAC - Error

Posted: Mon Feb 11, 2019 1:26 pm
by LeighM
What power supply are you using for the MIAC and Expansion modules?
What voltage and current capability?

Re: Expansion Modules dspMIAC - Error

Posted: Mon Feb 11, 2019 1:29 pm
by gavo4
its a Meanwell - NES-35-12 it a 12V 3.0A Supply, supplying both the MIAC and Miac Expansion

Re: Expansion Modules dspMIAC - Error

Posted: Tue Feb 12, 2019 9:47 am
by LeighM
Hi Gavin,
OK, the PSU is good :D
I've not had chance to go through all your program, but I do see some instances of reentrancy,
that is, routines/macros calling themselves, this will cause problems, that can result in a reset.
For an example, RTC_SET calls HOUR_1 which calls RTC_SET
Leigh

Re: Expansion Modules dspMIAC - Error

Posted: Tue Feb 12, 2019 10:25 am
by gavo4
Thanks Leigh,

I just needed the program to go "back" in-case the user made an error.

Re: Expansion Modules dspMIAC - Error

Posted: Tue Feb 12, 2019 11:00 am
by LeighM
One way to do that is to use connection points to the macro end

Re: Expansion Modules dspMIAC - Error

Posted: Tue Feb 12, 2019 11:26 am
by gavo4
Thanks Leigh, how do you do that across different Macro's?

Re: Expansion Modules dspMIAC - Error

Posted: Tue Feb 12, 2019 11:49 am
by LeighM
You cannot.
But you can use it to exit from a macro when the user cancels.

Re: Expansion Modules dspMIAC - Error

Posted: Tue Feb 12, 2019 12:04 pm
by gavo4
My Apologies Leigh, do you have an example?

Re: Expansion Modules dspMIAC - Error

Posted: Tue Feb 12, 2019 12:06 pm
by gavo4
Somehow I think the issue is with all the tag routines

Re: Expansion Modules dspMIAC - Error

Posted: Tue Feb 12, 2019 1:38 pm
by LeighM
Yes, I think you are correct
There is a lot of one calling another, this will cause stack problems.
Try and get the execution back to Main, have a read up on state machines.
That is, use a state variable to decide what gets called from Main.

Re: Expansion Modules dspMIAC - Error

Posted: Tue Feb 12, 2019 2:09 pm
by gavo4
Thanks Leigh!,

Will check it out...;-)

Re: Expansion Modules dspMIAC - Error

Posted: Tue Feb 12, 2019 2:40 pm
by gavo4