Hello, We are using PK51 for our project using code banking technique. For this we have created 3 source files, 1. One is for common area which contains time ISR, Serial Part ISR and function which are common for anther 2 banks. 2. 2nd source file will load in bank "0" 3. 3rd source file will load in bank "1" Now we having variable for these 3 files. We declared these variables in common source file and declared them variables as external for remaining 2 files. We are having constant variables which are same for these 3 files. But when we compile; PK51 gives us error and it is required that we have to defined these constants variables with separate names in 3 same files. Is there any method like "external variables" so that we can define this constant single time? Example: Part1.c >>> part1.h Part2.c>>> part2.h Part3.c >>> part3.h Constants Part1.h Unsigned char code xyz = {0x01,0X02,0x03}; Part2.h Unsigned char code pqr = {0x01,0X02,0x03}; Part2.h Unsigned char code lmn = {0x01,0X02,0x03};
"Part1.h Unsigned char code xyz = {0x01,0X02,0x03}; Part2.h Unsigned char code pqr = {0x01,0X02,0x03}; Part2.h Unsigned char code lmn = {0x01,0X02,0x03}; " These look like attempts at definitions (with initialisations) - even after fixing the fundamental syntax errors, they should certainly not be in header files! Header files should contain only declarations Every symbol must have exactly one definition - you can have as many declarations for it as you like. Standard 'C' textbook stuff, or try a search of the forum for posts containing both "declaration" and "definition" - there's loads of 'em!