Skip to main content
deleted 20 characters in body
Source Link
bitsmack
  • 17.1k
  • 11
  • 58
  • 119

It looks like you're using a 16 MHz crystal, but telling the compiler that your frequency is 160 MHz:

#define _XTAL_FREQ 160000000

Once you adjust your code toAlso, at 16 MHz, each clock cycle is \$1/16,000,000 = 62.5ns.\$

You are calling __delay32(150000000);, which would equate to \$150000000\cdot62.5ns=9.37s\$. So the LED will be on for about ten seconds, then off for about 10 seconds.

It looks like you're using a 16 MHz crystal, but telling the compiler that your frequency is 160 MHz:

#define _XTAL_FREQ 160000000

Once you adjust your code to 16 MHz, each clock cycle is \$1/16,000,000 = 62.5ns.\$

You are calling __delay32(150000000);, which would equate to \$150000000\cdot62.5ns=9.37s\$. So the LED will be on for about ten seconds, then off for about 10 seconds.

It looks like you're using a 16 MHz crystal, but telling the compiler that your frequency is 160 MHz:

#define _XTAL_FREQ 160000000

Also, at 16 MHz, each clock cycle is \$1/16,000,000 = 62.5ns.\$

You are calling __delay32(150000000);, which would equate to \$150000000\cdot62.5ns=9.37s\$. So the LED will be on for about ten seconds, then off for about 10 seconds.

added 18 characters in body
Source Link
bitsmack
  • 17.1k
  • 11
  • 58
  • 119

It looks like you're using a 16 MHz crystal, but settingtelling the compiler that your frequency tois 160 MHz:

#define _XTAL_FREQ 160000000

Once you adjust your code to 16 MHz, each clock cycle is \$1/16,000,000 = 62.5ns.\$

You are calling __delay32(150000000);, which would equate to \$150000000\cdot62.5ns=9.37s\$. So the LED will be on for about ten seconds, then off for about 10 seconds.

It looks like you're using a 16 MHz crystal, but setting your frequency to 160 MHz:

#define _XTAL_FREQ 160000000

Once you adjust your code to 16 MHz, each clock cycle is \$1/16,000,000 = 62.5ns.\$

You are calling __delay32(150000000);, which would equate to \$150000000\cdot62.5ns=9.37s\$. So the LED will be on for about ten seconds, then off for about 10 seconds.

It looks like you're using a 16 MHz crystal, but telling the compiler that your frequency is 160 MHz:

#define _XTAL_FREQ 160000000

Once you adjust your code to 16 MHz, each clock cycle is \$1/16,000,000 = 62.5ns.\$

You are calling __delay32(150000000);, which would equate to \$150000000\cdot62.5ns=9.37s\$. So the LED will be on for about ten seconds, then off for about 10 seconds.

Source Link
bitsmack
  • 17.1k
  • 11
  • 58
  • 119

It looks like you're using a 16 MHz crystal, but setting your frequency to 160 MHz:

#define _XTAL_FREQ 160000000

Once you adjust your code to 16 MHz, each clock cycle is \$1/16,000,000 = 62.5ns.\$

You are calling __delay32(150000000);, which would equate to \$150000000\cdot62.5ns=9.37s\$. So the LED will be on for about ten seconds, then off for about 10 seconds.