PIC Vietnam

PIC Vietnam (http://www.picvietnam.com/forum/index.php)
-   Các ngôn ngữ lập trình khác (CCS C, HT PIC,...) (http://www.picvietnam.com/forum/forumdisplay.php?f=12)
-   -   Cho mình hỏi ngắt UART trong 16F887? (http://www.picvietnam.com/forum/showthread.php?t=4803)

trch 22-08-2009 02:38 PM

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)
{

}

}


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

Tên diễn đàn: vBulletin Version 3.8.11
Được sáng lập bởi Đoàn Hiệp.
Copyright © PIC Vietnam