Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

How to use INTOSC in 16f628a?

Status
Not open for further replies.

myanm

Newbie level 5
Joined
Dec 28, 2005
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,348
hi!
I'm very new to hi tech.I'd like to know what needs to use INTOSC of 16f628a.
 

CMOS

Advanced Member level 3
Joined
Jan 6, 2004
Messages
864
Helped
94
Reputation
186
Reaction score
50
Trophy points
1,308
Location
USA
Activity points
5,683
ccs c 16f628 input ra5

To use INTOSC you have to set the configuration register bits for the internal oscillator. Your PIC programmer will have option for this setting (Its also called FUSE Setting).
 

C-Man

Advanced Member level 4
Joined
Jul 19, 2001
Messages
1,059
Helped
90
Reputation
180
Reaction score
17
Trophy points
1,318
Activity points
10,191
byte use fuse c 16f628a

This is an example that i am using for 16F628 with internal oscillator:
__CONFIG(PROTECT | CPD | BODEN | WDTE | FOSC2);

best regards
 

respected

Newbie level 6
Joined
Oct 19, 2005
Messages
14
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,281
Activity points
1,442
ccs examples 16f628a

ccs pic compiler used to

#fuses INTRC_IO

Added after 2 minutes:


PIC CLOCK


#include <16F628.h>
#fuses NOWDT,NOPROTECT,NOLVP,INTRC_IO,NOLVP,NOMCLR
#use delay(clock=4000000)

#define DAL_SCL PIN_B3
#define DAL_SDA PIN_A4



#include <ds1624.c>
#include <lcd5.c>
BYTE saat=0;
BYTE dak=0;
BYTE san=0;
BYTE value;
char say=0;
char a=0;
///////////////////////////////7777
void goster()
{
lcd_gotoxy(1,2);
printf(LCD_PUTC, "time %02u",saat);
lcd_gotoxy(8,2);
printf(LCD_PUTC, ":%02u",dak);
lcd_gotoxy(11,2);
printf(LCD_PUTC, ":%02u",san);
}
////////////////////////////////////////
void clock()
{
san++;
if(san==60)
{
san=0;
dak++;
}

if(dak==60)
{
dak=0;
saat++;
}

if(saat==24)
{
saat=0;
}
delay_ms(800);
}
////////////////////////7
void tempt()
{

init_temp();
value = read_temp();
lcd_gotoxy(1,1);
printf(lcd_putc,"\fSICAKLIK:%2u\r\n ",value);
delay_ms(5);

}
/////////////////////////
void ayar()
{


while(1)
{

if((!input(PIN_A7))&&(!input(PIN_A5)))
{
lcd_gotoxy(1,2);
// lcd_send_nibble(0xd);
saat=saat+1;
if(saat==24) saat=0;
}

if((!input(PIN_A6))&&(!input(PIN_A5)))
{
dak=dak+1;
if(dak==60) dak=0;
}

goster();
clock();
tempt();
}
}

//////////////////////////////////////
/////////////////////////////////////////

/////////////////////////////////////
//////////////////////////////////////


void main() {


init_temp();
lcd_init();
setup_comparator(NC_NC_NC_NC);
////////////////////////////////////////////////
lcd_putc("\f MYO PROJESi \n");

delay_ms(4000);
do
{

tempt();
goster();
clock();



for(a=0;a<5;a++)
{
if(!input(PIN_A5))
{
ayar();
}
}




}while(1);


}
 

necati

Member level 1
Joined
Mar 27, 2003
Messages
40
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,288
Location
turkey
Activity points
409
how to read protect 16f628a

#define use_portb_lcd TRUE
#include <lcd.c>
//#include <lcd5.c>
 

alieeldin

Member level 2
Joined
Nov 19, 2005
Messages
46
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Activity points
1,652
16f628a fuses

you will connect the crystal on XTEL1 and XTEL2 and connect 33Pf capacitor between each pin and the ground
 

mrcube_ns

Advanced Member level 1
Joined
Apr 10, 2002
Messages
452
Helped
48
Reputation
96
Reaction score
34
Trophy points
1,308
Location
Europe
Activity points
3,814
internal osc ccs c 16f628a

If I understand well you want to use internal osilator for 628 working. In this case you have 2 choises: use osc pins as I/O pins or use it as osc out pins.

You can read in PICC manual how to do it, the most simplest way is to
use __CONFIG command.

Example for 16f628 (without "a"):

__CONFIG(UNPROTECT & LVPDIS & BOREN & MCLREN & PWRTEN & WDTDIS & INTIO);

The last "INTIO" set fuses to use internall oscilator and pins are I/O.

Tip: UNPROTECT, LVPDIS, BOREN ... this word you can read in "h" file for your mcu.

Best regards,

Mr.Cube
 

noley

Newbie level 1
Joined
Jan 3, 2006
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,288
unprotect 16f628

and u should use the RA5 as reset,pull up.when use the INSOC,it's needed.
 

mrcube_ns

Advanced Member level 1
Joined
Apr 10, 2002
Messages
452
Helped
48
Reputation
96
Reaction score
34
Trophy points
1,308
Location
Europe
Activity points
3,814
fuses intrc_io 16f628a ccs delay

noley is totaly right, I forgot to write reset pin.

I usualy connect reset pin via 100 Ohm to +5V.


Regards,

Mr.Cube
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top