Em dùng bootloader cấu himhf như sau :
Code:
#include <p30f4012.h>
#include "stdio.h"
#include "uart.h"
_FOSC(CSW_FSCM_OFF & XT_PLL4); //Set up for crystal multiplied by 4x PLL
_FWDT(WDT_OFF); //Turn off the Watch-Dog Timer.
_FBORPOR(MCLR_EN & PWRT_OFF); //Enable MCLR reset pin and turn off the power-up timers.
_FGS(CODE_PROT_OFF);
Phần khai báo UART như hướng dẫn của anh.Em sử dụng hàm
void OpenUART1(unsigned int config1,unsigned int config2, unsigned int ubrg) .Phần giao tiếp với PC hoạt động tốt