PIC Programming Trouble

  • Thread starter mario_
  • Start date
1
0

Main Question or Discussion Point

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

main
clrf PORTA
movlw 07h ;Turn off comparators
movwf CMCON

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

loop
movlw 01h
movwf PORTA
goto loop

END




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!
 

Answers and Replies

berkeman
Mentor
56,127
6,156
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.)
 
1
0
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)
 

Related Threads for: PIC Programming Trouble

  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
4
Views
2K
  • Last Post
Replies
4
Views
5K
  • Last Post
Replies
4
Views
2K
  • Last Post
Replies
2
Views
4K
  • Last Post
Replies
3
Views
2K
Replies
1
Views
2K
Top