Discussion Forum

Power on reset problem

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Neil Peers
Posted
8-Jan-2004 17:40 GMT
Toolset
C51
New! Power on reset problem
If I power up my board the code runs but not properly, it appears to skip through delay routines instantly which is preventing correct initiation of some of the external devices.
...but if I then use the reset button on the board everything works fine.

The uc is a Philips 80C31 running at 11MHz.
The board has the reset circuitry as per the data sheet. Does anyone have any ideas as to what is going on here and what I can do to fix it? - I am going to try a longer RC period on the reset pin.


Many thanks
Read-Only
Author
erik malund
Posted
8-Jan-2004 19:21 GMT
Toolset
C51
New! RE: Power on reset problem
If I power up my board the code runs but not properly, it appears to skip through delay routines instantly which is preventing correct initiation of some of the external devices.
...but if I then use the reset button on the board everything works fine.
Best guess:
You do not initialize the delay variable in RAM. The code runs after reset, get to where init takes place and when you push the reset button, the variable has been initialized.

is this assembler or C?

Erik
Read-Only
Author
Mark Hickman
Posted
9-Jan-2004 02:00 GMT
Toolset
C51
New! RE: Power on reset problem
Hi Neil,

Just a suggestion - unfortunatly I am unable to test if true - but is it possible that the compiler is optimising out the delay?
Consider if you have the the following:-

int delay;

for (delay = 0; delay <= 32000; delay++)
{
/* dummy loop to provide delay */
/* with either nothing inside the loop */
/* or something eg. x=delay; that the compiler can safely be mode outside the loop */
}

then a 'good' compiler would see this code as apparently doing nothing and in all probability would optimise it out! so if you have delay loops done in a similar fashion, try declaring the loop counter as volatile and this should hopefully stop the compiler from removing your delay.

Mark :-)
Read-Only
Author
Neil Peers
Posted
3-Aug-2004 13:21 GMT
Toolset
C51
New! RE: Power on reset problem
Months later I hit the same problem on a different product.
The fix this time was to remove the resistor on the standard RC reset circuit. According to the data book the resistor is not necessary with the Philips 80C31 due to parasitic resistances within the device itself. Having removed the resistor the board now boots and runs correctly. This suggests that the 80C31 was not being reset correctly at power up, the RC time being too short. Removing the resistor will have increased the power on reset delay. Curious that some of the code worked correctly though.
Read-Only
Author
Stefan Duncanson
Posted
3-Aug-2004 13:40 GMT
Toolset
C51
New! RE: Power on reset problem
"Curious that some of the code worked correctly though."

Bad reset problems seem to be just as unpredictable as things like a corrupt stack. You just never really know what's going to happen.

The usual advice is to use a reset supervisor IC rather than an RC reset circuit.

Next Thread | Thread List | Previous Thread Start a Thread | Settings