Good day,
I am compiling a program for a 12F609 and receive what looks to me an error from the build-in delay function, see attached.
Is this a known bug, or am I doing something wrong?
I can send the code if needed but rather not through the forum.
Jan Didden
Linear Audio
delay_ms compile error
-
- Flowcode v5 User
- Posts: 211
- Joined: Tue Feb 19, 2013 9:51 pm
- Has thanked: 72 times
- Been thanked: 177 times
- Contact:
Re: delay_ms compile error
The error is just before the delay function. That error is also breaking the delay function. What's just before the delay?
If your using C code, try Build/View C... and look around line 218 to spot the problem.
If your using C code, try Build/View C... and look around line 218 to spot the problem.
-
- Flowcode v5 User
- Posts: 273
- Joined: Thu Apr 17, 2008 9:59 am
- Has thanked: 19 times
- Been thanked: 16 times
- Contact:
Re: delay_ms compile error
I don't see anything funny there. And the error message does point to a redefinition issue in the PIC_CAL_Delay.c .
Here is a minimal FC with the same error, albeit in a different line (148).
Jan
Here is a minimal FC with the same error, albeit in a different line (148).
Jan
- Attachments
-
- SMS-x.fcfx
- (11.16 KiB) Downloaded 221 times
-
- Valued Contributor
- Posts: 1191
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 440 times
- Contact:
Re: delay_ms compile error
Hi Jan,
A quick look - and the problem seems to result after the asm {...} code in the main macro...
Disable this macro and it compiles ok...
Not sure what is wrong with the asm code though?
The Wiki details for asm
http://www.matrixtsl.com/wiki/index.php ... Properties
Don't seem correct...
However asm("movlw 5"); Does...
So in your macro...
Try
With each line of assembler as a single asm("..."); instruction?
etc
Martin
A quick look - and the problem seems to result after the asm {...} code in the main macro...
Disable this macro and it compiles ok...
Not sure what is wrong with the asm code though?
The Wiki details for asm
http://www.matrixtsl.com/wiki/index.php ... Properties
Don't seem correct...
Won't compileasm movlw 5
However asm("movlw 5"); Does...
So in your macro...
Try
Code: Select all
asm ("movlw 0b00110111");
etc
Martin
Last edited by mnf on Sun Jan 07, 2018 1:42 pm, edited 1 time in total.
-
- Flowcode v5 User
- Posts: 273
- Joined: Thu Apr 17, 2008 9:59 am
- Has thanked: 19 times
- Been thanked: 16 times
- Contact:
Re: delay_ms compile error
Hmmm, I need to look at that, because it is not my code as far as I can see....
Thanks, Jan
Thanks, Jan
-
- Flowcode v5 User
- Posts: 273
- Joined: Thu Apr 17, 2008 9:59 am
- Has thanked: 19 times
- Been thanked: 16 times
- Contact:
Re: delay_ms compile error
OK I see, any asm { .. } gets the error.
Still funny why it triggers a delay_ms() redefinition error...
Back to the manual.
Jan
Still funny why it triggers a delay_ms() redefinition error...
Back to the manual.
Jan
-
- Flowcode v5 User
- Posts: 273
- Joined: Thu Apr 17, 2008 9:59 am
- Has thanked: 19 times
- Been thanked: 16 times
- Contact:
Re: delay_ms compile error
Actually the specific example in the Help file is: asm movlw 5 .
Yet it throws an error.
The example statement in the Help file about an asm block seems corrupted....
Jan
Yet it throws an error.
The example statement in the Help file about an asm block seems corrupted....
Jan
-
- Valued Contributor
- Posts: 1191
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 440 times
- Contact:
Re: delay_ms compile error
Yes - might be a different compiler to when the help was written?
Did splitting to individual asm("...") statements help?
Martin
Did splitting to individual asm("...") statements help?
Martin
-
- Flowcode v5 User
- Posts: 273
- Joined: Thu Apr 17, 2008 9:59 am
- Has thanked: 19 times
- Been thanked: 16 times
- Contact:
Re: delay_ms compile error
I got bailed out by Jac Kersing from The Netherlands.
The correct syntax is:
#asm
_asm
banksel OPTION_REG
bsf OPTION_REG&0x7f,7 //set wpu through !gppu
movlw 0b00110111
banksel WPU
movwf WPU&0x7f //all wpu
_endasm
#endasm
Setting the oscillator speed by setting CONFIG register bits is no longer possible, but can be done through Build|Project Options|Configuration.
These are all changes from FC5, FC6 due to the change to the new compiler but are not yet documented in the Help file.
Thank you Jac!
Jan Didden
Linear Audio
The correct syntax is:
#asm
_asm
banksel OPTION_REG
bsf OPTION_REG&0x7f,7 //set wpu through !gppu
movlw 0b00110111
banksel WPU
movwf WPU&0x7f //all wpu
_endasm
#endasm
Setting the oscillator speed by setting CONFIG register bits is no longer possible, but can be done through Build|Project Options|Configuration.
These are all changes from FC5, FC6 due to the change to the new compiler but are not yet documented in the Help file.
Thank you Jac!
Jan Didden
Linear Audio