PIC Vietnam

Go Back   PIC Vietnam > Microchip PIC > Các ngôn ngữ lập trình khác (CCS C, HT PIC,...)

Tài trợ cho PIC Vietnam
Trang chủ Đăng Kí Hỏi/Ðáp Thành Viên Lịch Bài Trong Ngày Vi điều khiển

 
 
Ðiều Chỉnh Xếp Bài
Prev Previous Post   Next Post Next
Old 22-08-2009, 02:38 PM   #1
trch
Nhập môn đệ tử
 
Tham gia ngày: Oct 2007
Bài gửi: 5
:
Cho mình hỏi ngắt UART trong 16F887?

cho mình hỏi mình làm truyền nhận uart thì dc rùi lúc đó thì chưa có ngắt. Khi mình đưa ngắt vào thì ko chạy dc. Bạn nào biết sai ở đâu trong code mình chỉ giúp mình nhé. Cảm ơn nhiều nhiều.
Trích:
#include "C:\Documents and Settings\trungchanh108\My Documents\chuong trinh viet cho pic\ngatuart\main.h"
#include <stdio.h>
#use delay(clock=12000000)

#int_RDA
void RDA_isr(void)
{
int8 k;
k=getc();
putc(k);
}



void main()
{

setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard

enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);
//Setup_Oscillator parameter not selected from Intr Oscillator Config tab

// TODO: USER CODE!!
delay_ms(100);
printf("chanh");
delay_ms(100);
while(true)
{

}

}
trch vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn
 


Quyền Sử Dụng Ở Diễn Ðàn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Smilies đang Mở
[IMG] đang Mở
HTML đang Tắt

Chuyển đến


Múi giờ GMT. Hiện tại là 01:24 PM.


Được sáng lập bởi Đoàn Hiệp
Powered by vBulletin®
Page copy protected against web site content infringement by Copyscape
Copyright © PIC Vietnam