Hii jeremyzhou, Thank you very much for your effort. I got the point, u wanna coney. But, I am not able to implement into LPCXpresso IDE. Is it possible for you to write a demo code for me. That will be great help for me. My aim is get the time display on which the interrupt is going to perform into the MCU. And trace/display the cycles consumed by each instruction. This is my piece of code. What I want is to note down the exact time on which the _WFI(); is turning on. And also the number of cycle taken by each of the instruction (in our case ADD,NOP,ADD). So, I want to note down the cycle per instruction and the time stamps in micro/nano seconds on which _WFI(); is goin to start. Also, it will be a great help if we can get/display these things on the console window out of Debug mode or in real-time mode.
#include "board.h"
#include <time.h>
#include <stdio.h>
#define TICKRATE_HZ (1) /* 10 ticks per second */
void SysTick_Handler(void)
{
asm(
"ADD R6, R5, R4\t\n"
"NOP\t\n"
"ADD R6, R5, R4\t\n"
);
}
/* Main application entry point */
int main(void)
{
int loop = 1;
SystemCoreClockUpdate();
Board_Init();
Board_LED_Set(0, false); //0
asm(
"MOV R4,#0x0\t\n"
"MOV R5,#0x0\t\n"
"MOV R6,#0x0\t\n"
);
//SysTick_Handler;
/* Enable SysTick Timer */
SysTick_Config(SystemCoreClock / TICKRATE_HZ);
printf("hello world.\r\n");
while (1) {
__WFI();
}
return 0;
}
Kindly, reply me thank you very much.