raafia
Junior Member level 1
- Joined
- Dec 24, 2009
- Messages
- 16
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,413
I am trying simple led blinking code on pic16f877a .Simulations are working fine on proteus but hardware is not responding.I am using mplab with hitech compiler
My code is as follows
My code is as follows
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 #include<htc.h> __CONFIG( FOSC_HS & WDTE_OFF & PWRTE_ON & CP_OFF & BOREN_ON & LVP_OFF & CPD_OFF & WRT_OFF & DEBUG_OFF); // Define LED pin #define LED RB0 #define _XTAL_FREQ 20000000 void main(void) { TRISB0 = 0; // Make RB0 pin output LED = 0; // Make RB0 low while(1) { __delay_ms(500); // Half sec delay LED = 0; // LED off __delay_ms(500); // Half sec delay LED = 1; // LED on } }
Last edited by a moderator: