Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top