HELP ME
minh dang hoc con pic 16f877.minh thu test ngat ngoai RB.theo nhu minh chay chuong trinh bang tay thi thay OK.nhung khi mo phong bang protues thi lai gap vande.minh chi thuc hien ngat co 1 lan nhung chuong trinh lai luon chay ham ngat ma ko lam viec trong ham main nua(cu the la no khi thuc hien ngat thi no khong hieu ham WHILE ).cac ban xem giup va chi cho minh cach khac phuc cai nay nhe,day la chuong trinh va file mo phong protues cua minh.
link:
http://www.mediafire.com/?y4zjfjz2lwm
Code:
#include <16f877.h>
#device *=16 adc = 10
#fuses hs,nowdt
#use delay (clock=20000000)
int8 a[]={0x03F,0x006,0x05B,0x04F,0x066,0x06D,0x07D,
0x007,0x07F,0x06F};
int8 dem=0;
#int_rb
void demnguoi(){
dem++;
output_d(a[dem]);
delay_ms(500);
}
void main(){
set_tris_b(0xf0);
set_tris_d(0x00);
set_tris_c(0x00);
enable_interrupts(int_rb);
ext_int_edge(l_to_h);
while(1){
output_high(pin_c0);
delay_ms(500);
output_low(pin_c0);
delay_ms(500);
}
}
Chú ý nhớ định dạng bằng thẻ [ code ] và gõ có dấu