- This topic has 3 replies, 2 voices, and was last updated 12 years ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
|
Microcontroller › PIC › Hello, I am using PIC18F4550, PIC18F452 how to program a simple blinking LED please tell me any one……
which IDE has choose to use very simple PIC program …..method
but i am using MPLAB, HITECH compiler…
please tell me… any one i am wait for u r reply
Hi,
I think MPLAB itself is the best IDE for beginners.
thank u for u r reply
please post 18f4550 PIC simple led blinking program…
and how to connect the hardware connection….
#include <p18f4550.h>
#include <delays.h>
#pragma config FOSC = INTOSCIO_EC //Internal oscillator, port function on RA6, EC used by USB
#pragma config WDT = OFF //Disable watchdog timer
#define LEDPin LATDbits.LATD1 //Define LEDPin as PORT D Pin 1
#define LEDTris TRISDbits.TRISD1 //Define LEDTris as TRISD Pin 1
void main()
{
LEDTris = 0;//Set LED Pin data direction to OUTPUT
LEDPin = 1;//Set LED Pin
while(1)
{
LEDPin = ~LEDPin;//Toggle LED Pin
Delay10KTCYx(25);//Delay 250K cycles (1 second at 1MHz since each instruction takes 4 cycles)
}
}
Connect an LED in series with a resitor towards ground from the pin number 1
of the port D of the PIC.