I've been trying to test my PIC just by turning a LED on, I verified that the PIC is energized and that the MCLR pin is HIGH.
The PIC I'm using is the PIC18F45K22, running at 3.3 volts.
The LED has a Vf of 1.8 volts and I have verified that its polarity is correct. It is connected to pin RB4 with a 1 kΩ resistor in series.
Not sure what else to try here. I have only 1 LED connected and that's RB4, is there something that might be blocking RB4 from giving the output? Is there anything else that I have to setup?
This is my complete source code:
#include <p18f45k22.h>
void main(void)
{
ANSELB = 0;
TRISB = 0;
while(1)
{
LATBbits.LATB4 = 1;
}
return;
}