What could be causing my PIC programming trouble?

  • Thread starter Thread starter mario_
  • Start date Start date
  • Tags Tags
    Programming
Click For Summary
SUMMARY

The discussion centers on programming issues encountered with the PIC16F628A microcontroller using a USB programmer and MPLAB with the PICkit2. The user successfully builds the project but finds that the programmed HEX file does not match the expected output, resulting in PORTA remaining low. Key troubleshooting advice includes ensuring the correct file format (binary or Intel Hex) is selected and verifying programming options and switches are appropriately set.

PREREQUISITES
  • Understanding of PIC16F628A microcontroller architecture
  • Familiarity with MPLAB IDE and PICkit2 programmer
  • Knowledge of assembly language programming for microcontrollers
  • Basic concepts of file formats, specifically binary and Intel Hex
NEXT STEPS
  • Research how to configure MPLAB for programming PIC microcontrollers
  • Learn about the differences between binary and Intel Hex file formats
  • Explore common troubleshooting techniques for microcontroller programming
  • Investigate the use of Flowcode for programming and controlling actuators
USEFUL FOR

Embedded systems developers, hobbyists working with PIC microcontrollers, and anyone troubleshooting programming issues with MPLAB and PICkit2.

mario_
Messages
1
Reaction score
0
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!
 
Engineering news on Phys.org
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.)
 
I see you people know wat you are talking about i want to controle a throttle with an actuator but can't 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)
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K