Pickkit 2 med pk2cmd

 

För PIC-programmering krävs 2 program. Sdcc för kompilering och Pk2cmd för att föra över till mikrokontrollern. Dessa måste i ubuntu kompileras och installeras från källkod då det annars saknas includfilerer pga licensprolem.

### Pk2cmd ###

export PATH=$PATH:/usr/share/pk2 #Gör att filen hittas och kan användas.

pk2cmd ’-S#’ list all connected Pickit 2 devices and their firmware version

pk2cmd -Dfile replace the firmware by the contents of the specified file

pk2cmd -Ppart -R -T power on the target, part is for example PIC18F4550. The -R option is needed to release the Vpp line, which is also the MCLR (reset) on many PIC’s.

pk2cmd -Ppart -W power off the target

pk2cmd -Ppart -Ffile -M program the target using specified file

”part = PIC18F4550”

Ladda upp firmware test.hex.

pk2cmd -M -PPIC18f4550 -Ftest.hex

### sdcc ###

#Kompilera test.c

sdcc -mpic16 -p18f4550 –use-non-free test.c

### list usb devices ####

lsusb