How to read and write RAM in MPC5634M mcu.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to read and write RAM in MPC5634M mcu.

563 Views
venkatesanmuthu
Contributor I

Hi,

     I am new to MPC5634 mcu. Please share some example code to read and write RAM in MPC5634M. Also tell me that how I can find the start and end address. I want to do a RAM test. so please give your examples in both C language and asm.

 

thanks,

venkatesh.

 

Tags (2)
0 Kudos
1 Reply

376 Views
DjuroDrljaca
Contributor II

In C it should be very easy. First look at the data sheet and find the memory map. From that you will get your start and end address. Then you just create a pointer, set the pointer to point to the start address and then increment it until you get to the end address. It should be something similar in ASM...

 

Code in C:

uint32_t *address = (uint32_t *)RAM_START_ADDRESS_FROM_DATASHEET;uint32_t *end_address = (uint32_t *)RAM_END_ADDRESS_FROM_DATASHEET;uint32_t data = 0;while (address < end_address){    // Read data from RAM    data = *address;        // your code goes here        // Increment to next element in RAM    start_address++;}

 

0 Kudos