tersoll
Üye
- Katılım
- 25 Nis 2010
- Mesajlar
- 142
- Puanları
- 1
- Yaş
- 39
#include <16f628.h>
#FUSES NOWDT
#FUSES INTRC_IO
#FUSES NOBROWNOUT
#FUSES NOLVP
#define OSC_PLL_ON
#define OSC_4MHZ
#use delay(int=4000000)
#use fast_io(a)
#use fast_io(b)
#define OSC_32MHZ 8
unsigned int i=0,z=0;
#int_timer1 // timer0 kesmesi
void timer1_kesme()
{
set_timer1(55543);
i++;
if(i==101)
{
output_toggle(pin_b0);
i=0;z++;
if(z==10)
{
output_toggle(pin_b4);
z=0;
}
}
clear_interrupt(int_timer1);
}
void main()
{
set_tris_a(0x00);
set_tris_b(0x00);
output_a(0x00);
output_b(0x00);
setup_ccp1(CCP_OFF);
setup_timer_1(T1_INTERNAL|T1_DIV_BY_1);
set_timer1(55543);
enable_interrupts(INT_TIMER1);
enable_interrupts(GLOBAL);
while(1)
{
output_high(pin_b7);
}
}
32768 osilatörü aldım timer1 in hangi uçlarına bağlıcam ve progrmada eksiklik varmı
#FUSES NOWDT
#FUSES INTRC_IO
#FUSES NOBROWNOUT
#FUSES NOLVP
#define OSC_PLL_ON
#define OSC_4MHZ
#use delay(int=4000000)
#use fast_io(a)
#use fast_io(b)
#define OSC_32MHZ 8
unsigned int i=0,z=0;
#int_timer1 // timer0 kesmesi
void timer1_kesme()
{
set_timer1(55543);
i++;
if(i==101)
{
output_toggle(pin_b0);
i=0;z++;
if(z==10)
{
output_toggle(pin_b4);
z=0;
}
}
clear_interrupt(int_timer1);
}
void main()
{
set_tris_a(0x00);
set_tris_b(0x00);
output_a(0x00);
output_b(0x00);
setup_ccp1(CCP_OFF);
setup_timer_1(T1_INTERNAL|T1_DIV_BY_1);
set_timer1(55543);
enable_interrupts(INT_TIMER1);
enable_interrupts(GLOBAL);
while(1)
{
output_high(pin_b7);
}
}
32768 osilatörü aldım timer1 in hangi uçlarına bağlıcam ve progrmada eksiklik varmı