Douglas Wood wrote: > > How do you run code while Vdd is powering up? Isn't this a typical PIC startup problem? The MCLR is referenced to Vdd, so if MCLR is tied to Vdd they will both rise together, and the the PIC will start executing code possibly about 2.5v, anyway well before Vdd reaches 5v. With some simpler circuits I found it useful to keep the pins in a *known* state, the best for my apps is as outputs at 0v. Once the time has elapsed and you are sure the Vdd has stabilised you can set the pins as inputs where needed and start all the other processes. Someone mentioned that during startup the pins should be held in whichever state will make the circuit draw the least current, so Vdd reaches 5v soonest. This is right, but if they are "high" outputs they will possibly go through undefined stages as Vdd rises. I prefer with simple circuits to design the whole thing so "low" outputs are best during startup mode ("high" outputs drive things). Obviously using a MCLR delay cap or a reset chip would change everything, but again with a simple circuit the MCLR cap would cause ICSP problems and a reset chip adds cost and complexity. This is just one way of going about a difficult problem. :o) -Roman -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu