How to burn into PIC using EPIC?

Status
Not open for further replies.

Wavelength

New Member
Hi again...Now got through the simulation part and I want to start testing a simple circuit, push and a LED will go on. I use MPLAB to assamble the code and EPICWIN to burn it to the pic.I manage to burn the hex file into the pic.I know this when a confirmation popup say "Program verify and completed".But the problem is when I tried on hardware nothing happened, the LED just will still on and pushing the button at the input will do nothing.Do I need to configure anything first on EPICWIN or MPLAB, then burn or will Epic software configure it automatically.

This what I have checked:

1. Power supply using 2 x 9v bat. No problem here cause the programmer is able to burn the code into the pic.

2. I connected the PIC directly to the IC socket. I have a ZIF adapter but the instruction on the adapter said that I can't use it with 18 pin PIC.I also tested it with the adapter and got an error massage.

3. I'm using a 25 pin cable to connect to the parallel port of my laptop. I think there's no problem here cause I can communicat with the EPIC hardware with no problem.(Noticed some 25 pin has diffrent type of connection)

4. The code has no error when I compiled it.here are the codes

List P = 16F84
#include <p16F84.inc>
__CONFIG 1Bh ;_CP_OFF & _PWRTE_ON & _WDT_OFF & _RC_OSC

ORG 0
SetUp BSF 03,5
CLRF 06
MOVLW 01
MOVWF 05
BCF 03,5
CLRF 06
Main BTFSS 05,0
GOTO Main2
BSF 06,0
GOTO Main
BCF 06,0
GOTO Main
Main2 BCF 06,0
GOTO Main
END

Guys sorry for the long whining . Thnx.
 
I don't know what is the problem with your code but I have re-writen it in a more easy to understand format and use the forum [ c o d e ] attribute to post it.

If you are not experienced in PIC programming like me, you should write some comments to show what you want to achieve. Doing so would enable experienced users here to point out the error straight away.

Code:
        List P = 16F84
        #include <p16F84.inc>

        #define led 0           ;led is on pin 0 & 0V 
        #define switch 0        ;switch is on pin 0 & +5V

        __CONFIG 1Bh ;_CP_OFF & _PWRTE_ON & _WDT_OFF & _RC_OSC

        ORG 0

SetUp   BSF STATUS,RP0          ;move to bank1
        CLRF TRISB              ;portB all pins as output
        MOVLW 01
        MOVWF TRISA             ;set port A,0 as input pin
        BCF STATUS,RP0          ;back to bank0
        CLRF PORTB              ;led off

Main 
        BTFSS PORTA,switch      ;is switch pressed?
        GOTO Main2              ;no
        BSF PORTB,led           ;yes
        GOTO Main
        BCF PORTB,led           ; <<<< these two instructions
        GOTO Main               ; <<<< will never get executed  

Main2   BCF PORTB,led           ;turn off led
        GOTO Main
        
        END

P.S. If you have connected a switch from +5V to portA pin0, then you would also need a resistor(a few Kohms) from portA pin0 to 0V to "pull down" the pin level when the switch is not pressed.
 
Thnx for te comment. I have also connected a resistor to the ground for the switch with 47k ohm to make it low when the switch is not press.Still the LED willl stay on and nothing happen when I press the button.
 
I know this probably has nothing to do with the problem you are experiencing but I thought I'd tell you about the problem I had with burning my first chip.
I was using an MELAB's Serial Programmer with a (8-40 pin ?) ZIF (zero insertion force) adapter.
For some reason I kept getting an error message, "target device not recognized." everytime I hit the PROGRAM button.
I eventually discovered what that meant: Chips up to 18 pins are inserted in one direction on the ZIF while chips with 28 to 40 pins are inserted in an entirely different way.
 
I have a similar problem, using MeLabs USB programmer and Proton IDE Lite. If I try to program using the download button on the Proton screen, it goes off looking for the programmer and ends up in la la land and does not program. If I bring up the MeProg.exe windows, I get the message "Program/ verify complete" but then if I do a blank check it says chip is blank.

Wait - I just tried it again and blank check says not blank. Do you suppose that the fact that I had it plugged in for over an hour before programming had anything to do with it working this time? Why else would it work one time but not another?

Well, it is still not working but I notice that MeProg has reset the configuration to the defaults, let me try setting the configuration correctly and make sure it does not get changed before programming.

Now it works, hallelujah!
 
RE: Epic

If I recal correctly, the EPIC software did not read embedded Config bits in the code. You have to set them in the GUI.

Pete
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…