Expansion Modules dspMIAC - Error

For MIAC users to discuss projects, applications, and any other issues related to the MIAC unit.

Moderators: Benj, Mods

Post Reply
gavo4
Posts: 92
Joined: Sat Aug 25, 2018 7:58 pm
Been thanked: 8 times

Expansion Modules dspMIAC - Error

Post 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 14085 times

gavo4
Posts: 92
Joined: Sat Aug 25, 2018 7:58 pm
Been thanked: 8 times

Re: Expansion Modules dspMIAC - Error

Post 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 14084 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Expansion Modules dspMIAC - Error

Post 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

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Expansion Modules dspMIAC - Error

Post by LeighM »

Hi Gavin,
When you use Expansion modules, the project target needs to be "MIAC (dsPIC) System"
Leigh

gavo4
Posts: 92
Joined: Sat Aug 25, 2018 7:58 pm
Been thanked: 8 times

Re: Expansion Modules dspMIAC - Error

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

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Expansion Modules dspMIAC - Error

Post by LeighM »

Does this only happen when USB connected?

gavo4
Posts: 92
Joined: Sat Aug 25, 2018 7:58 pm
Been thanked: 8 times

Re: Expansion Modules dspMIAC - Error

Post by gavo4 »

Hi Leigh,

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

Regards,

Gavin

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Expansion Modules dspMIAC - Error

Post by LeighM »

What power supply are you using for the MIAC and Expansion modules?
What voltage and current capability?

gavo4
Posts: 92
Joined: Sat Aug 25, 2018 7:58 pm
Been thanked: 8 times

Re: Expansion Modules dspMIAC - Error

Post by gavo4 »

its a Meanwell - NES-35-12 it a 12V 3.0A Supply, supplying both the MIAC and Miac Expansion

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Expansion Modules dspMIAC - Error

Post 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

gavo4
Posts: 92
Joined: Sat Aug 25, 2018 7:58 pm
Been thanked: 8 times

Re: Expansion Modules dspMIAC - Error

Post by gavo4 »

Thanks Leigh,

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

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Expansion Modules dspMIAC - Error

Post by LeighM »

One way to do that is to use connection points to the macro end

gavo4
Posts: 92
Joined: Sat Aug 25, 2018 7:58 pm
Been thanked: 8 times

Re: Expansion Modules dspMIAC - Error

Post by gavo4 »

Thanks Leigh, how do you do that across different Macro's?

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Expansion Modules dspMIAC - Error

Post by LeighM »

You cannot.
But you can use it to exit from a macro when the user cancels.

gavo4
Posts: 92
Joined: Sat Aug 25, 2018 7:58 pm
Been thanked: 8 times

Re: Expansion Modules dspMIAC - Error

Post by gavo4 »

My Apologies Leigh, do you have an example?

gavo4
Posts: 92
Joined: Sat Aug 25, 2018 7:58 pm
Been thanked: 8 times

Re: Expansion Modules dspMIAC - Error

Post by gavo4 »

Somehow I think the issue is with all the tag routines

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Expansion Modules dspMIAC - Error

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

gavo4
Posts: 92
Joined: Sat Aug 25, 2018 7:58 pm
Been thanked: 8 times

Re: Expansion Modules dspMIAC - Error

Post by gavo4 »

Thanks Leigh!,

Will check it out...;-)

gavo4
Posts: 92
Joined: Sat Aug 25, 2018 7:58 pm
Been thanked: 8 times

Re: Expansion Modules dspMIAC - Error

Post by gavo4 »


Post Reply