Hi all,
I'm have a EB058/057 gLCD display, all set up and running using a PIC16F877A all works fine when I call the the commands in the main program. However when I move these calls into a Macro the last print command scrolls and overwrites itself. I'm using Flowcode4 with PIC_gLCD.c version 300410 as instructed from this forum.
Any clues??
swatzy
gLCD in Macro Issue
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
Re: gLCD in Macro Issue
It feels something like that,
I guess the big question is Why does me calling it as a macro cause this sort of error.
I guess the big question is Why does me calling it as a macro cause this sort of error.
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
- 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: gLCD in Macro Issue
Hello,
The 16F877 has only around 8 layers of hardware stack. Each jump to a macro or interrupt routine will consume one layer of the stack.
This topic details how to implement the BoostC software stack.
http://www.matrixmultimedia.com/mmforum ... ack#p19591
I will look into the code to see if I can spot why this is causing stack errors when it is running inside a macro.
The 16F877 has only around 8 layers of hardware stack. Each jump to a macro or interrupt routine will consume one layer of the stack.
This topic details how to implement the BoostC software stack.
http://www.matrixmultimedia.com/mmforum ... ack#p19591
I will look into the code to see if I can spot why this is causing stack errors when it is running inside a macro.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: gLCD in Macro Issue
Here's the sourcecode. Thanks for replies so far.
- Attachments
-
- testglcd2.fcf
- glcd call macro
- (10.5 KiB) Downloaded 333 times
Re: gLCD in Macro Issue
It was indeed the stack, added -swcs 6 2 to the linker parameters in the compiler options and it all goes. I think I'll need to use an 18 series PIC tho'
Thanks for help
Thanks for help