Nhờ mọi người xem chương trình này mình viết tại sao ko chạy được. Mình sử dụng timer0 để tạo thời gian delay bật tắt các led gắn vào portb của pic 16f877a, nhưng ko hiểu sao ko chạy được.
Chương trình như sau:
Code:
#include <16f877a.h>
#fuses nowdt,noprotect,put,xt
#use delay(clock=4000000)
#use fast_io(b)
#byte portb=0x06
#int_timer0
void ngat_tm0(void)
{
portb=0xff;
}
void main()
{
set_tris_b(0);
enable_interrupts(global);
enable_interrupts(int_timer0);
set_timer0(250);
setup_timer_0(rtcc_internal|rtcc_div_8);
while(1)
{
portb=0x00;
}
}