Page 2 of 2

Re: Fixed frequency timed output

Posted: Tue Nov 17, 2020 9:03 pm
by medelec35
Hi Bob,
maybe best to try on hardware.
I can see where there would be a stack issue.
Unless the I2C backpack is causing an issue with the stack?
Perhaps matrix staff would know the answer?
I'm note sure how to increase software stack with XC8?

Re: Fixed frequency timed output

Posted: Tue Nov 17, 2020 10:06 pm
by siliconchip
hi martin
thanks for your help again, with regards stack would using a different chip help ?? i agree i need to use hardware to test i thought using proteus would be quicker and easier for now, if any matrix staff are looking it would be great for any explanation. As always martin thanks for your help but ive got a feeling i will be back lol

bob

Re: Fixed frequency timed output

Posted: Wed Nov 18, 2020 2:59 pm
by Benj
Hello,

I'm fairly sure the compiler in v7 and v8 will automatically use a software stack if required so it could be either proteus is throwing a warning that isn't a problem or there is a serious stack issue in your program and you have function A calling function B calling function A etc.

If you post your latest program we can have a look for this.

Re: Fixed frequency timed output

Posted: Wed Nov 18, 2020 4:42 pm
by siliconchip
Hi benj
Thanks for the reply my program is the one a couple of posts ago 60Hz freq v2 i would appreciate any input from you cheers

Bob

Re: Fixed frequency timed output

Posted: Wed Nov 18, 2020 5:10 pm
by Benj
Make sure the Sim property is set to No before compiling. That's the only thing I can spot.

Re: Fixed frequency timed output

Posted: Wed Nov 18, 2020 5:54 pm
by siliconchip
hi benj
how would i set sim property to no ???

bob

Re: Fixed frequency timed output

Posted: Thu Nov 19, 2020 2:34 pm
by Benj
Hello,

With nothing selected just look at the properties window.
SimProp.jpg
SimProp.jpg (9.63 KiB) Viewed 5441 times

Re: Fixed frequency timed output

Posted: Thu Nov 19, 2020 3:14 pm
by siliconchip
hi benj
i clicked on the properties and sim already there as a No ???,i clicked on yes then back to no and recompiled but no change therefore i guess hardware testing is the only option now in case proteus is over reacting ? just out of curiosity ive added what proteus is displaying when it fails if this helps


[PIC16 CORE] PC=0x04C0. Stack overflow executing CALL instruction. [U1]

in the source code this comes back as - FCV_FREQ=FCV_TIMERTICK/2

[PIC16 CORE] PC=0x04D5. Stack underflow executing RETURN instruction. [U1]

in source code box this comes back as, - FCV_SQUAREWAVEENABLE=0,

[PIC16 CORE] PC=0x04D8. Stack underflow executing RETURN instruction. [U1]

in source code = FCP SET(B, A, 0X01, 0, (0) ),

[PIC16 CORE] PC=0x070F. Stack underflow executing RETFIE instruction. [U1]

in source code = void FCD_0c591_lcd_I2C1__Cursor(MX_UINT8 FCL_X,MX_UINT8, FCL_Y)

The above flag multiple times if left running

bob

Re: Fixed frequency timed output

Posted: Sun Nov 29, 2020 12:20 pm
by siliconchip
hi all
quick up date with the issues ive been having while trying to simulate my code within proteus, i was using the pic16f877 but proteus software kept flagging stack underflow etc and failed to simulate after a few seconds of running, the ultimate solution would of been too build the circuit in hardware but it turned out i didn't have an 877 :oops: :oops: anyways i opted for a 16f1825 changed my code and proteus now runs the simulation with no issues, next step using hardware i built the circuit with the 1825 and had no issues it ran perfectly, flowcode also when compiling with the 1825 gave me no stack warnings as it did with the 877, so there is obviously differences with the stack of the 2 chips, and upon reflection maybe the 877 was the wrong choice anyway as the 1825 is only a 14 pin device compared to the physically larger 877, thanks to everyone who helped with this issue

bob