Configuration for running PIC without any external oscillato

General discussion on mikroC PRO for PIC.
Post Reply
Author
Message
Deltaelectronics
Posts: 17
Joined: 14 Oct 2017 16:50

Configuration for running PIC without any external oscillato

#1 Post by Deltaelectronics » 24 Nov 2017 20:45

Hello,
I am new in MikroC compiler for PIC, and in PIC programming too, so I am asking which is the way to run a PIC without using any external oscillator.... In particular I am asking if I need to write additional setting code in my program or, instead, it enoughs to edit the project settings and if I should select 'INTOSC oscillator I/O function on CLKIN pin' as 'Oscillator Selection' parameter...
Which other parameters I have to select, also ?
Advanced thanks
DeltaElectronics

p.erasmus
Posts: 3391
Joined: 05 Mar 2009 10:28

Re: Configuration for running PIC without any external oscil

#2 Post by p.erasmus » 27 Nov 2017 12:45

Hi
'INTOSC oscillator I/O function on CLKIN pin' as 'Oscillator Selection' parameter..
Yes you select the setting in the Configuration of the compiler and additionally you need set the OSCTUN register with the correct value as selected by you from the Oscillator section of the datasheet
this is done by by writing the equivalent hex value which is formed as you select the features (look at the datasheet for your device)
you also need to enter the correct frequency value 4,16Mhz etc according to the INTOSC speed you selected in the compiler settings

Code: Select all

OSCTUN = 0x78 // an example 
P.Erasmus
Saratov,Russia
--------------------------------------------------------------

Post Reply

Return to “mikroC PRO for PIC General”