|
|
View previous topic :: View next topic |
Author |
Message |
theproff
Joined: 04 Feb 2005 Posts: 4
|
code example please |
Posted: Fri Feb 04, 2005 10:21 am |
|
|
Could someone give me an example on how to store an array of data to a fixed address in flash, this would obviously be const data..
thanks
theproff |
|
|
piedos
Joined: 14 Mar 2005 Posts: 5 Location: TURKEY/Ankara
|
|
Posted: Wed May 18, 2005 1:59 pm |
|
|
const char array[]={a,b,c,d,e,f,g,h,i,j,k,l,m}; _________________ ---------------------------------------------------------
The only thing that equally given mankind is time. |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Thu May 19, 2005 7:40 am |
|
|
This area is for POSTING code, not for ASKING for code. That being said.
Code: | ///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
#include <16F877.h>
#device *=16
#use delay(clock=16000000)
#fuses HS,NOWDT,NOLVP,
#use rs232(baud=19200,xmit=PIN_C4,INVERT,stream=DEBUG) // STDERR(same as DEBUG)
#case
#zero_ram
#RESERVE 0x110:0x17F
int8 buffer[112];//bigest size of block in 16F877 16+80+16=112
#BYTE buffer=0x110
//======================= Main ==============================
void main(void)
{
int8 i;
fprintf(DEBUG,"Starting\n\r");
for (i=0;i<112;i++)
{
buffer[i]=i;
fprintf(DEBUG,"%u\n\r",buffer[i]);
}
while(1)
{
}
}
|
See how I made a big array. Then the #byte says "store this variable at this location". ((This is also the technique to overlay variables on the physical pins of the PIC)) |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|