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.

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.
 

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).
 

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
 

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);


}
 

how to read protect 16f628a

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

16f628a fuses

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

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
 

unprotect 16f628

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

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top