Dtynin
DIIDevHeads IoT Integration Server
•Created by Dtynin on 9/4/2024 in #firmware-and-baremetal
How to Store Float Calculation Results in FLASH Memory on PIC16F877A Using MPLAB X IDE?
Hello everyone, I’m currently trying to work on a project with a PIC16F877A microcontroller using MPLAB X IDE, and I’ve run into a bit of a challenge. I need to store the results of floating-point calculations in the program memory (FLASH). I thought the
__flash
qualifier might be the solution, but it turns out it doesn't directly support float data types.
To get around this, I tried converting the float results into strings using sprintf
and ftoa
, hoping to store them in FLASH that way. Unfortunately, it hasn’t worked as expected.
This’s my code:
Does anyone have any suggestions on how I can successfully store float results in FLASH memory on this microcontroller? Or is there a better approach for managing this type of data?6 replies