Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - giriec006@gmail.com

#1
LPC2xxx / Re :: Urgent problem
November 05, 2007, 09:33:06 PM
Hi all .
Presently we are working on a CAN based project using
LPC2368 ARM controller. In our application we have to RESET the
controller if a particular condition ( USB is plugged) gets
satisfied. This task has to be done by software. We are not getting
any other way to do this other than the Watch-dog Timer.We have kept
small count value ( count = FF ) and not feeding the feed sequence
again so that Watch Dog Timer should reset our controller. Is it a
good way to reset the controller using Watch dog Timer or is there
any better way to achieve this...?

Once we have downloaded the code to Flash using ISP( Incircuit
serial Programming) utility the code was working .

But it was not possible to download the code again using ISP and it
has given the message as "unable to autobaud".

Then we used the Keil ULINK2 JTAG debugger to download the code.The Hex
file was downloaded.
Then we were again able to download the code using ISP.

For the next time again it was not possible to download the code
through ISP.

If we are working without Watchdog Timer part in our code then
we dont have any problems
.[/color]

Can anybody help us in this regard..?


the code is like this


main function
{
if( USB connected )

USB configuration

............
............ // We have to receive data from User
// application and to do some processing
............

}

sub function

{
if( USB connected )

{

// Reset controller

WDTInit();

VICProtection = 0; //allow access to vic in user mode
current_interrupt_ status = VICIntEnable ; //Save a copy of the currently enabled interrupts
VICIntEnClr = current_interrupt_ status; //Clears all that were active
WDFEED = 0xAA; // Feeding sequence that does not want to be interrupted after this statement !!!!!
WDFEED = 0x55;
VICIntEnable = current_interrupt_ status; //Restore the interrupts


}

DWORD WDTInit( void )
{
// wdt_counter = 0;
// if ( install_irq( WDT_INT, (void *)IRQ_WDTHandler, HIGHEST_PRIORITY ) == FALSE )
// {
// return (FALSE);
// }

WDTC = 0x100; /* once WDEN is set, the WDT will start after feeding */
WDMOD = WDEN | WDRESET;
WDMOD = WDEN;

//WDFEED = 0xAA; /* Feeding sequence */
//WDFEED = 0x55;
return( TRUE );
}

}
}

Thanks & Regards

Giridhar