Hi everyone, I hope you might be able to help me.
Last year I delved in to microcontrollers a little as part of my university work to make simple MIDI controllers, and it wet my appetite a little to have a play around myself.
I bought a 18F4550 with a very basic cheap development board for me to play with as it left many of the pins free for me to use with my own circuits and modules. I also bought a PICkit2 clone to program with and I'm using MPLAB v8.92 with the Hi-Tech C Lite Compiler since that is the software and compiler we used in lectures.
The schematic of the development board is available here:
http://www.bravekit.com/document/PIC_boards/PIC_P40/PIC-P40_schem.pdf
I just tried a simple LED flash code to make sure everything works correctly. My code is as follows:
I can compile the code, program the pic and verify it, but it never seems to run... just sits there with the LED off (LED jumper is bridged to enable it by the way.)
Its probably something very simple, but I've been stuck for hours on this first hurdle!
Out of interest, the PICkit2 clone I have has no connection to the PGM pin of the chip, could this be an issue?
My PICkit 2 log is below:
Hope you can help
Last year I delved in to microcontrollers a little as part of my university work to make simple MIDI controllers, and it wet my appetite a little to have a play around myself.
I bought a 18F4550 with a very basic cheap development board for me to play with as it left many of the pins free for me to use with my own circuits and modules. I also bought a PICkit2 clone to program with and I'm using MPLAB v8.92 with the Hi-Tech C Lite Compiler since that is the software and compiler we used in lectures.
The schematic of the development board is available here:
http://www.bravekit.com/document/PIC_boards/PIC_P40/PIC-P40_schem.pdf
I just tried a simple LED flash code to make sure everything works correctly. My code is as follows:
Rich (BB code):
#include <htc.h>
__CONFIG(1, FCMDIS & IESODIS & XT);
__CONFIG(2, BORDIS & BORV45 & WDTDIS & WDTPS1);
__CONFIG(3, CCP2RB3 & LPT1DIS & MCLRDIS & PBDIGITAL);
__CONFIG(4, DEBUGDIS & XINSTDIS & LVPDIS & STVRDIS);
__CONFIG(5, UNPROTECT);
__CONFIG(6, UNPROTECT);
__CONFIG(7, UNPROTECT);
void main(void)
{
ADCON0=0b00000000;
ADCON1=7;
CMCON=7;
TRISA=0b00000000;
PORTA=0b00000000;
while(1){
PORTA=255;
_delay(100);
PORTA=0;
_delay(100);
}
}
Its probably something very simple, but I've been stuck for hours on this first hurdle!
Out of interest, the PICkit2 clone I have has no connection to the PGM pin of the chip, could this be an issue?
My PICkit 2 log is below:
Rich (BB code):
Initializing PICkit 2 version 0.0.3.63
Found PICkit 2 - Operating System Version 2.32.0
PICkit 2 Unit ID = iCP01-V2.0
Target power detected ( 4.99V)
PIC18F4550 found (Rev 0x7)
PICkit 2 Ready
Programming Target (05/08/2013 20:46:23)
PIC18F4550 found (Rev 0x7)
Erasing Target
Programming Program Memory (0x0 - 0x1F)
Programming Program Memory (0x7D80 - 0x7DBF)
Verifying Program Memory (0x0 - 0x1F)
Verifying Program Memory (0x7D80 - 0x7DBF)
Programming Configuration Memory
Verifying Configuration Memory
Setting MCLR Vdd
PICkit 2 Ready