Hi,
the triangle, in front of value EE (in the memory window), says that the value is not updated/refreshed/known. The reason is the COP and communication with PC. The COP is normally not debuggable because it is an reset and the communication between debugger and MCU is lost. The best way is to debug and set behavior of the CPU at the beginning of the project and then implement it into a project. Next possible debugging is to signalize COP by diodes or use UART (SCI) for sending messages to a PC. I usually use diodes as presented below (tested on TRKS12ZVL). If you want to see correct behavior of the COP the most suitable way is to disconnect BDM from the board and start the MCU by power on or reset button.
If my explaation is not clear do not hesitate to contact me again.
//------------------------------------------------------------------------------
#include <hidef.h> /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */
//------------------------------------------------------------------------------
#define LED_ID_BLUE 1
#define LED_ID_BLUERED 4
#define LED_ID_BLUEGREEN 6
#define LED_ID_RED 3
#define LED_ID_REDBLUE 4
#define LED_ID_REDGREEN 8
#define LED_ID_GREEN 5
#define LED_ID_GREENBLUE 6
#define LED_ID_GREENRED 8
#define LED_ID_BLUEREDGREEN 9
#define LED_BLUE PTP_PTP1
#define LED_RED PTP_PTP3
#define LED_GREEN PTP_PTP5
#define ON 0
#define OFF 1
#define LED_OFF_BLUE PTP_PTP3 = OFF;
#define LED_OFF_RED PTP_PTP1 = OFF;
#define LED_OFF_GREEN PTP_PTP5 = OFF;
#define LED_ON_BLUE PTP_PTP3 = ON;
#define LED_ON_RED PTP_PTP1 = ON;
#define LED_ON_GREEN PTP_PTP5 = ON;
//------------------------------------------------------------------------------
void blink(unsigned char led_id, unsigned long rpt, unsigned long dly);
void delay(unsigned long dly);
//------------------------------------------------------------------------------
void blink(unsigned char led_id, unsigned long rpt, unsigned long dly)
{
rpt = rpt * 2;
while(rpt--)
{
// blue
if(led_id == LED_ID_BLUE || led_id == LED_ID_BLUERED || led_id == LED_ID_BLUEGREEN || led_id == LED_ID_BLUEREDGREEN)
LED_BLUE = (LED_BLUE == 1) ? 0 : 1;
//red
if(led_id == LED_ID_RED || led_id == LED_ID_REDBLUE || led_id == LED_ID_REDGREEN || led_id == LED_ID_BLUEREDGREEN)
LED_RED = (LED_RED == 1) ? 0 : 1;
//green
if(led_id == LED_ID_GREEN || led_id == LED_ID_GREENBLUE || led_id == LED_ID_GREENRED || led_id == LED_ID_BLUEREDGREEN)
LED_GREEN = (LED_GREEN == 1) ? 0 : 1;
delay(dly);
}
}
//------------------------------------------------------------------------------
void delay(unsigned long dly)
{
while(dly--)
asm nop;
}
//------------------------------------------------------------------------------
void main(void)
{
//-------------------------------
DDRP_DDRP1 = 1; //LEDBLUE PORT
DDRP_DDRP3 = 1; //LEDRED PORT
DDRP_DDRP5 = 1; //LEDGREEN PORT
//-------------------------------
LED_OFF_BLUE;
LED_OFF_RED;
LED_OFF_GREEN;
//-------------------------------
blink(LED_ID_BLUE,1,0x1FFFF);
blink(LED_ID_BLUERED,1,0x1FFFF);
blink(LED_ID_BLUEGREEN,1,0x1FFFF);
blink(LED_ID_RED,1,0x1FFFF);
blink(LED_ID_REDGREEN,1,0x1FFFF);
blink(LED_ID_GREEN,1,0x1FFFF);
blink(LED_ID_BLUEREDGREEN,1,0x1FFFF);
//-------------------------------
if (CPMURFLG_COPRF)
{
blink(LED_ID_BLUE,5,0x3FFFF);
}
//-------------------------------
if (CPMURFLG_PORF)
{
blink(LED_ID_RED,5,0x1FFFF);
}
//-------------------------------
CPMURFLG = 0x6B; //clear all flags
for(;;)
{
CPMUCOP=0x07; //init COP watchdog
CPMUARMCOP=0x00; //immediate reset MCU
}
//-------------------------------
}
//------------------------------------------------------------------------------