I've build a circuit with a pic18F4550, I'm trying to power up 8 leds, but I get no output voltage from any output pin.
I suspect the pic might be broken because while building the circuit I made two mistakes: - I wired the 5v regulator wrongly, and supplied 9v to the pic for the first time - on one side of the pic I connected power to vss and ground to vcc
However, after noticing my mistakes and fixing them, I reprogrammed pic and got no error (I'm using MPlabX and PicKit2). Also the pic is not heating up or anything like that.
I triple checked all the wires and schematics, but there is only 5v in the two vcc pins, and 0v in the output ports.
This is my program:
#pragma config XINST = OFF
#if defined(__XC)
#include <xc.h> /* XC8 General Include File */
#elif defined(HI_TECH_C)
#include <htc.h> /* HiTech General Include File */
#elif defined(__18CXX)
#include <p18cxxx.h> /* C18 General Include File */
#endif
#if defined(__XC) || defined(HI_TECH_C)
#include <stdint.h> /* For uint8_t definition */
#include <stdbool.h> /* For true/false definition */
#endif
#define NO_CLRWDT
#define SYSCLK 20000000
#define PLL 4
#define SYSCLK_PLL (SYSCLK*PLL)
#define FCY (SYSCLK_PLL/2)
#include "system.h" /* System funct/params, like osc/peripheral config */
#include "user.h" /* User funct/params, such as InitApp */
void main(void){
TRISD = 0x00;
TRISC = 0x00;
PORTC = 0xFF;
PORTD = 0xFF;
while(1){
}
}
Could my pic be broken? and how can I check or debug the issue? I'm newbie at both soft and electronics.