logo elektroda
logo elektroda
X
logo elektroda

PIC12f629 LED Not Lighting Using XC8 MPLAB X, Microbrn, K150 Programmer

93 19
ADVERTISEMENT
  • #1 21669896
    Sean Ulyate
    Anonymous  
  • ADVERTISEMENT
  • #2 21669897
    Geoff Lancaster
    Anonymous  
  • #3 21669895
    Geoff Lancaster
    Anonymous  
  • ADVERTISEMENT
  • #4 21669898
    RAJENDRA BHATT
    Anonymous  
  • #5 21669899
    Geoff Lancaster
    Anonymous  
  • #6 21669900
    RAJENDRA BHATT
    Anonymous  
  • ADVERTISEMENT
  • #7 21669901
    Mark Harrington
    Anonymous  
  • ADVERTISEMENT
  • #8 21669902
    Geoff Lancaster
    Anonymous  
  • #9 21669903
    Geoff Lancaster
    Anonymous  
  • #10 21669904
    Syed Shadab
    Anonymous  
  • #11 21669905
    Geoff Lancaster
    Anonymous  
  • #12 21669906
    Geoff Lancaster
    Anonymous  
  • #13 21669907
    Mark Harrington
    Anonymous  
  • #14 21669908
    Mark Harrington
    Anonymous  
  • #15 21669909
    Geoff Lancaster
    Anonymous  
  • #16 21669910
    Mark Harrington
    Anonymous  
  • #17 21669911
    Mark Harrington
    Anonymous  
  • #18 21669912
    Mark Harrington
    Anonymous  
  • #19 21669913
    zubair ahmed
    Anonymous  
  • #20 21669914
    zubair ahmed
    Anonymous  

Topic summary

The discussion addresses an issue with lighting an LED using a PIC12F629 microcontroller programmed via MPLAB X and the XC8 compiler, with Microbrn and a K150 programmer. The main problem is that the LED connected to GP0 does not illuminate despite setting GP0 high in code. Key troubleshooting steps include correctly configuring the TRISIO register to set GP0 as an output (TRISIO bit 0 = 0), disabling analog functions by clearing ANSEL (though this caused compilation errors due to undefined identifier), and disabling the comparator by setting CMCON. The importance of loading the OSCCAL calibration value from the chip to ensure proper oscillator operation was emphasized, as failure to do so can cause erratic behavior. Suggestions also included verifying that GP3 is input-only and not used as output, checking for port failures, and ensuring no conflicting compilers are in the system path. Debugging via MPLAB's simulator was recommended to observe register states and pin outputs. Alternative approaches such as using MikroC Pro for PIC and writing in assembler were proposed. Sample code snippets were shared to initialize GPIO, disable analog inputs, and set GP0 high in an infinite loop. The discussion also touched on fuse settings and configuration bits necessary for proper device operation. Overall, the resolution involves proper pin direction setup, disabling analog inputs and comparators, loading oscillator calibration, and careful debugging to confirm hardware and software correctness.
Summary generated by the language model.
ADVERTISEMENT