This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to execute code from RAM

Hello to everyone.
How can i execute code from RAM?
I want to write a Fast interrupt-Routine, it will be called by Timer-Interrupt 200000 times per second.
The MCU is a ADUC7126 from ADI.
The compiler is the realview-compiler.

int main(void)
{
        POWKEY1 = 0x01;
        POWCON0 = 0x00;                                                         // Set core at maximum speed
        POWKEY2 = 0xF4;

        GP4DAT = 0x04000000;    // P4.2 is Output for LED and Oszilloscope

        GP1PAR = 0x11110000;
        GP1CON = 0x22220000;    // Port P1.4 to P1.7 are CLK, MISO, MOSI, CSL
        SPIDIV = 1;
        SPICON = BIT6 + BIT1 + BIT0;

        T1LD  = (41779200/200000) - 1;          // Counter Value
        T1CON = 0xC0;                           // Enabled,Periodic,Binary and CLK/1

        FIQEN = BIT3;                           // Timer1 Fast-Interrupt

        while (1){}
}
void FIQ_Handler(void) __irq
{
static unsigned long int x;
T1CLRI = 0x55;                  //  T1CLRI is an 8-bit register. Writing any value to this register clears the Timer1 interrupt.
GP4SET = 0x00040000;    //  P4.2 to "1" to see interupt-start on oszilloscope
SPITX = x >> 24;          //  Byte-1 to DAC
SPITX = x >> 16;          //  Byte-2 to DAC
SPITX = x >> 8;                   //  Byte-3 to DAC
x++;                            //  Compute next value for DAC (this is only test-example)
GP4CLR = 0x00040000;    //  P4.2 to "0" to see interrupt-ready on oszilloscope
}


How can i tell the compiler to put and execute the FIQ-Routine in RAM?
The execution speed in Ram will be doubled compared to Flash-Memory.
As you can see i am not so experiend with this topic, so i need a little help to lift me on a higher level ;-)

0