PIC Programmer K150

From EnigmaGuy Wiki
Revision as of 07:50, 4 October 2014 by Enigmaguy (talk | contribs)
Jump to navigation Jump to search

About PIC Programmer K150

 
PIC K150 Programmer

This device is obsolete and not compatible with MPLab X (new PIC development tool), so you will have to export files in HEX format from MPLab X and import to DIY application which has released last version in 2007. For small projects I believe this device for 9 USD from E-Bay (Chinese resellers) is fine but for more advanced development is recommended usage of PICKit 3. Before you will buy this device I strongly recommend you to visit DIY Site and download latest DIYpack25ep.zip file. Also you will need USB driver for K150 devices (which is different from recommended on DIY site) for Profilic USB to Serial converter. Please also be informed that Profilic USB to Serial converter mounted on K150 boards supports only Windows up to version 7. Windows 8 or Windows 8.1 won't work!

MPLabX

  • Select File->New Project->Standalone project

 

  • Select Device->PIC16F630
  • Select Supported Debug Header: AC162052
  • Select Tool: Simulator
  • Select Compiler: XC8
  • Select project name: LED test
  • Click Finish
  • Right click on Source files -> New C Main file

 

  • Paste the following code into new file
/*
 * File:   newmain.c
 * Author: mkonicek
 *
 * Created on September 7, 2014, 10:19 AM
 */

#include <xc.h>
#include <stdio.h>
#include <stdlib.h>
#include <pic16f630.h>
#define _XTAL_FREQ 4000000

// Send bit to RA0
void changeled(int value){
    if(value==0){
        PORTA = 0x00;
    } else {
        PORTA = 0x01;
    }
    __delay_ms(1000);
}

int main(int argc, char** argv) {
    TRISA = 0x00; // Set PORTA as OUTPUT
    for(;;){
        changeled(0);
        changeled(1);
    }
}
  • Run -> Clean and build main project


DIY Software

 
DIY Software for K150
  • Run MicroBrn
  • Select right COM port (you can find it using device manager)