Hi ,
I'm trying to compile FF for pic24 , and also have a lot of these errors : Error: non-constant expression in ".if" statement.
What could be the cause of this ? I don't have a clue so far.
I'm using the latest mplab x ide and xc16.
Regards,
Ronny
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When you clone the repository , the project has as default a not supported chip. I need to fix that.
Look in config.c and ff24.inc for supported chips. PIC24FJ128GB202 for example.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Mikael ,
I'm starting again with the new FF5 you uploaded today.
I realy want to compile ff5 and using a pic24fj256ga705 as soldered on a curiousity board from farnell.
I've set project configuration to this chip and using the xc compiler.
Again lots of errors.
The first is : ../src/ff24.inc:447: Error: can't open p24fj_ga_705.inc for reading
I'm trying to locate this file at the moment ...
Can you help me on this one to start with ?
Regards,
Ronny
BTW : If we can solve together this issues then I will write a guide on how to compile for pic24 and you maybe can put it on the website .
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the uart code , missed it yesterday.
I programmed the board and it works :-)
Thanks again.
One thing to mention : The baudrate should be 38400 , but it's 9600 !
Thats exacly 1/4th. I think , and correct me if I'm wrong , that this could be due to the fact that you're using the fastrc oscillator without the pll. So the cpu frequency is 8Mhz instead of 32Mhz.
The board has indeed no xtal connected , so frc is the best option , but why not using the pll to do a *4 . According to the datsheet it's possible.
Kind regards,
Ronny
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, You can use the FRCPLL just by changing the configs.c. I change the config in various ways for testing and the uploaded configs are not always sane if I forget to check it.
#pragma config FNOSC = FRCPLL
You can also change FREQ_OSC to 8000000, then the 38400 baud rate should work using the FRC without the PLL.
BR Mikael
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi ,
I'm trying to compile FF for pic24 , and also have a lot of these errors : Error: non-constant expression in ".if" statement.
What could be the cause of this ? I don't have a clue so far.
I'm using the latest mplab x ide and xc16.
Regards,
Ronny
When you clone the repository , the project has as default a not supported chip. I need to fix that.
Look in config.c and ff24.inc for supported chips. PIC24FJ128GB202 for example.
Hi Mikael ,
I'm starting again with the new FF5 you uploaded today.
I realy want to compile ff5 and using a pic24fj256ga705 as soldered on a curiousity board from farnell.
I've set project configuration to this chip and using the xc compiler.
Again lots of errors.
The first is : ../src/ff24.inc:447: Error: can't open p24fj_ga_705.inc for reading
I'm trying to locate this file at the moment ...
Can you help me on this one to start with ?
Regards,
Ronny
BTW : If we can solve together this issues then I will write a guide on how to compile for pic24 and you maybe can put it on the website .
I uploaded a fix for ff24.inc, it should reference p24fj_ga_config.inc.
There you should change these lines.
It runs in the simulator. But I do not know if it works on the hardware.
At least you may need to adjust the UART pin settings.
BR Mikael
In the simulator it seems the EEPROM emulation in flash is broken for the pic24fj256ga705.
I'll check it.
OK thanks !
I will update the changes and see how it goes.
Mikael ,
It compiles now ! Hope you can find the flaw in the eeprom emulation in flash.
Meanwhile I will try to figure out the pin mapping for uart1.
For the curiousity board RB0 for tx and RB1 for rx would be nice.
I think this should do it.
I could not find a fault in the eeprom emulation code. Hopefully it is just a problem with with the simulator.
ok thanks ! I'm busy trying to understand the uart mapping , and I will flash the pic after that.
Let you know how it goes.
Greets ,
Ronny
Hi Mikael ,
Thanks for the uart code , missed it yesterday.
I programmed the board and it works :-)
Thanks again.
One thing to mention : The baudrate should be 38400 , but it's 9600 !
Thats exacly 1/4th. I think , and correct me if I'm wrong , that this could be due to the fact that you're using the fastrc oscillator without the pll. So the cpu frequency is 8Mhz instead of 32Mhz.
The board has indeed no xtal connected , so frc is the best option , but why not using the pll to do a *4 . According to the datsheet it's possible.
Kind regards,
Ronny
Good to hear it works.
Well, You can use the FRCPLL just by changing the configs.c. I change the config in various ways for testing and the uploaded configs are not always sane if I forget to check it.
You can also change FREQ_OSC to 8000000, then the 38400 baud rate should work using the FRC without the PLL.
BR Mikael
Mikael,
Adding the pragma changes the baudrate to 38400 as it should.
Does this mean the cpu now effectively runs at 32Mhz ?
Regards,
Ronny
Yes. The CPU now runs at 32 MHz, 16 MIPS.
Great !!!