ppperez
Newbie level 5
- Joined
- Jul 31, 2014
- Messages
- 9
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 84
Hello Masters.
I am new but I am studding to learn more about PICs, I needed to start with the practice.
This is my blinking code:
This is the circuit that I did:
I think that the problem is that I connect the PIN1 to 5V directly, after connect it directly, the PIC was damaged.
I am using C18.
Could someone tell me what I did wrong?
I am new but I am studding to learn more about PICs, I needed to start with the practice.
This is my blinking code:
Code:
#include <p18f452.h>
#include "stdio.h"
#include <delays.h>
#pragma config OSC = HS //Defining an external crystal
#pragma config WDT = OFF //Disabling watch dog
#define LEDPin LATDbits.LATD1 //Label defining the pin D1 as output
#define LEDTris TRISDbits.TRISD1 //Label defining the pin D1 as input or output direction
void main()
{
LEDTris = 0; //Defining as output direction
LEDPin = 1; //Enbling D1 Port as output.
while(1)
{
LEDPin = ~LEDPin;
Delay10KTCYx(75);
}
}
This is the circuit that I did:
I think that the problem is that I connect the PIN1 to 5V directly, after connect it directly, the PIC was damaged.
I am using C18.
Could someone tell me what I did wrong?