hi everybody
well i am trying to explore the WDT in LPC 2129.
I am displaying a hex value through UART when WDT generates the
interrupt.
but iam not able to get interrupt .
can any one tell me how to do this
thanks
WDT
Started by ●June 20, 2005
Reply by ●June 21, 20052005-06-21
Hi,
Please show your source code to do this.
Suriyan.
--- In lpc2000@lpc2..., "seeessarr" <csr1981@r...> wrote:
> hi everybody
>
> well i am trying to explore the WDT in LPC 2129.
> I am displaying a hex value through UART when WDT generates the
> interrupt.
> but iam not able to get interrupt .
> can any one tell me how to do this
>
> thanks
Please show your source code to do this.
Suriyan.
--- In lpc2000@lpc2..., "seeessarr" <csr1981@r...> wrote:
> hi everybody
>
> well i am trying to explore the WDT in LPC 2129.
> I am displaying a hex value through UART when WDT generates the
> interrupt.
> but iam not able to get interrupt .
> can any one tell me how to do this
>
> thanks
Reply by ●June 21, 20052005-06-21
thanks Suriyan for ur response.
well i was able to get the interrupt from the WDT but i am not able to acknowledge the same i.e. when the watchdog interrupt occurred i displayed a value through UART.But the value was continuously displayed.
the source code is as follows:-
************************************************************
#define VICINTSEL (volatile unsigned int *)0XFFFFF00C
#define VICVECTADDR0 (volatile unsigned int *)0xFFFFF100
#define VICVECTCNTL0 (volatile unsigned int *)0xFFFFF200
#define VICINTEN (volatile unsigned int *)0xFFFFF010
#define VICVECTADDR (volatile unsigned int *)0xFFFFF030 #define WDMOD (volatile unsigned int *)0xE0000000
#define WDTC (volatile unsigned int *)0xE0000004
#define WDFEED (volatile unsigned int *)0xE0000008
#define WDTV (volatile unsigned int *)0xE000000C
extern UART(int);
void WDINT(void) __attribute__((interrupt("irq")));
main()
{
int i,j;
UART(0x111);
*VICVECTADDR0=(unsigned int)&WDINT;
*VICINTSEL=0X00000000; /*to enable each interrupt as IRQ*/
*VICVECTCNTL0=0X00000020; /*to control the WD interrupt i.e. 1st bit*/
*VICINTEN=0X00000001; /*to enable WD interrupt*/
*WDTC=0x00Cccc00;
*WDMOD=0x00000001;
*WDFEED=0xAA;
*WDFEED=0x55;
j=*WDMOD;
UART(j);
__asm__("MRS R0,CPSR"); /*ENABLING THE IRQ*/
__asm__("MVN R1,#0X80");
__asm__("AND R0,R0,R1");
__asm__("MSR CPSR,R0");
while(1);
} void WDINT()
{
int k;
k=*WDMOD;
*WDMOD=0x01;
*WDFEED=0xAA;
*WDFEED=0x55;
UART(0x123);
*VICVECTADDR=0x00000000;
}
****************************************************************
thanks
and regards
Chetan
On Tue, 21 Jun 2005 misstero wrote :
>Hi,
>Please show your source code to do this.
>Suriyan.
>--- In lpc2000@lpc2..., "seeessarr" <csr1981@r...> wrote:
>> hi everybody
>>
>> well i am trying to explore the WDT in LPC 2129.
>> I am displaying a hex value through UART when WDT generates the
>> interrupt.
>> but iam not able to get interrupt .
>> can any one tell me how to do this
>>
>> thanks
>Yahoo! Groups Links
>To br> >.
>
Reply by ●June 21, 20052005-06-21
Hi,
On Tuesday 21 June 2005 16:09, chetan s rao wrote:
> well i was able to get the interrupt from the WDT but i am not
> able to acknowledge the same i.e. when the watchdog interrupt
> occurred i displayed a value through UART.But the value was
> continuously displayed.
I think you toggle the watchdog. This will restart the time
measurements. After the next timeout you get a new interrupt. --
Steffen Rose
On Tuesday 21 June 2005 16:09, chetan s rao wrote:
> well i was able to get the interrupt from the WDT but i am not
> able to acknowledge the same i.e. when the watchdog interrupt
> occurred i displayed a value through UART.But the value was
> continuously displayed.
I think you toggle the watchdog. This will restart the time
measurements. After the next timeout you get a new interrupt. --
Steffen Rose