logo elektroda
logo elektroda
X
logo elektroda

PIC16F1779 not running code after programming with MPLABX and PICKit3, MPASM code

45 20
ADVERTISEMENT
  • #1 21679491
    Paul Bowden
    Anonymous  
  • ADVERTISEMENT
  • #2 21679492
    Elizabeth Simon
    Anonymous  
  • #3 21679493
    Rick Curl
    Anonymous  
  • #4 21679494
    Paul Bowden
    Anonymous  
  • ADVERTISEMENT
  • #5 21679495
    Paul Bowden
    Anonymous  
  • #6 21679496
    Paul Bowden
    Anonymous  
  • #7 21679497
    Mike Hibbett
    Anonymous  
  • #8 21679498
    Rick Curl
    Anonymous  
  • ADVERTISEMENT
  • #9 21679499
    Rick Curl
    Anonymous  
  • #10 21679500
    Paul Bowden
    Anonymous  
  • #11 21679501
    Aubrey Kagan
    Anonymous  
  • #12 21679502
    Paul Bowden
    Anonymous  
  • #13 21679503
    Peter White
    Anonymous  
  • ADVERTISEMENT
  • #14 21679504
    Peter White
    Anonymous  
  • #15 21679505
    Paul Bowden
    Anonymous  
  • #16 21679506
    Mike Hibbett
    Anonymous  
  • #17 21679507
    Paul Bowden
    Anonymous  
  • #18 21679508
    Rick Curl
    Anonymous  
  • #19 21679509
    Paul Bowden
    Anonymous  
  • #20 21679510
    Paul Bowden
    Anonymous  
  • #21 21679511
    Paul Bowden
    Anonymous  

Topic summary

A user experienced an issue where a PIC16F1779 microcontroller programmed with MPASM code via MPLABX and PICKit3 would not execute the code despite successful programming and verification. The oscillator functioned correctly, and pins remained in their default high-impedance state without toggling as expected. The same code worked on a PIC16F1789 device. Troubleshooting steps included verifying correct TRIS, PORT, LAT, and ANSEL register settings, disabling MCLR and low-voltage programming (LVP), checking power and ground connections, and ensuring no peripherals conflicted with the toggled pins. Debugging revealed that the MOVLB instruction, used to switch register banks, was incorrectly assembled by the MPLABX assembler in version 3.15 for the PIC16F1779, generating an invalid opcode (0x014n instead of 0x002n). This caused bank switching to fail, preventing proper register access and program execution. Workarounds included replacing MOVLB with MOVLW and MOVWF BSR instructions. Attempts to upgrade MPLABX to version 4.15 failed on the user's Windows XP system, but version 3.65 installed successfully and contained the corrected assembler behavior for MOVLB. After switching to MPLABX v3.65, the code assembled correctly, and the PIC16F1779 ran the program as expected. The issue was traced to a Microchip assembler bug affecting the PIC16F1777/78/79 devices in the enhanced PIC16F1XXX family, where MOVLB was wrongly encoded. This problem did not affect other family members like PIC16F1773/76. The discussion highlights the importance of verifying assembler output and toolchain versions when encountering unexpected device behavior.
Summary generated by the language model.
ADVERTISEMENT