Someone Electro New Member Mar 17, 2005 #1 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?
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?
B BF9000 New Member Mar 17, 2005 #2 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
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
Someone Electro New Member Mar 17, 2005 #3 thanks. good think basic can implant asembely code (Im programing it in mikroBasic)
Someone Electro New Member Mar 17, 2005 #4 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
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
Nigel Goodwin Super Moderator Most Helpful Member Mar 18, 2005 #5 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 Click to expand... Assuming the 16F88 is a supported device?, there should be a command to do it? - try asking at MikroBasic support.
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 Click to expand... Assuming the 16F88 is a supported device?, there should be a command to do it? - try asking at MikroBasic support.