logo elektroda
logo elektroda
X
logo elektroda

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

51 8
ADVERTISEMENT
  • #1 21657942
    Joshua Bishop
    Anonymous  
  • ADVERTISEMENT
  • #2 21657943
    Olin Lathrop
    Anonymous  
  • ADVERTISEMENT
  • #3 21657944
    Joshua Bishop
    Anonymous  
  • ADVERTISEMENT
  • #4 21657945
    Olin Lathrop
    Anonymous  
  • #5 21657946
    Olin Lathrop
    Anonymous  
  • #6 21657947
    Joshua Bishop
    Anonymous  
  • ADVERTISEMENT
  • #7 21657948
    Karl Wacker
    Anonymous  
  • #8 21657949
    Joshua Bishop
    Anonymous  
  • #9 21657950
    Karl Wacker
    Anonymous  

Topic summary

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.
Summary generated by the language model.
ADVERTISEMENT