|
|
View previous topic :: View next topic |
Author |
Message |
Maciek Guest
|
Using the memory of the program for PIC16F54 |
Posted: Sun Apr 22, 2007 3:29 pm |
|
|
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
|
|
Posted: Sun Apr 22, 2007 3:39 pm |
|
|
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
|
|
|
|
|
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
|