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.

16F628 internal oscillator with pic basic???

Status
Not open for further replies.

itsallgood

Member level 2
Joined
Mar 15, 2002
Messages
48
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
329
16f628 internal oscillator

Hi guys,

I've still not really worked out these pesky chips ;) -- im gussing it'll be easier once i buy some and have a mess around, instead of just using simulators, anyway, im reading this site here: http://www.winpicprog.co.uk/pic_tutorial.htm

And the source the site gives you turns on the internal oscillator, which im guessing means you dont have to have the crystal on the OSC1/2 legs.

But i'm using picbasic pro, so dont know how to set it up to use the internal oscillator. -- i'm using MicroCode Studio to run the picbasic pro, my code is just:

loop:
high 0
pause 100
low 0
pause 100
goto loop
end

is there some line of code i need to do before this to make it use the internal oscillator???

Thanks very much,

Regards.
 

picbasic pro 16f628

i looked, and found a line of code that should make it work, but it doesnt:

@ DEVICE pic16F628, INTRC_OSC_NOCLKOUT

all that does is stop my code from compiling.


Im going to join the forum and see what they say.

Cheers.
 

16f628 en basic

You need to configure more things:

@ DEVICE pic16f628, WDT_ON or
@ DEVICE pic16f628, WDT_OFF

@ DEVICE pic16f628, PWRT_ON or
@ DEVICE pic16f628, PWRT_OFF

@ DEVICE pic16f628, BOD_ON or
@ DEVICE pic16f628, BOD_OFF

@ DEVICE pic16F628, PROTECT_ON or
@ DEVICE pic16F628, PROTECT_OFF

@ DEVICE pic16f628, CPD_ON or
@ DEVICE pic16F628, CPD_OFF

@ DEVICE pic16f628, MCLR_ON or
@ DEVICE pic16f628, MCLR_OFF

@ DEVICE pic16f628, LVP_ON or
@ DEVICE pic16f628, LVP_OFF



@ DEVICE pic16F628, INTRC_OSC_NOCLKOUT

OSCCON = %110 ' Set OSC TO 4MHZ 'select the clock
CMCON0 = 7 ' Comparators off ' disable the comparators
ANSEL = 0 ' A/D OFF -- Port pins all digital 'disable the AD
TRISIO = %000000 ' All I/O outputs ' GPIO all output
GPIO = %00000000 ' All 0 on boot

Bye
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top