Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

N00B question:how to change the internal cloks freq.

Status
Not open for further replies.

Someone Electro

New Member
How to change the internal clock on PIC16F88

im using the internal oscilator for the clock but how to chage it (its 31KHz but i want 4 or 8 Mhz)

in the datasheet it ses that the addres is "8Fh" but how do i write that address in WinPic?
 
PIC Code

Here is some code for changing to 4Mhz. Reference the data sheet along with this to get a good idea of how it works. Note that you can write a value to OSCCON in one instruction. I have only done it step by step for easier understanding.

Code:
bsf		STATUS, RP0     ;BANK1

bsf		OSCCON, IRCF2   ;Set oscillator to 4 MHz
bsf		OSCCON, IRCF1   ;110
bcf		OSCCON, IRCF0

bsf		OSCCON, SCS1    ;10
bcf		OSCCON, SCS0

bcf		STATUS, RP0    ;BANK0
 
hmm.. dosent seem to work i still get: click click click click...from my piezo.(the sound demo needs 4MHz but im suning it at 31KHz)

meaby someone knows how to do it in mikroBasic?

i used the "asm" comand to implant the asembely
 
Someone Electro said:
hmm.. dosent seem to work i still get: click click click click...from my piezo.(the sound demo needs 4MHz but im suning it at 31KHz)

meaby someone knows how to do it in mikroBasic?

i used the "asm" comand to implant the asembely

Assuming the 16F88 is a supported device?, there should be a command to do it? - try asking at MikroBasic support.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top