Chip: PIC18f26j50
Compiler: C18
My objective is to store values in a table in the RAM memory using structures and feed in the values which are quite large.
#include <p18F46J53.h>
struct table
{
float temp;
float humidity;
float pressure;
}entry[300];
This is my sample code and I have to store such members into the controller's memory. This is for the purpose of monitoring the surrounding data of the atmosphere. And later dump this data into EEPROM.
But I am having trouble building the code as it give the following error:
Error - section '.udata_main.o' can not fit the section. Section '.udata_main.o' length=0x000013ec
I tried searching Google for fixing this udata error and ended up with How to Create Objects Larger than 256 Bytes with Microchip's MPLAB C18.
But this shows how to store each variable. How can I store struct
s in C18? Or is it impossible?
I'll try to be more specific. I found this method to store data greater than 255 bytes.
#pragma udata large_udata
unsigned char big_buff1[300];
unsigned char big_buff2[350];
#pragma udata
How can I store structures greater than that so that I would just need 3000 bytes at the for the table preparation?
I would prefer to use float
but I can settle for using int
/char
.
I hope this makes things clearer.