Other Parts Discussed in Thread: C2000WARE
Tool/software:
Hello there
I have the code as you see below and although I enable watchdog, I see the WDDIS register 1 in the register screen, so my watchdog does not work, what could be the reason for this, my register values seem correct, I got them all from the sysctl.h library
SysCtl_enableWatchdog(void)
{
EALLOW;
//
// Clear the disable bit.
//
HWREGH(WD_BASE + SYSCTL_O_WDCR) = (HWREGH(WD_BASE + SYSCTL_O_WDCR) &
~SYSCTL_WDCR_WDDIS) | SYSCTL_WD_CHKBITS;
EDIS;
}
where I got the above register settings
And that's my code down there.
void main(void)
{
EALLOW;
PieVectTable.TIMER0_INT = &cpu_timer0_isr;
PieVectTable.TIMER1_INT = &cpu_timer1_isr;
PieVectTable.TIMER2_INT = &cpu_timer2_isr;
EDIS;
InitCpuTimers(); // Burada config ayarları yapabilirdik
ConfigCpuTimer(&CpuTimer0, 200, 1000); //1ms
ConfigCpuTimer(&CpuTimer1, 200, 100); //100 us
ConfigCpuTimer(&CpuTimer2, 200, 40); //40us
CpuTimer0Regs.TCR.all = 0x4001;
CpuTimer1Regs.TCR.all = 0x4001;
CpuTimer2Regs.TCR.all = 0x4001;
CpuTimer2Regs.TCR.bit.TSS = 1;
init_watchdog();
reset_watchdog();
Uint32 timer1_test_counter = 0;
interrupt void cpu_timer1_isr(void)
{
if (watchdog_flag == 1)
{
reset_watchdog();
}
else
{
}
DELAY_US(1);
}
								 
				 
		 
					 
                          