View previous topic :: View next topic |
Author |
Message |
curt2go
Joined: 21 Nov 2003 Posts: 215
|
|
Posted: Fri May 02, 2025 10:40 am |
|
|
Did some more playing around and if i set the float as 1024.XXX it is fine , it declares it properly. If I set it as 2048.XXX it declares it properly. 512.XXX does not work though.
Soooooo weird.... |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19819
|
|
Posted: Fri May 02, 2025 11:42 am |
|
|
That suggests it is Prism that is making a mistake on probably one instruction
in the compile.
Post the small program. Your screenshot is too small for me to read it.
I'll see if I can work out what combination gives a good result with it.
However not going to be quick (club event tomorrow, and then a long
trip the next day, so won't be able to get back on the Macs till probably
the middle of the week next week). |
|
 |
curt2go
Joined: 21 Nov 2003 Posts: 215
|
|
Posted: Fri May 02, 2025 12:11 pm |
|
|
Thanks.. I would love to solve it. I will work off the old setup in the time being... Appreciate all the help.
Code: |
#include <24EP512MC206.h>
#device PASS_STRINGS=IN_RAM
#device adc=12 *=16
#fuses NOJTAG, IESO, PROTECT, NODEBUG,OSCIO
#fuses NOWINDIS, NOIOL1WAY, IESO,FRC_PS//,FRC_PLL
#FUSES WDT //Watch Dog Timer
#FUSES WPRES128 //Watch Dog Timer PreScalar 1:32
#FUSES WPOSTS16 //Watch Dog Timer PostScalar 1:32768 15 // On-chip PLL setting
#use delay(clock=140000000,internal=140000000,restart_wdt)
#include <stdio.h>
#include <stdlib.h>
float version_num = 1.198;
void main(){
delay_cycles(1);
long int i;
} |
|
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19819
|
|
Posted: Sat May 03, 2025 12:26 am |
|
|
I don't see where this is outputting the float?. Or what the float is?.
If this is being displayed by the debugger in MPLAB, the this is known
sometimes to have issues.
However this cannot be the case, since this is set to NODEBUG.....
You also have the watchdog enabled. Enabling PROTECT wastes chip lives
when developing.
*=16, does nothing on a PIC24, and really you only want the single internal=
declaration, not a separate clock= declaration.
I was expecting to see something setting up a serial port, and printing a
number, to show what is happening.
However big problem is that what you have posted does not give the
hex file you say is correct, on the compiler version you have on an Intel
machine. Thought I would test this since I have a laptop with me, and it
gives a different value to your 'correct' one. Not a good start....
Are you dead sure you are using the same compiler version????
There was an issue with PCD, handling floats incorrectly a few versions
ago, and this looks suspiciously like this problem. |
|
 |
curt2go
Joined: 21 Nov 2003 Posts: 215
|
|
Posted: Mon May 05, 2025 8:14 am |
|
|
I was not outputting anything out as the value outputting was the same as what the debugger showed. So for the very small program is was just looking at it in the variables screen.
The other small things in the start i was not too concerned about , but i am glad you pointed out the protect bit. I did not know that one. I will clean somethings up on it and redo it on my end.
I for sure am using the same compiler version. But I will double check everything.
I have tried with multiple version of the compiler with all the same outcome as well. All the way back to 5.103.
I appreciate the help on this. I will repost the files. |
|
 |
curt2go
Joined: 21 Nov 2003 Posts: 215
|
|
Posted: Mon May 05, 2025 8:59 am |
|
|
Verified 5.118 on each machine
** Did another quick test, took the float declaration out and the code compiled the exact same on each machine. Just for some more reference.
Compiled code code from M4 , compiled in Production mode. But DEBUG bit set on. MPLAB 6.25
:080000000002040000000000F2
:100400000FF82700F0FF270020A0B7000000000031
:10041000C1E8A80034152000343A88007400200098
:10042000243A88004827EF0034082C000480880014
:10043000A4E42300148088000E2EEF001E2EEF008F
:100440002E2EEF004E2EEF00000000000040FE00B8
:02000004000AF0
:10AFE0004FFFFF00FFFFFF003FFFFF00DBFFFF0001
:10AFF000F9FFFF00FFFFFF00FFFFFF00FFFFFF0063
:00000001FF
;PIC24EP512MC206
;CRC=2154 CREATED="05-May-25 08:45"
Compiled code from Intel. Not running Seqouia
MPLAB 6.15
:080000000002040000000000F2
:100400000FF82700F0FF270020A0B7000000000031
:10041000C1E8A80034152000343A88007400200098
:10042000243A88004827EF000481250004808800D2
:1004300094F92300148088000E2EEF001E2EEF008A
:100440002E2EEF004E2EEF00000000000040FE00B8
:02000004000AF0
:10AFE0004FFFFF00FFFFFF003FFFFF00DBFFFF0001
:10AFF000F9FFFF00FFFFFF00FFFFFF00FFFFFF0063
:00000001FF
;PIC24EP512MC206
;CRC=8CD0 CREATED="05-May-25 08:56" |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19819
|
|
Posted: Mon May 05, 2025 10:20 am |
|
|
As a silly thing. Try #OPT 0.
The older maths bug was fixed by that, and this is so similar, that I wonder if
it is related. |
|
 |
curt2go
Joined: 21 Nov 2003 Posts: 215
|
|
Posted: Mon May 05, 2025 10:48 am |
|
|
I had tried that already..
Actually i did that in the compiler settings. ill try it in the code directly ...
Nope , no dice.... :( |
|
 |
|