logo elektroda
logo elektroda
X
logo elektroda

PIC16LF877A first 8 program memory bytes read as 0x3FFF after power-up—why?

246 8
ADVERTISEMENT
  • Possible flash corruption from power-up or brown-out events

    #1 21657942
    Joshua Bishop
    Anonymous  
  • ADVERTISEMENT
  • Suggest checking Vdd spikes, grounding, brownout, and MCLR

    #2 21657943
    Olin Lathrop
    Anonymous  
  • ADVERTISEMENT
  • Floating MCLR suspected as cause of memory corruption

    #3 21657944
    Joshua Bishop
    Anonymous  
  • ADVERTISEMENT
  • Brownout and MCLR wiring likely not the cause

    #4 21657945
    Olin Lathrop
    Anonymous  
  • #5 21657946
    Olin Lathrop
    Anonymous  
  • ADVERTISEMENT
  • MCLR jumper with resistor and bypass capacitor concern

    #6 21657947
    Joshua Bishop
    Anonymous  
  • #7 21657948
    Karl Wacker
    Anonymous  
  • Speaker transients and decoupling may be causing noise issue

    #8 21657949
    Joshua Bishop
    Anonymous  
  • #9 21657950
    Karl Wacker
    Anonymous  

Topic summary

LABEL_AI_GENERATED
A PIC16LF877A microcontroller exhibits an issue where the first eight program memory bytes read as 0x3FFF after power-up, indicating apparent erasure. This occurs intermittently on both low voltage TQFP and normal voltage DIP packages. The problem may be related to improper MCLR pin handling, as the MCLR was initially left floating and later tied directly to VDD without a resistor, potentially causing unintended resets or programming mode entry due to voltage transients or ESD. Brown-out detection is disabled, which could allow unstable power conditions to corrupt memory. Bypass capacitors are present but not optimally placed near the VDD pins, possibly allowing noise or inductive transients from a connected speaker to affect operation. Suggestions include adding a resistor (e.g., 20 kΩ) between VDD and MCLR, ensuring proper bypass capacitor placement with ceramic capacitors close to power pins, protecting against speaker-induced inductive spikes with diodes, enabling brown-out detection, and verifying whether code space self-write operations might be inadvertently erasing memory. The PICkit 2 programmer shows the first eight bytes as erased, but the rest of the program memory appears intact. The root cause likely involves power supply noise, MCLR pin misconfiguration, or unintended self-programming rather than normal device behavior.
AI summary based on the discussion. May contain errors.
ADVERTISEMENT