Technical discussions about the TI C55x DSPs (including the c5501, c5502, c5503, c5507, c5509, c5510 and OMAP5910).
I know it is bad form to post two articles so close together but I find myself running into another problem. I can't seem to get the watchdog Timer to enable using some simple code I have written in code composer studio. The code is as follows: // Timer Counter int *WDTIM = (int*)(0x4000); // Period Register int *WDPRD = (int*)(0x4001); // 13-12 WDOUT, 11 SOFT, 10 FREE, 9-6 PSC, 3-0 TDDR int *WDTCR = (int*)(0x4002); // 15 WDFLAG, 14 WDEN, 12 PREMD, 11-0 WDKEY static int *WDTCR2 = (int*)(0x4003); // Initialize Watchdog Timer *WDPRD = 0xFFFF; *WDTCR = 0x240F; *WDTCR2 = 0x15C6; *WDTCR2 = 0x5A7E; I am following the initialization steps found at: http://focus.ti.com/lit/ug/spru595c/spru595c.pdf However I can't seem to get the watchdog timer to reset the system as I have set, when I check the Watchdog timer register WDTIM to see if it is being decremented it is always the same value 0xec31. I am using code composer studio 3.1 and the Spectrum Digital TMS320VC5509a evaluation board. Thanks for any help you can give.
Hey,
not sure this helps but I'll give you what I use. I'm not entirely at home
with all the embedded lingo, so bear with me =)
I'm using the 5501 and for setting my WDT registers I need to use the
writeport() function. In the processor manual it says "The peripheral memory
mapped registers are accessed using the port qualifier. See the Assembly
Language Tools User's Guide (SPRU280)". Our WDT interrupt is connected to
the RESET pin, not sure if it's the same on your board.
Following is the asm-function I use to write the registers (think this is
the key to why it doesn't work for you):
// function header is void perPortRegSet(int value,int port)
_perPortRegSet:
AR0 = T1
*AR0 = T0 || writeport()
return
and then code is like this for me (ofc the registers and their addresses
might be different for you):
uint16_t prd[4] = {0xBB00,0xA0EE,0,0};/* 30 secs before trigging*/
perPortRegSet(0x003A,0x8000); //TSSR, timer signal selection register.
Determine what to do when WDT is zero
perPortRegSet(0x0000,0x4002); //WDTEMU - Emulator management register. Timer
stops on emulator suspensd event
perPortRegSet(0x0000,0x4003); //WDTCLK, Clock speed register. Fast
peripherals clock, always zero on 5501/02
//Timer Counter Registers
perPortRegSet(0x0000,0x4008); //WDTCNT1
perPortRegSet(0x0000,0x4009); //WDTCNT2
perPortRegSet(0x0000,0x400A); //WDTCNT3
perPortRegSet(0x0000,0x400B); //WDTCNT4
//Timer Period Registers
perPortRegSet(prd[0],0x400C); //WDTPRD1
perPortRegSet(prd[1],0x400D); //WDTPRD2
perPortRegSet(prd[2],0x400E); //WDTPRD3
perPortRegSet(prd[3],0x400F); //WDTPRD4
perPortRegSet(0x000B,0x4012); //WDTGCTL1, Global Timer control reg 1
perPortRegSet(0x0040,0x4010); //WDTCTL1, Timer control reg 1, timer runs
once (ENAMODE)
perPortRegSet(0x4000,0x4014); //WDTWCTL1, Enables the WDT and don't let it
enter IDLE-mode
perPortRegSet(0xA5C6,0x4015); //WDTWCTL2, Key to start WDT. 0xA5C6 followed
by 0xDA7E
perPortRegSet(0xDA7E,0x4015);
-Sima
On 10/30/07, m...@yahoo.com <m...@yahoo.com> wrote:
>
> I know it is bad form to post two articles so close together but I find
> myself running into another problem. I can't seem to get the watchdog Timer
> to enable using some simple code I have written in code composer studio. The
> code is as follows:
>
> // Timer Counter
> int *WDTIM = (int*)(0x4000);
> // Period Register
> int *WDPRD = (int*)(0x4001);
> // 13-12 WDOUT, 11 SOFT, 10 FREE, 9-6 PSC, 3-0 TDDR
> int *WDTCR = (int*)(0x4002);
> // 15 WDFLAG, 14 WDEN, 12 PREMD, 11-0 WDKEY
> static int *WDTCR2 = (int*)(0x4003);
>
> // Initialize Watchdog Timer
> *WDPRD = 0xFFFF;
> *WDTCR = 0x240F;
> *WDTCR2 = 0x15C6;
> *WDTCR2 = 0x5A7E;
>
> I am following the initialization steps found at:
> http://focus.ti.com/lit/ug/spru595c/spru595c.pdf
> However I can't seem to get the watchdog timer to reset the system as I
> have set, when I check the Watchdog timer register WDTIM to see if it is
> being decremented it is always the same value 0xec31. I am using code
> composer studio 3.1 and the Spectrum Digital TMS320VC5509a evaluation
> board. Thanks for any help you can give.
--
-Sima