question about k150 DIY PIC programmer

Discussion in 'General Electronics Chat' started by hunterage2000, Nov 10, 2012.

  1. hunterage2000

    Thread Starter Senior Member

    May 2, 2010
    I have recently bought a k150 DIY PIC programmer and used it with JALEDIT and microbrn.exe by micropro. I have downloaded MPLAB X and xc8 compiler but when setting up a new project, at step 4 hardware tools my k150 isnt there. I have a 6 pin socket (NC, PGC, PGD, GND, VCC and VPP),

    do these have to be connected to be recognised by MPLAB? if so where are they connected?
  2. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    1. Locate your trash can.

    2. Take the programmer and place it carefully in the bottom of the can.

    3. Take the trash can outside and dump it into your outside trash can to be collected.

    4. Go buy a PicKit 2 or PicKit 3 from Microchip.

    5. Save yourself huge headaches.

    The programmer from microchip is only around $30. Why would you buy anything else?

    Your programmer is not supported by MPLAB. You will need to do your programming with the software that comes with the programmer. You will need to produce a hex file with mplab then use that in the software. I doubt you will even be able to debug with it, another HUGE advantage of the Microchip programmers.

    The lines you are talking about are the ICSP lines. They are used by the programmer to program the chip but are also used for debug assuming you have a supported programmer.
  3. t06afre

    AAC Fanatic!

    May 11, 2009
    It is perhaps somewhat harsh to recommend dumping your new programmer. Anyway the k150 can not be used from MPLAB. So you have to compile your program in MPLAB. Then use whatever tool you have to load the hex file and do the programming. If I remember correct you have 16f887 chip.
    This is how you will connect for programming. I will recommend that you do the programming in circuit. You will very quickly damage your chip if you take it in and out of circuit for programming. Note your PIC has 2 set of VDD/GND pins. All of those must be connected
  4. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    I's a lot more cruel to encourage the OP to go forward with a headache creator. The OP is not even sure if the device was assembled correctly nor how reliable it is going to be.

    I searched for Dave's blog on EEV where he mentions these things but can't find it. His words were pretty much the same on the programmers. A waste of time and money.

    I like to get the truth right between the eyes. Initially it is painful but it is over quick.
  5. hunterage2000

    Thread Starter Senior Member

    May 2, 2010
    Yeah my chip is the PIC16F887A and the programmer is a DIY k150. I have tried debugging a program but a screen with Hardware tools comes up and at the top it says "Real ICE not found" so I cant check for errors. Is there a way around this? if not can someone recommend more compiler options that uses C. I tried Bloodshed Dev C++ but I couldnt save as a .hex file

    I do have JALEDIT working with the PIC but I would rather work with C.
  6. t06afre

    AAC Fanatic!

    May 11, 2009
    Debugging is something you do then your program is free from C syntax errors. The compiler will not create a hex file before this. You do not save as a hex file. You compile and if no errors your hex file will be created. Have you written any C code so far for testing, and does this code compile correctly without any errors. That should be your first goal
  7. hunterage2000

    Thread Starter Senior Member

    May 2, 2010
    I got a bit sick of trying to get MPLAB to work so I downloaded PICbasic Pro using BASIC langauge. So with the k150, does it need to be powered with the 6 pin socket? if so what is VPP, PGC and PGD and where are they connected to? I've searched the net for answers which are there but I just cant make out what its saying.

    With Jaledit when you compile the .jal file it scanned the file for syntax errrors then created a .hex file along with it. I used Micropro to upload the .hex file and I didnt need to use the 6 pin socket, just the usb connection.

    The K150 is attached as an image.
    • K150.jpg
      File size:
      28.4 KB
  8. takao21203

    AAC Fanatic!

    Apr 28, 2012
    When I built this PIC programmer, I also had various questions covering the gist and hest about ICSP, the power supply, and the RS232 connection.

    I used a schematic but that was extraordinary bad, so I added components.

    It was clear before I built it that there is no debugging, and it only can program a few PICs.

    Unfortunately there are not really any good websites "How to build a really useful PIC programmer", including information how to actually use it.

    Most people don't build PIC programmers.
    Most people use a programmer that's supported by MPLAB, that's the only way to use modern PICs.
  9. hunterage2000

    Thread Starter Senior Member

    May 2, 2010
    The k150 works with jaledit and micropro programmer but I wanted to program in C but MPLAB doesnt work, device manager doesnt show Microchip tools and when creating a project the k150 isnt shown.

    Now I am trying BASIC programming with PICBASIC PRO which I have created the .bas file and the .hex for a blinking light but it isnt working and I dont get why this code sets port B0 as the output.

    Code ( (Unknown Language)):
    2. mainloop:
    3.    High 0
    4.    low 1              ' Turn on LED connected to PORTB.0
    5.    Pause 500       ' Delay for .5 seconds
    7.    Low 0
    8.    high 1             ' Turn off LED connected to PORTB.0
    9.    Pause 500
    10.                         ' Delay for .5 seconds
    12.    Goto mainloop   ' Go back to loop and blink LED forever
    14.    End
  10. nigelwright7557

    AAC Fanatic!

    May 10, 2008
    I still use an old Microchip PICSTART !
    No messing about with ICSP just plug the chip in and MPLAB programs it.
    You can remove and insert a chip in circuit many times before the socket dies if you are careful.
  11. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    That does not look right to me at all.

    Take a look here.

    You need to specify the Port when making a call with high or low.

    High PortB.0
    Low PortB.0

    I know this is a matter of pride and all and maybe a little bit of money but believe me that programmer is not worth the hassle. You are dealing with an unknown. You have no idea how well that programmer works,if at all or how well it will work into the future.

    As a beginning programmer it is hard enough dealing with just learning pics, the last thing you need is dealing with a programmer that may or may not wok.
  12. t06afre

    AAC Fanatic!

    May 11, 2009
    Here is a simple program that will blinks LEDs on PORT D. Remember to use a series resistor then connecting the LED to the port pin, 330 ohm will be fine. In MPLAB create a new project and use this code. The program is set up to use the internal oscillator so no crystal will be needed.
    Ps. If you do not know how to create a project look here. The program will not compile else.
    Code ( (Unknown Language)):
    1. /*
    2.  * File:   hello world.c
    3.  * Author: adf
    4.  *
    5.  * Created on 11. november 2012, 13:52
    6.  */
    8. // PIC16F887 ConfiguratioBit Settingsn
    10. //#include "htc.h" //for hi-tech c compiler 8.x
    11. #include "xc.h"
    12. // PIC16F887 ConfiguratioBit Settingsn
    14. __CONFIG(BOR4V_BOR40V & WRT_OFF);
    15. #define _XTAL_FREQ  4000000
    16. int main(void)
    17. {
    18.    ANSEL=0b00000000;//Turn off analog functions
    19.    ANSELH=0b00000000;//Leave this as is til the day you need analog functions
    20.    TRISD=0b00000000; //We are going to use PORTD as output
    21.    PORTD=0xff;
    22.    while(1)
    23.     {
    24.        PORTD=~PORTD;
    25.        __delay_ms(1000);
    26.     }
    27. }