--- trunk/Embedded/main.lst 2007/11/28 17:00:45 82 +++ trunk/Embedded/main.lst 2007/11/29 13:23:57 100 @@ -4,53 +4,64 @@ 4: 5: #include "lcd.h" 6: - 7: - 8: void rs232_init(void) - 9: { - 10: SPEN = 0; // Serial Port Enable Bit... 0 = disabled - 11: TRISC6 = 0; - 12: TRISC7 = 1; - 13: SYNC = 0; // SYNC switches between async(0) and sync(1) mode. - 14: SPBRG = 25; - 15: TXSTA = 0x24; - 16: RCSTA = 0x90; - 17: SPEN = 1; - 18: } - 19: - 20: void interrupt_init(void) - 21: { - 22: // Assumes that all interrupts default is 0 - 23: PEIE = 1; - 24: GIE = 1; - 25: RCIE = 1; - 26: } - 27: - 28: void pic18_io_init(void) - 29: { - 30: TRISA0 = 1; - 31: TRISB1 = 1; - 32: TRISB2 = 1; - 33: TRISB3 = 1; - 34: TRISB4 = 1; - 35: } - 36: - 37: void interrupt_recieve_handler(void) - 38: { - 39: // Handle recieve inputs... - 40: } - 41: - 42: void interrupt interrupt_handler(void) - 43: { - 44: if(RCIF == 1) - 45: { - 46: interrupt_recieve_handler(); - 47: RCIF = 0; - 48: } - 49: } - 50: - 51: - 52: void main() - 53: { - 54: rs232_init(); - 55: pic18_io_init(); - 56: } + 7: void AD_init(void) + 8: { + 9: ADON = 1; + 10: } + 11: + 12: void rs232_init(void) + 13: { + 14: SPEN = 0; // Serial Port Enable Bit... 0 = disabled + 15: TRISC6 = 0; + 16: TRISC7 = 1; + 17: SYNC = 0; // SYNC switches between async(0) and sync(1) mode. + 18: SPBRG = 25; + 19: TXSTA = 0x24; + 20: RCSTA = 0x90; + 21: SPEN = 1; + 22: } + 23: + 24: void interrupt_init(void) + 25: { + 26: // Assumes that all interrupts default is 0 + 27: PEIE = 1; + 28: GIE = 1; + 29: RCIE = 1; + 30: } + 31: + 32: void pic18_io_init(void) + 33: { + 34: TRISA0 = 1; + 35: TRISB1 = 1; + 36: TRISB2 = 1; + 37: TRISB3 = 1; + 38: TRISB4 = 1; + 39: } + 40: + 41: void interrupt_recieve_handler(void) + 42: { + 43: // Handle recieve inputs... + 44: } + 45: + 46: void interrupt interrupt_handler(void) + 47: // Finds out what interrupt have been trigged, and starts the respective function. + 48: { + 49: if(RCIF == 1) + 50: { + 51: interrupt_recieve_handler(); + 52: RCIF = 0; + 53: } + 54: } + 55: + 56: + 57: void main() + 58: { + 59: AD_init(); + 60: rs232_init(); + 61: pic18_io_init(); + 62: + 63: if(GODONE==0) + 64: { + 65: + 66: } + 67: }