#include #include #include /****************************************** * NOTE: if linking this from the * commandline add the "--heap=512" switch * this gives you a heap size of 512 bytes ******************************************/ _FOSC(HS) _FWDT(WDT_OFF) _FBORPOR(MCLR_DIS&PBOR_OFF&PWRT_16) _FGS(CODE_PROT_OFF&GWRP_OFF) //set fuse bits with the menu thingy //BRG is configured for 20MHz crystal //BRG = FCY/(BAUD_RATE*16) #define BRG 33 void waste_cycles() { int i,j; for(i = 0 ; i < 255;i++) { for(j = 0; j < 255; j++) { Nop(); } } } int main(void) { int config1,config2; config1 = 0x8000; config2 = 0x8400; // configure USART OpenUART1( config1,config2,BRG ); while(1) { printf("Does this work? %u \n\r",config1 ); waste_cycles(); } CloseUART1(); return 0; }