Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

PIC Programming Trouble

  1. Apr 1, 2008 #1
    Hi there! I've got a small, but rather tedious problem with programming a PIC16F628A micro-controller using a USB programmer.

    The assembly code is simple:

    list p=16f628a
    #include <p16f628a.inc>

    ORG 0x000
    goto main

    clrf PORTA
    movlw 07h ;Turn off comparators
    movwf CMCON

    bsf STATUS,RP0
    clrf TRISA
    movlw 00h
    movwf VRCON
    bcf STATUS,RP0

    movlw 01h
    movwf PORTA
    goto loop


    This is just a test program to set one of the bits on PORTA high. Using MPLAB and the PICkit2 programmer, I'm able to build the project and program it, however when I check the value on the pin, it is always low. When I extracted the HEX file from the the PIC, it wasn't even close to the HEX file that was supposedly programmed onto the PIC!

    Help Please!
  2. jcsd
  3. Apr 2, 2008 #2


    User Avatar

    Staff: Mentor

    Be sure that the file format for the programming is selected correctly. One common source of incorrectly programmed parts is to not specify whether the source file is binary or Intel Hex. Also be sure that the rest of the programming options and switches are set to correct/reasonable values (like org's, default values, etc.)
  4. Apr 12, 2008 #3
    I see you people know wat you are talking about i want to controle a throttle with an actuator but cant make up my mind if i must use a servo or a stepper the output of the actuator will be dependent on a frequency input on the pic can u maybe help i am progaming in flowcode (i am new in this kind of thing)
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?

Similar Discussions: PIC Programming Trouble
  1. PIC uc latency time (Replies: 2)

  2. Import pics win7 (Replies: 4)