View Single Post
Old 22-04-2009, 07:57 PM   #2
cskiller
Đệ tử 4 túi
 
Tham gia ngày: Aug 2008
Bài gửi: 89
:
Trích:
Nguyên văn bởi tahi View Post
#include "C:\Program Files\PICC\Projects\main.h"
#include "def_877a.h"
#use delay(clock=12000000) //dung thach anh 12Mhz
#use rs232(baud=9600, xmit=PIN_c6, rcv=PIN_c7) //khoi tao truyen thong RS232)

void main()
{ set_tris_b(0x00);
set_tris_d(0x00);
portb=0x55;
//tại sao thêm đoạn code này thì pic lại đơ,portb=0x55, rồi chẳng làm gì nữa
/*
enable_interrupts(GLOBAL); // Cho phep tao ngat
enable_interrupts(INT_EXT); // Cho phep ngat ngoai tai chan RB0/INT
enable_interrupts(INT_RDA); // Cho phep ngat ngoai tai chan RB0/INT
*/
while(true)
{ portb=~portb;
delay_ms(250);

}
}

Chưa định nghĩa #INT_EXT và #INT_RDA ^.^
__________________
Quang báo RG/RGB 6/8/12/16 bits màu
Phone No: 0905.034.086
Email: lmquyen@gmail.com
cskiller vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn