On 25/11/2010 9:28 AM, ivp wrote: >> We replaced the PIC in the first faulty unit and it is behaving >> correctly now > Do you mean you have two problems - a faulty chip and a power- > up issue ? Hi Joe, I mean replacing the chip made the power-up issue go away for that=20 board. No other changes were made. Exact same PCB and firmware loaded. >> The PIC has a 10K resistor from MCLR to Vdd, but no capacitor >> to Vss. If I reset it by shorting to Vss, the unit works fine again. >> It's only when the board is first powered up that the fault occurs > If you change nothing else, a cap would ensure that Vdd gets up > before /mclr, holding the chip in reset. However, PWRTE is meant > to perform that task That's what I will be trying next I think. I left it off as I'm new to=20 ICSP, and just having the 10K pullup seems to satisfy the MCLR=20 requirements (low capacitance on the line) from what I have read. >> It's almost as though the UART is not initialising correctly. I have >> PWRTE enabled and the watchdog disabled > If the receiver is powering-up before the PIC then the PIC will be > seeing noise from the Data output, and that could be going into the > UART buffer. I wonder if this noise is getting to the PIC's Vdd > internally via the protection diodes before the PIC has powered > up properly from the supply rail > > In projects of mine that use a receiver, the receiver's Vdd is sourced > from the PIC, and is supplied only after the PIC has initialised. Done > that way not with power-up in mind, but for power-saving during > normal operation The receiver is powered all the time, but its output goes to an NPN=20 transistor that has a pull-up to Vdd. There is code in the receive ISR=20 to dump bad packets and synchronise, but it seems like the receiver is=20 just not listening. I may have to add some additional code to output=20 the state of the UART via a spare pin. >> If I power it down and back up again however, it fails to respond >> to commands via the UART > Powering down may not allow enough energy to dissipate to cause > a reset before powering up again, especially now that micros are such > low power devices.. If you try one of those power downs and ground > /mclr you may find it does reset properly Powering up with 0V all round (left to sit for any more than a couple of=20 seconds) is when the issue occurs. David... --=20 ___________________________________________ David Duffy Audio Visual Devices P/L Unit 8, 10 Hook St, Capalaba 4157 Australia Ph: +61 7 38235717 Fax: +61 7 38234717 Our Web Site: www.audiovisualdevices.com.au ___________________________________________ --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .