I haven’t posted anything in a while, so here is some C18 code for a starting off a project.
#include#include #include #include #pragma config OSC = INTIO67 //Internal oscillator #pragma config FCMEN = OFF #pragma config IESO = OFF #pragma config PWRT = ON #pragma config BOREN = OFF #pragma config WDT = OFF #pragma config MCLRE = OFF //MCLR is disabled #pragma config PBADEN = OFF #pragma config LVP = OFF #pragma config XINST = ON //extended mode enabled long int i = 0; void delay1s() { Delay10KTCYx(200); Delay10KTCYx(200); Delay10KTCYx(200); Delay10KTCYx(200); } void main() { OSCCON = 0b01110000; //8 MHz OSCTUNE = 0b01011111; //enable PLL TRISC = 0x00; //PORTC is all output stdout = _H_USART; //Set to user-defined output stream via _user_putc OpenUSART(USART_TX_INT_OFF & USART_RX_INT_OFF & USART_ASYNCH_MODE & USART_EIGHT_BIT & USART_CONT_RX & USART_BRGH_LOW, 51); while(1) { delay1s(); printf("ping! %li\n", i); i++; } }
Here’s the project itself: Click to Download
Fun stuff, but you lost your #include statements. Nice blog, BTW. I added you to my blogroll. http://mchpjasonk.blogspot.com/
ReplyDeleteThe full source (including valid include statements) is in the download link.
ReplyDeleteThanks!
Added your blog as well!
Just replace all "<" in your code by "<", they will appear as "<".
ReplyDeleteOK, I will try again: Just replace all "<" by "<", they will appear as "<".
ReplyDeleteThanks. I'll not forget that next time.
ReplyDelete