Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

problem in blinking led with 16f877

Status
Not open for further replies.

hassankhan

New Member
hi!
i am newbie i m using "US-Burn V1.8 a3" programmer and mikroc as compiler
My code is:

void main() {
TRISB = 0; // TO MAKE PORTB OUTPUT
PORTB = 0;
while(1)
{
PORTB = ~PORTB; // TO TOGGLE PORTB
Delay_ms(5000);
}
}

but when i m checking it on hardware led is just ON but it is not blinking,when i m burning the code from programmar during blank check it was giving me an error "config error don't care".tell me whats the mistake i m doing

your response will be highly appreciated!!!
 
is that your whole code? if it is, you need the header codes at the beginning. like this;
//******************************************************************************
/** I N C L U D E S **************************************************/
#include <p18lf26k80.h>
#include <timers.h> // header file
#include <math.h>
#include <i2c.h>
#include <delays.h>
/** V A R I A B L E S *************************************************/

/** C O N F I G U R A T I O N B I T S ******************************/
#pragma config SOSCSEL = DIG
bla
bla
 
Change the delay to 200mS and see if it flashes. It might be a timing issue with your PIC configs, in MikroC they are done in an edit box under Projects->Setup or something like that.

Make sure your configs are right (matching your xtal speed) and that your xtal speed is also set to the correct number in the edit box. That is important because that number makes all delays the right length.
 
yeah i had checked this before, xtal is absolutely fine but tell me is there any compatibility issue of programmer software with 64 bit??


regards
hassan khan
 
Status
Not open for further replies.

Latest threads

Back
Top