Re :: Urgent problem

Started by giriec006@gmail.com, November 05, 2007, 09:33:06 PM

Previous topic - Next topic

giriec006@gmail.com

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

Andy Ayre

Having the watchdog timer enabled shouldn't cause a problem for ISP. Have you checked with a scope that the hardware timing requirements for entering ISP mode are being met at reset?

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

SeanS

Quote from: giriec006@gmail.com on November 05, 2007, 09:33:06 PM
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...?

giving an incorrect feed sequence will also cause a reset