#include #include #include #include "lcd.h" void AD_init(void) { ADON = 1; } void rs232_init(void) { SPEN = 0; // Serial Port Enable Bit... 0 = disabled TRISC6 = 0; TRISC7 = 1; SYNC = 0; // SYNC switches between async(0) and sync(1) mode. SPBRG = 25; TXSTA = 0x24; RCSTA = 0x90; SPEN = 1; } void interrupt_init(void) { // Assumes that all interrupts default is 0 PEIE = 1; GIE = 1; RCIE = 1; } void pic18_io_init(void) { TRISA0 = 1; TRISB1 = 1; TRISB2 = 1; TRISB3 = 1; TRISB4 = 1; } void interrupt_recieve_handler(void) { // Handle recieve inputs... } void interrupt interrupt_handler(void) // Finds out what interrupt have been trigged, and starts the respective function. { if(RCIF == 1) { interrupt_recieve_handler(); RCIF = 0; } } void main() { AD_init(); rs232_init(); pic18_io_init(); if(GODONE==0) { } }