Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

osccon register on 16f690

Status
Not open for further replies.

newbie111

Member level 2
Member level 2
Joined
Nov 29, 2009
Messages
51
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
h.k
Activity points
1,609
hi folks,

i do not quite understand the bit 0 on osccon register


Code:
bit 0 SCS: System Clock Select bit
1 = Internal oscillator is used for system clock
0 = Clock source defined by FOSC<2:0> of the Configuration Word register
What is fosc<2:0>?

if i want to use 8m internal osc should i set this bit to "o"?

the whole setting is osccon 01110110? is it correct?

Thank you
 

fosc<2:0> is the first 3 bits of the configuration register, which is written during the programming of the device.

I have no experience with this model, but I think your setting of oscon (01110110) is correct if you configured the fosc<2:0> as "100" (see "Special Features of the CPU" section in datasheet).

Normally, for internal clock source, SCS must be 1. This bit allows you to switch between internal and external clock sources during runtime. But the datasheet states that when SCS = 0, the settings of fosc<2:0> is used, that's why I think SCS = 0 can be used for internal clock when fosc<2:0> is properly configured. Actualy, as you don't have a external OSC, I guess this is your only option.
 

    newbie111

    Points: 2
    Helpful Answer Positive Rating
I believe those three bits are used to select which internal oscillator divider you want to use. If the internal oscillator is 8MHz, you can select 1:2 divider and have a 4MHz clock going to the CPU.
 

    newbie111

    Points: 2
    Helpful Answer Positive Rating
To use the internal oscillator at 8MHz, the OSCON should be set to 0x70 and the CONFIG bits set to INTIO.
The SCS bit is used, in conjunction with bit 10 in the CONFIG register, for clock switching between the internal and external clocks. This is for two speed start up and oscillator fail safe applications. Two speed start up is used when the program makes heavy use of the low power modes.
Bits 3, 2 and 1 in the OSCON register are read only bits that reflect the state of the internal oscillator.
 

Thank you all for answering my question.


:)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top