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 support@ccsinfo.com

Using the memory of the program for PIC16F54

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







Using the memory of the program for PIC16F54
PostPosted: Sun Apr 22, 2007 3:29 pm     Reply with quote


Hi all,
Whether for the PIC16F54 processor I can apply the declaration of tables in the memory of the program and next use this data like in the demonstration program.
The program is being compiled without the mistake, but I can't see in MPLAB of this data in the View->Program Memory window.
Code:

#include <16F54.h>
#fuses XT,NOWDT,NOPROTECT
#use delay(clock=4000000)
#include <ctype.h>

BYTE CONST TABLE1 [20]= {125,125,124,124,123,123,122,121,120,119,118,116,114,110,107,103,97,89,78,55};

void main() {
      ------------------------------
        f_sieci = TABLE1[7];
      ------------------------------
  }
Ttelmah
Guest







PostPosted: Sun Apr 22, 2007 3:39 pm     Reply with quote

The data won't be visible. It'll be a program!.
On the 16 chips in general, you can't perform a 'read' of the program memory. So data tables are stored as a program, comprising a table of RETLW instructions, which is called to get the right number. The 'index' is added to the address of the start of the table, and the processor jumps to the line returning the required number. It works, but makes the values stored, differ from the declared numbers.

Best Wishes
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Apr 22, 2007 4:07 pm     Reply with quote

This post contains more details:
http://www.ccsinfo.com/forum/viewtopic.php?t=25521&start=3
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