PIC12F1840 not starting up
Produced a batch of boards using PIC12f1840 MCU's after successful testing of a prototype. About half of them work while the other half don't. Regular expected operation is for the device to send SPI messages continuously after boot. However, the PIC seems stuck and no messages are being sent for half the devices. Here are the troubleshooting tests I performed.
1) MCLR = enabled
- When powered up MCLR pin is low when measured with DMM. (On the good devices, the pin however, its high).
- Connecting Pickit3 makes it start working. Continues to work normally after removal of Pickit3. MCLR pin stays high after removing Pickit3 and everything seems normal.
2) MCLR = Disabled (set as input with internal weak pull up)
- When powered, it still doesn't work. MCLR pin is low when measured with DMM.
- Connecting Pickit3 makes it start working. Continues to work normally after removal of Pickit3. MCLR pin stays high after removing Pickit3.
3) MCLR = Disabled (set as input with internal weak pull up) AND connected MCLR(RA3) pin to VDD.
- When powered, its till doesn't work. MCLR pin is HIGH when measured with DMM.
- While its still powered up, disconnecting MCLR pin from VDD does nothing but MCLR pin goes low when measured with DMM.
- While its still powered up, disconnecting then reconnecting the MCLR pin from VDD makes it start working again and MCLR pin goes HIGH. MCLR pin stay high at this point even after disconnecting it from VDD.
4) Created a dummy test program with everything disabled and code to toggle each of the pins. However, I experience the same issues as above. the toggling of the pins only works when toggling the MCLR pin. Therefore, I'm ruling out SPI issues.
5) Replaced the bad MCU's with a new one and it started working normally.
6) Another major issue is some of the good working MCU's start behaving this way after some time and never to return to their good working condition.
In all cases a momentary short between MCLR and VDD causes a "reset" where the device starts to operate normally. There is a weak internal pull-up which doesn't help. I even pulled MCLR to VDD directly, but device doesn't start at power up. Only when I toggle MCLR does it start working after power up.
Am I missing something in hardware or software setup?
Could there be ESD damage?
These components were procured and assembled by an assembler in China. Could they be counterfeit MCU's?
Is my Pickit3 causing the damage/issue?