Ðề tài: CCS C for PIC16F877A
View Single Post
Old 28-04-2007, 10:40 AM   #179
anh_gioi
Đệ tử 6 túi
 
Tham gia ngày: Oct 2006
Bài gửi: 147
:
cần hỏi

:
//************************************************** ***************************
// Author : nhh
// Date : 03/04/06
// Hardware: PIC16F877A
//************************************************** ***************************
#include <16F877A.h>
#fuses NOWDT,PUT,XT,NOPROTECT
#use delay(clock=4000000)
#use fast_io(b)
#use fast_io(d)
#byte portb=0x06
#byte portd=0x08
const unsigned char digital[]={0b00000110, 0b01011011, 0b01001111, 0b01100110,\
0b01101101, 0b01111101, 0b00000111, 0b01111111, 0b01101111};
// ma hoa digital duoi dang mang
// Chuong trinh ngat
#int_ext
void ngat_RB0()
{
int i;
if(i<9)
{
portd=digital[i];
++i;
}
if(i==9)
{
i=0;
}
}
// Chuong trinh chinh
main()
{
set_tris_b(0b00000001);
set_tris_d(0);
enable_interrupts(global);
enable_interrupts(int_ext);
ext_int_edge(H_to_L);
portd=0b00111111;
while(true)
{
// chi doi ngat nen vong lap nay ko co gi ca !
}
}




cho mình hỏi trong chương trình này thì :
lệnh này :
#use fast_io(b)

#use fast_io(d)

#byte portb=0x06

#byte portd=0x08
có ý nghĩa là gì vậy?
và lệnh này nữa: #int_ext
chưa hết: enable_interrupts(global);

enable_interrupts(int_ext);

ext_int_edge(H_to_L);
cám ơn nha
anh_gioi vẫn chưa có mặt trong diễn đàn