PDA

View Full Version : How to use Internal Oscillator?



xobx
- 18th September 2007, 16:55
This is my config now


@ device pic16F648A, hs_osc, wdt_off, mclr_on, lvp_off, protect_off


Is it only to change "hs_osc" to "xt_osc" to use the Internal Oscillator?
Or how should I do?


@ device pic16F648A, xt_osc, wdt_off, mclr_on, lvp_off, protect_off

Kamikaze47
- 18th September 2007, 17:51
which assembler are you using? MPASM?

I know how to do it for MPASM, which is to change ur config to:

__config _INTOSC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF

u could try this if you dont use MPASM (but i'm not 100%):

@ device pic16F648A, intosc_osc_noclkout, wdt_off, mclr_on, lvp_off, protect_off

xobx
- 18th September 2007, 19:30
MPSAM..?


http://img205.imageshack.us/img205/5717/sdfdfsdfzs8.jpg

???

.

Archangel
- 18th September 2007, 19:47
Hi xobx,
Microcode studio uses an assembler called PM by default. Mpasm is the assembler used by Microchip. The config listed below is for PM.

@ DEVICE pic16F648, INTRC_OSC_NOCLKOUT, wdt_off, mclr_on, lvp_off, protect_off

<p>
See the link listed below for some fine samples, courtesy of Melanie.
http://www.picbasic.co.uk/forum/showthread.php?t=543.

To use MAPSM as the assembler you have to tell Microcode Studio, to use it.

Kamikaze47
- 18th September 2007, 19:49
Microcode Studio is an editor - To write your code
Picbasic Pro is a compiler - To compile your PBP code into assembly code
MPASM is an assember - To assemble the assembly code into machine code the PIC will understand.

You can check to see if you are using MPASM by going to the View menu in MicroCode Studio, choosing Comple and Program Options, and then clicking the Assembler tab. If Use MPASM is ticked, you are using MPASM.

If that is the case, go to the 16F648A.INC file in your PBP directory, and change "__config _XT_OSC" to "__config _INTOSC_OSC_NOCLKOUT"