CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

code example please

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
theproff



Joined: 04 Feb 2005
Posts: 4

View user's profile Send private message

code example please
PostPosted: Fri Feb 04, 2005 10:21 am     Reply with quote

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

View user's profile Send private message Send e-mail ICQ Number

PostPosted: Wed May 18, 2005 1:59 pm     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Thu May 19, 2005 7:40 am     Reply with quote

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))
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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