#define USE_OR_MASKS
#include <p18cxxx.h>
#include <usart.h>
#if defined (__18F66K80) || defined (__18F46K80)
#pragma config FOSC = HS1,PLLCFG=ON, WDTEN = OFF, XINST = OFF,CANMX = PORTB,SOSCSEL = DIG// 撥碼開個需配置
#endif
void main()
{
char temp2;
Open1USART (USART_TX_INT_OFF & USART_RX_INT_OFF &
USART_ASYNCH_MODE & USART_EIGHT_BIT &
USART_CONT_RX & USART_BRGH_HIGH, 103);
while(1)
{
if(temp2 == 0x01)
{
putc1USART(temp2);
delay1s();
}
}
} |