hi, i want to setup a 18f4685 to use the 8MHz internal oscillator, and wanted to just turn a pin on and off and mesure the frequency of it. i am using the following program
now my questions are 1. have i set it up correctly to use the internal 8MHz clock?
2. what would your best guess at the frequency be for this clock speed?
i the reason for asking is i put it on the scope and it seems wrong to me i am geting a 47-52 duty cycle (seems reasonable) but a frequency of around 75Hz this seems slow or is that about right?
many thank yous logan
Code:
#pragma config OSC = IRCIO67, PWRT = OFF, WDT = OFF, MCLRE = ON, DEBUG = OFF, LVP = OFF //..............Fuse stup
#include <p18f4682.h>
#include <stdio.h>
#include <delays.h>
void main (void)
{
OSCCONbits.IRCF0=1;
OSCCONbits.IRCF1=1;
OSCCONbits.IRCF2=1;
Nop();
while(OSCCON & 0x02);
TRISCbits.TRISC1=0;
//Nop();
while(1);
{
LATCbits.LATC1=1;
LATCbits.LATC1=0;
}
}
now my questions are 1. have i set it up correctly to use the internal 8MHz clock?
2. what would your best guess at the frequency be for this clock speed?
i the reason for asking is i put it on the scope and it seems wrong to me i am geting a 47-52 duty cycle (seems reasonable) but a frequency of around 75Hz this seems slow or is that about right?
many thank yous logan