View Single Post
Old 29-12-2010, 03:21 PM   #1
troiuuuu
Đệ tử 1 túi
 
Tham gia ngày: Sep 2010
Bài gửi: 13
:
Không ngắt được

Chào anh em!Mình vừa mới viết ccs nên nhiều điều chưa hiểu mong ae help jum,đoạn code của mình sao nó không vào dc chương trình ngắt khi có sự thay đổi ở PortB(RB4-->RB7)
Đây là code mọi người xem rồi cho ý kiến nha.
Thanks!

#include<16f877a.h>
#include<def_877a.h>
#fuses NOWDT,PUT,XT,NOPROTECT
#use delay(clock=4000000)
#use fast_io(b)
#int_RB
int a;
void ngat_RB()
{
delay_ms(1000);
portd=0;
}

main()
{
set_tris_b(0b11110000);
set_tris_d(0);
enable_interrupts(global);
enable_interrupts(int_RB);
ext_int_edge(H_to_L);
a=0b10000000;
while(1)
{
portd=a;
delay_ms(10);
rotate_right( &a, 1);
delay_ms(100);
portd=a;
}

}
File Kèm Theo
File Type: rar BT5.rar (34.5 KB, 0 lần tải)
troiuuuu vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn