setting a config in 16F877A

Status
Not open for further replies.
hi
today is my first time i connect my 877A
to my pickit2 , and now i need some help
on changing the config line the c code
here is the code
Code:
#include <system.h>

#pragma CLOCK_FREQ 4000000  // config clock to 4mhz.

// Set configuration fuse.

[COLOR="red"]#pragma DATA _CONFIG, _XT_OSC & _WDT_OFF & _CP_OFF & _PWRTE_OFF[/COLOR]

void main()
{
   trisb = 0;        //configure port B pins as output
   while( 1 )      //endless loop
   {
     portb.0=1;        // set portb pin0 to high.
     portb.1=0;        // set portb pin1 to low.
     delay_ms( 500 );  // pause 0.5 seconds
     portb=0x02;       // shows hex notation for entering data.
     delay_ms(500);    // you can also write portb=2 in decimal
   }
}
the red line is the thing i confused on
please help me !
also ,
is 877A have internal clock ?
because i run out of crystal
 
Last edited:
hi,
No internal oscillator.
 

Attachments

  • AAesp01.gif
    66.7 KB · Views: 314
hi eric
what about if i using resistor for clock
as it shown on the attachment ?

hi,
You could do that, change that CONFIG to suit an RC osc.

EDIT:
 

Attachments

  • AAesp03.gif
    25.9 KB · Views: 268
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…