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
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
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 */ }