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
 
actually i m working on mikro c compiler & i think it will automatically add these files without writing them
 
Hi
Check your configuration bits

__ config 3f39 // for HiTech C ( 4Mhz , WDT_OFF , OSC_XL.....)
 
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
 
I don't know. That's the sort of compiler issue question you should ask at the MikroC forum at MikroE.com.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…