Jump to content
Sign in to follow this  
ioso

PIC16F877A

Recommended Posts

Hello, how configure XTAL Mhz for PIC16F877A 20Mhz

I buil this code :

 

asm __config 0x3ff2

 

//Timing settings

 

#pragma CLOCK_FREQ 20000000

 

 

void main(void)

{

 //Hardware Initialization

 disable_interrupt( GIE );

 set_bit( STATUS, RP0 );

 set_tris_a( 16 );

 set_tris_b( 0 );

 clear_bit( STATUS, RP0 );

 

 while(1)

 {

       output_port_b(0x01);

       delay_ms( 1 );

       output_port_b(0x00);

       delay_ms( 1 );

   

 }

}

And i have misured with Oscilloscope the delay_ms(1) -200us

 

why?

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...