Saturday, February 4, 2012

Running Microchip PIC18F4550 Microcontroller at 20.000MHz using an external oscillator

MikroC is an easy programming and debugging suite for PIC microcontrollers that gives you a useful library functions that let you quickly setup and run a complete embedded system based on PIC microcontrollers. The configuration dialog of MikroC sometimes become pain for many engineers or enthusiasts as it does not relate very well to the registers shown in the device datasheet.

Following you can find MikroC version 4.15 Configuration Bits Dialog Picture that shows configuration that you will need to set for running your PIC18F4550 or PIC18F2550 Microcontroller at 20.000MHz using an external crystal oscillator:


Make sure that you don't forget to change the "Oscillator Frequency [MHz]" to 20.000MHZ otherwise MikroC compiler will not be able to accurately time its built-in library functions.
Hope you will find this a quick way to run your PIC18F4550 / PIC18F2550 device at 20.000MHz.
Have fun!