I am trying to build and load this LED-ON program on my newly acquired PICKit 3 Demo Board (w/ PIC18F45K20). Everything is fine, the programmer is supposed to be powering the board, the voltage is set to 3.25V, there is no error in build, there is no error in programming/verifying. YET, the LED refuses to glow.
And in Debugger -> Settings -> Status (Tab) the PICKit3 VDD is 0.00V... I can't get it. The program was downloaded from Microchip websites and is supposed to be an introductory lesson for PICKit3 Debug Express...
If someone could kindly have a look at the code and explain what I am doing wrong, I shall be duly grateful.
Everything is fine, the programmer is supposed to be powering the board, the voltage is set to 3.25V, there is no error in build, there is no error in programming/verifying. YET, the LED refuses to glow.
Are you running this in debugger or programmer mode? If debugger mode, once the PIC is programmed and verified, have you then issued the "RUN" command? If programmer mode, have you then issued a "Release from Reset ..." command.
And in Debugger -> Settings -> Status (Tab) the PICKit3 VDD is 0.00V... I can't get it. The program was downloaded from Microchip websites and is supposed to be an introductory lesson for PICKit3 Debug Express...
Are you running this in debugger or programmer mode? If debugger mode, once the PIC is programmed and verified, have you then issued the "RUN" command? If programmer mode, have you then issued a "Release from Reset ..." command.
I have tried running in both modes with the same result. Also, in debugger mode, I tried issuing the Run command, the Animate command and Release from Reset comman, to no avail.
It's strange. I would have assumed that the board is faulty. However, that is out of the question since in that case, the board would not connect to PICKit 3 at all, not to mention return alright on Program and Verify commands!
I have quite a few Microchip development boards, in the order of about two dozen. And I have never received a bad board from Microchip, so they appear to do quite a good job as fair as quality control.
Therefore, I seriously doubt it is the board, besides there are only a few possible points of failure. I'm leaning towards a power supply issue. Perhaps the PICkit is not setup properly to provide the necessary power to the board. Let me see if I can track down the boards schematics.
BigDog
---------- Post added at 02:04 ---------- Previous post was at 01:38 ----------
Try this version of the code, using the same linker script, etc as outlined in the PICkit 3 Debug Express Lessons User's Guide:
Code:
/***********************************************************
First PIC18 Program Ever!!!
***********************************************************/
#pragma config FOSC = INTIO67
#pragma config WDTEN = OFF, LVP = OFF
#include "p18f45k20.h"
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);
}
The only major difference is the MCLR is not disable in this version, which I would think the PICkit 3 would need to Reset the board.
Also, have you tested the Vdd from the PICkit with a multimeter to see if indeed it is providing 3.25V?
Thanks a lot. I just figured it out. There wasn't any problem with the code, programmer or the board per se. I just needed to short JP1, which bypasses the current limiting (that's what I think they are) resistors connected in series with all LEDs and it's all working now. The voltage drop across the LED was not enough. I figured out the problem when my hand accidentally touched the resistors and the LED started visibly glowing. When I removed the hand, it went back to as it was. So, I took a jumper and put it on JP1, and all of the lessons are working now.
I just needed to short JP1, which bypasses the current limiting (that's what I think they are) resistors connected in series with all LEDs and it's all working now.
Actually JP1 completes the circuit by tying the all the diodes to ground, the current limiting resistors are always necessary with components like LEDs.