Build error - when creating char array

Status
Not open for further replies.

MrNobody

New Member
Hi,
I was trying to create a char array of size 800.
The idea is to sample the ADC at 8kHz, store the data in array and send it over the internet after every 800 data. In another words, in 1 second, i will be sending 10 X 800 bytes of daya data. However, there is an error when I compile it.

Below is the code.
Code:
char sampleData1 [800];

Below is the error
Code:
MPLINK 4.13, Linker
Copyright (c) 2007 Microchip Technology Inc.
Error - section '.udata_PIC18F2550 - Interrupt 1.o' can not fit the section. Section '.udata_PIC18F2550 - Interrupt 1.o' length=0x000001a6
Errors    : 1

Link step failed.
BUILD FAILED: Fri Apr 25 18:28:48 2008

By the way, when i change the array size to 100, the problem disappears.
Any advice on how I can make the array size to be 800..?
Thanks
 
You could create 3 * 256 byte buffers and a 32 byte buffer to store your data. Your store routine would have to be something like,
Code:
void Store(unsigned char Data, int Address){
    switch(Address/256){
        case 0:
            Array0[Address & 255]=Data;
            break;
        case 1:
            Array1[Address & 255]=Data;
    etc.

The Retrieve routine would be similar.

Mike.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…