What could be causing my PIC programming trouble?

In summary, The conversation is about a problem with programming a PIC16F628A micro-controller using a USB programmer. The assembly code is simple and the project can be built and programmed, but the value on the pin is always low. One possible solution is to check the file format for the programming and make sure all the programming options and switches are set correctly. The person also mentions needing help with controlling a throttle with an actuator and is unsure whether to use a servo or a stepper. They are programming in flowcode and are new to this type of programming.
  • #1
mario_
1
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
  • #2
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.)
 
  • #3
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)
 

1. What is PIC programming and why is it used?

PIC programming is the process of creating and uploading code to a PIC microcontroller, which is a small computer chip that can be programmed to perform specific tasks. It is used in a variety of electronic devices, such as appliances, cars, and medical equipment, to control their functionality.

2. What are common problems encountered during PIC programming?

Some common problems that may arise during PIC programming include incorrect wiring or connections, faulty components, errors in the code, and compatibility issues between the microcontroller and programming software.

3. How can I troubleshoot PIC programming issues?

The first step in troubleshooting PIC programming issues is to check all connections and ensure they are properly wired. Next, verify that all components are functioning correctly. If the code is the issue, carefully review and debug it. If compatibility is the problem, try using a different programming software or a different microcontroller.

4. How can I prevent PIC programming problems in the future?

To prevent PIC programming problems, it is important to double-check all connections and components before uploading code. It can also be helpful to use a programming software with a built-in debugger to catch any errors in the code. Additionally, regularly updating and maintaining your programming tools can prevent compatibility issues.

5. Are there any resources available for learning more about PIC programming?

Yes, there are many resources available for learning more about PIC programming, including online tutorials, forums, and books. Additionally, the manufacturer of the PIC microcontroller may provide resources and support for programming their specific product.

Similar threads

  • Electrical Engineering
Replies
2
Views
2K
  • Programming and Computer Science
Replies
3
Views
1K
Replies
9
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
  • Electrical Engineering
Replies
10
Views
3K
  • Electrical Engineering
Replies
5
Views
2K
  • Programming and Computer Science
Replies
4
Views
2K
  • Programming and Computer Science
Replies
1
Views
2K
  • Programming and Computer Science
Replies
2
Views
3K
  • Electrical Engineering
Replies
2
Views
2K
Back
Top