??? 01/17/09 18:55 Read: times |
#161588 - Why go through all the suffering? Responding to: ???'s previous message |
Christian Meier said:
First of all, thank you everybody for your quick response, but I think I didn´t explain it in enough detail.
Actually we don´t use any external RAM. We just want to use the XRAM lines to connect the CAN-controller with the Core. To reach this goal, we built a wrapper around the core, so that we can direct the XRAM lines to the CAN-controller. We write all our programs in C, so the KEIL-compiler should use the right instructions and convert our code correctly into assembly code? If you're not VERY familiar with the Keil product, perhaps you're "shooting yourselves in the foot" by using it. This looks to me like a situation that should, under any circumstances, be handled in ASM and not in 'C' or any other HLL. Once it's in place and proven, you can try reducing the ASM portion of your code. However, if you don't know enough about this architecture to write all the code in ASM, you won't have any better result doing it in 'C'. Whether you use KEIL or anyone else doesn't matter. It's a problem best solved with ASM. If, later on, for maintainability reasons or whatever, you choose to write the code in 'C', that's your choice. To switch from the internal RAM to the external RAM we used a simple condition, to check if the value of the adressline is bigger than 0x8000. We realized that by implementing the instruction in the wrapper VHDL-file, but we didn´t change the core yet. Why go through all this pain? Can't you simply map your CAN controller into the SFR space? There's plenty of room. Maybe we have to switch to the external lines in the core and not in the wrapper?
Do we have to enable something, if we want to use external lines? First, you have to have an answer to the question, "Why should one use external memory space?" I don't know what benefit you sought by using a "wrapper". If the core you're using has the external address lines defined, and if it executes the MOVX instructions that use those address lines, you should have no difficulty. Since you're using no external memory, I see no advantage in mapping the CAN controller into external memory space. Perhaps you'd like to explain what benefit you see in doing that. RE |