Windmiller
Member level 4
Hello
I've recently bought myself a PICKit2 to use instead of my previous Velleman VM134 and it seems to work fine, had no problems writing to any of my PIC16F. But when it comes to the PIC18F4550 my only of the P18F family that I own, then I'll have to write several times to make the darn thing programmed??
When I use the programming software that came with the PICKit2 it says something like "... configuration bits are not set.." every time I load any of my .hex files and that I should in MPLAB export the file with configuration bits. And If I do like it says, I will still get the same result in the PICKit2 software and it never works. If I use MPLAB all the way, then the programming works fine some of the times maby not on the first click but after I've been clicking the write button about five - ten times, then there might be a program on the chip.
Why do I have to program P18F sever times to get the code on the chip? :sad: Anyone else who got this problem with the P18F4550? I had almoust the same problem with my Velleman VM134, but here it was only writing a bit of the code to the chip.
Here is my code, that works some of the times:
Regards
/ Morgan
I've recently bought myself a PICKit2 to use instead of my previous Velleman VM134 and it seems to work fine, had no problems writing to any of my PIC16F. But when it comes to the PIC18F4550 my only of the P18F family that I own, then I'll have to write several times to make the darn thing programmed??
When I use the programming software that came with the PICKit2 it says something like "... configuration bits are not set.." every time I load any of my .hex files and that I should in MPLAB export the file with configuration bits. And If I do like it says, I will still get the same result in the PICKit2 software and it never works. If I use MPLAB all the way, then the programming works fine some of the times maby not on the first click but after I've been clicking the write button about five - ten times, then there might be a program on the chip.
Why do I have to program P18F sever times to get the code on the chip? :sad: Anyone else who got this problem with the P18F4550? I had almoust the same problem with my Velleman VM134, but here it was only writing a bit of the code to the chip.
Here is my code, that works some of the times:
Code:
CONFIG WDT=OFF; disable watchdog timer
CONFIG MCLRE = ON; MCLEAR Pin on
CONFIG DEBUG = ON; Enable Debug Mode
CONFIG LVP = OFF; Low-Voltage programming disabled (necessary for debugging)
CONFIG FOSC = INTOSCIO_EC;Internal oscillator, port function on RA6
org 0; start code at 0
CBLOCK 0
Delay1:1
Delay2:1
ENDC
;Delay1 res 1 ;reserve 1 byte for the variable Delay1
;Delay2 res 1 ;reserve 1 byte for the variable Delay2
Start:
CLRF PORTD
CLRF TRISD
CLRF Delay1
CLRF Delay2
MainLoop:
BTG PORTD,RD1 ;Toggle PORT D PIN 1 (20)
Delay:
DECFSZ Delay1,1 ;Decrement Delay1 by 1, skip next instruction if Delay1 is 0
GOTO Delay
DECFSZ Delay2,1
GOTO Delay
GOTO MainLoop
END
Regards
/ Morgan
Last edited: