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 don't know what your problem is, but just want to inform you that for many compilers, it is better to not add any initialization for variables that are expected to be zero on startup. Unless you make special arrangements, the startup code will automatically zero-fill all variables that haven't got specific initialization values.
Hi , I have designed a circuit with µPSD3200 which communicates with PC , µPSD3200 data to pc and gets data from pc with rs232 . i want to send and receive numbers from zero two FF , not ascii , just hex code from 00 to FF (in decimal : 0 to 255) . but , i have read that the computer and micro sends ascii code , and ascii codes does not support the whole range of 00 to FF , so what shall i do ?
omid
That has nothing to do with the subject of this thread, does it?
Start a new thread for your new subject!
"the startup code will automatically zero-fill all variables that haven't got specific initialization values."
That is to say, all non-automatic variables...
"the program will not be executed"
You need to provide more detail that that!
What debugging have you done to determine exactly how & where it is failing? Does it work in the simulator?
Are you sure that the startup code is correctly doing anything and evereything necessary to use external memory?
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
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?