Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC18F4550 LED startup

Status
Not open for further replies.

ppdr123

Member level 3
Joined
Jul 24, 2010
Messages
61
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Location
Bhaarat
Activity points
1,619
i am trying to glow LED on port B5 of pic18f4550. any body having sample code.
 

Are you coding in Assembly or C language?

If C language which compiler are you using?


BigDog
 

i am doing coding in c. compiler is C18.
here is my code.


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#define _main_
#include "p18f4550.h"
//#include "main.h"
#pragma config WDT = OFF    
void main(){
PORTB=0;
LATB=0;
TRISBbits.TRISB5=0;
 
while(1){
LATBbits.LATB5=1;
//PORTBbits.RB5=0;;
 
}
}

 
Last edited by a moderator:

Are you not seeing any effect on the LED attached to RB5?

It doesn't appear you have disabled Low Voltage Programming (LVP) which shares that pin by default.

You can disable LVP by correctly setting the specific bit in the Configuration Register settings.


BigDog
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top