about pickit3

Thread Starter

kirayamato_0

Joined Apr 6, 2011
3
i just bought a pickit 3 but i cannot use the tutorials because i change the embedded microcontroller into pic16f887 while ordering. the tutorial in the cd is about p18f45K20.. please help me i cannot do the lessons included.
 

t06afre

Joined May 11, 2009
5,934
Here we need some more details. Is the tutorial in C or assembler. If it is C which C compiler do use. Did you purchase the PICKIT with a development board or just a MCU on the side.
Also note that MPLAB is NOT a C compiler. It just an IDE.
 

Thread Starter

kirayamato_0

Joined Apr 6, 2011
3
i think it is in c
#pragma config FOSC = INTIO67
#pragma config WDTEN = OFF, LVP = OFF, MCLRE = OFF


/** I N C L U D E S **************************************************/
#include "p18f45k20.h"


/** D E C L A R A T I O N S ******************************************/


void main (void)
{

TRISD = 0b01111111; // PORTD bit 7 to output (0); bits 6:0 are inputs (1)

LATDbits.LATD7 = 1; // Set LAT register bit 7 to turn on LED

while (1)
;

}
it seems fine my only problem is i cannot do the tutorials because my mcu is different.
 

t06afre

Joined May 11, 2009
5,934
It would be much more easy if you just got a an 18f45K20. For a starter the PIC16F and PIC18F MCUs do not use the same C-compiler.
 

AlexR

Joined Jan 16, 2008
732
PICkit3 tutorials are written for the C18 compiler which only works with the PIC18 series of chips.
I guess if you were proficient in C and PICs you could adapt the tutorials to a different compiler and the PIC16 series of chips but them if you were that proficient you wouldn't need the tutorials in the first place.
The simplest solution would be to buy the 18F45K20 board from Microchip or failing that virtually any 18F chip mounted on a breadboard along with some LEDs and switches should get you by.
 

t06afre

Joined May 11, 2009
5,934
In appendix A in the PICkit 3 Debug Express Lessons. You may find the schematics to the trainer using the 18f45K20. It is basicly 1 switch, one pot and 8 LEDs. You can build very easy and cheap using breadboard. Note the pin numbers are for a 44 pin Thin plastic quad flat pack. A 40 DIP will have different pin numbers
 

Thread Starter

kirayamato_0

Joined Apr 6, 2011
3
i already bought the pickit 3 with that pic16f887 embedded dont you have any way that you can recommend? i dont know in the first place that the tutorial is exclusive for 18f45K20
 

AlexR

Joined Jan 16, 2008
732
As I said in post #5, the tutorials are written for the C18 compiler and that only works with the PIC18F series of chips.

To use the PIC16F887 you would need a different compiler which will have different library functions and different ways of doing things such as addressing register bits, handling interrupts, and setting the PIC configuration bits. If you had a good knowledge of C you could adapt the tutorials to a different compiler but it is not a task to be tackled by a beginner.

Your options are either get a PIC18F board/chip or find a different tutorial that does cater for PIC16F chips and your compiler.
 
Top