Hi! i have use p89c669 microcontroller and am29f040b [512 kb] flash.When i using the external code memory i can't initialize the array that have more than 4 values.if i initialize more than that the program will not be executed.if i comment the array the program was executed.the code was
const char red [256] = {0x00,0x00...0x00,0x00};
please help me!
regrads, K.T.Venkatesan.
i can't initialize the array that have more than 4 values I ran into a problem once which is that if an array crosses a 64k boundary in memory it will fail.
Erik
Hi! in that case can we use two sperate arrays that each have 60kb.
regards, K.T.Venkatesan.
"in that case can we use two sperate arrays that each have 60kb"
I think Erik is saying that the issue is not the actual size of the array, but that it crosses a 64K address boundary...?
Erik is saying that the issue is not the actual size of the array, but that it crosses a 64K address boundary
"the program will not be executed"
You still need to provide more detail than that!
I have experience of the product and I might be able to help more than some other posters here; but only if you give more details.
I guess you are using banking for code space? also for data space?
If so, then what are the banking constraints?
Hi! Actualy i use the p89c669 microcontroller and amd 512 kb flash.now i had write a program for led blinking.after that program was loaded in the flash [external code memory] and the EA pin in the microcontroller was grounded.when i power on the target pcb the led was blinking as the per code.when i add an array array [76800] ={0x00,..0xfd}; in code the compiler give the error error c249:'!':SEGMENT TOO LARGE .
Last time i use the array as array[255] = {0x00,...0xff}; and load it in target board the leds was not blinking.then i change the array format as extern unsigned char const far array [256] ={0x00,...0xff} the problem was solved.
Regards, K.T.Venkatesan.
Hi! i use no more banking.
I think a close inspection of the linker map file would be appropriate.
extern unsigned char const far array [256] ={0x00,...0xff}
You can't have an initialiser on an extern declaration, can you?
Why use the 'far'? I thought that was used on cores that support 24 bit addressing.
Are you beyond 64K? Don't cross the boundary!
Check the map file.
Why use the 'far'? I thought that was used on cores that support 24 bit addressing. which the (soon to be discontinued) '669 does
View all questions in Keil forum