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.

PIC16F818 int config

Status
Not open for further replies.

TKS

New Member
hi, i was wondering how i could

set the internal config bits to 8MHz..

the data spec says that you have to set 111 to bit 7 to 5 but i have no idea how to do this..

i want to do this when i program the device soow not when i'm in code.

TKS
 
TKS said:
hi, i was wondering how i could

set the internal config bits to 8MHz..

the data spec says that you have to set 111 to bit 7 to 5 but i have no idea how to do this..

i want to do this when i program the device soow not when i'm in code.

TKS

You simply write that value to the OSCCON register, it's fully explained in the datasheet. You have to do this in your program code (only two lines), you can't do it from the programmer - although you must set the config fuses (in the programmer) to use the internal oscillator.

Code:
movlw b'01110000'
movwf OSCCON

It's as easy as that!.
 
Status
Not open for further replies.

Latest threads

Back
Top