View Single Post
Old 12-10-2009, 02:46 PM   #3
ngocnguyen_pm05
Nhập môn đệ tử
 
Tham gia ngày: Aug 2009
Bài gửi: 1
:
Mình có đoạn code:

#include<16f877a.h>
#fuses hs,nolvp,nowdt,noprotect
#use delay(clock=400000)
#include"lcd_4bit.c"
int giatritocdoc,dem;
//#int_timer0
//void timer0()
//{
//set_timer0(155);
//dem=dem+1;
//output_d(dem);
//}
#int_timer1
void timer1()
{
set_timer1(15535);//dat tao thoi gian 0.1 s cho bo chia 2 tan so 4mhz
giatritocdoc=dem;
output_d(0xff);//de thu co chay hay khong
dem=0;
}
void main()
{
setup_timer_1(T1_INTERNAL/T1_DIV_BY_2);
//setup_timer_0(RTCC_DIV_2|RTCC_EXT_L_TO_H);
//set_timer0(155);
set_timer1(15535);dat gia tri dau
enable_interrupts(GLOBAL);
//enable_interrupts(INT_TIMER0);
enable_interrupts(INT_TIMER1);
while(1)
}
sao nó không chạy được nhờ các sư huynh sửa giúp. Thanks
ngocnguyen_pm05 vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn