Here are your results. Choose one and enjoy!
These results are based on Timer0 and PIC 18F4550.
But probably will work on yout microcontroller.
Use prescaler and preload.
Prescaler | Preload (16bit) | Why? |
---|
Here is an example of code for your CCS firmware:
//////////////////////////////////////////////////////
//
// Code by PIC Timer Calculator
// Developed by Vinícius Lage from Brazil.
// Email: op.vini@gmail.com
//
// Generate a Hz Timer0 interrupt
//
//////////////////////////////////////////////////////
#include <18F4550.h>
#fuses ,NOWDT,PUT,NOBROWNOUT,NOLVP
#use delay(clock=)
void main(){
setup_timer_0( RTCC_INTERNAL | RTCC_DIV_ );
set_timer0( );
enable_interrupts( INT_TIMER0 );
enable_interrupts( GLOBAL );
}
#int_timer0
void intTimer0(){
set_timer0( + get_timer0() );
// put here your code
// this code will run on the frequecy that you desire
}