I have a pickit2 and would like to programme a code written by me into the PIC16F628A. I have written the code in mplab in assembly language and linked successfully. I have a pickit2 software. My problem now is i do not know how to insert the code into the PIC. What i heard was we have to convert the assembly into hex and insert it into PIC. Please tell me step by step on how to do that. Thank you.
Have you successfully built the project with MPLAB? If you have the hex file is already generated in the same directory. You can just use MPLAB to program the PIC or PICkit2 software to program the PIC.
Can / have you actually got the PICKIT2 connected to the microcontroller?
From the MPLAB menu select debugger as PICKIT2 and programmer as NONE.
Then you need to BUILD your project (select build icon in MPLAB) then PROGRAM (select program icon). Your project should include a header file and a linker file for the microcontroller that you are programming.
If you just want to program the chip then select pickit2 as a programmer, not debugger. When you program using a debugger extra code is downloaded and the chip will not work while disconnected from the pickit2.
I set my programmer and debugger to pickit2. Is that correct?
After programming successfully, do i have to "release from reset"?
Here is my code.
Code:
list p=16F628A
include "p16f628a.inc"
__config _INTRC_OSC_NOCLKOUT & _PWRTE_ON & _BODEN_ON & _MCLRE_ON & _WDT_OFF & _CP_OFF
org 0x0000
movlw 0x07 ; I think these should also be added
movwf CMCON
bsf STATUS,5
movlw 00h
movwf TRISA
bcf STATUS,5
movlw b'00000101'
movwf PORTA
goto $
end
I dont have any resistor now. Why do i need those? Can i not pay around with MCLR? i am still new and dont really want to mess with those resetting things.
You should have the pickit2 connected to MCLR and so you will need to do "release from reset". If however, you disconnect the pickit2 then you will need a resistor from MCLR to Vdd or it will keep reseting.
I have a pickit2 and would like to programme a code written by me into the PIC16F628A. I have written the code in mplab in assembly language and linked successfully. I have a pickit2 software. My problem now is i do not know how to insert the code into the PIC. What i heard was we have to convert the assembly into hex and insert it into PIC. Please tell me step by step on how to do that. Thank you.
According to this, it means that i do not need the "release from reset"?
This is because whenever i clicked on the "release from reset" It says resetting...... and it did not display "successfully released" or something similar.
According to this, it means that i do not need the "release from reset"?
This is because whenever i clicked on the "release from reset" It says resetting...... and it did not display "successfully released" or something similar.