I am using SPI communication between Analog device ADuC848 and some other chip. For this ADuC848 chip, I have a very strange initialization problem I am not sure if it relates to Keil or the chip itself.
I defined a struct like below typedef struct { UINT8 cmdHeader; UINT8 cmdCRC; UINT8 outputmessage[SPIMESSAGE_SIZE]; UINT8 Num_Output_Byte; UINT8 Num_Input_Byte; SpiCode_T cmdType; BOOLEAN AccessToken; void (*cmdFunc)(void); } SpiCmdStruct_T;
And then I initalize my cmd table like below SpiCmdStruct_T cSpiCmdTbl[240] = { {0, 0xac, "\0", 2, 0, SPI_QUERY, TRUE, NULL}, ... },
after I download the code to the chip, I found that in my cSpiCmdTbl only the first 112 (0x70) item match what I assigned. From item 113 to 239 (0x71 to 0xEF), all the values are totally wrong.
Anybody have an idea what is going on?
Thanks in advance. DG
Sorry, it is my bad that I come here to post a question without structure the post nicely. I apologize for that.
Anyway, I found out the problem myself. thanks again.
And if you post the found solution to your problem, someone else may pick up the answer when they google and find this thread.
Hi, We are very interested in your findings...Will you share them with us?
I was trying to figure out why it stops at 112. When I times 112 with the length of my structure, it is slightly bigger than 2k. I tried to make my struct smaller so the total array is less than 2k. and it worked.