$ifndef __TimerDEFS_INC $define __TimerDEFS_INC (* Interrupt bit mask to be 'anded' with the other configuration masks and * passed as the 'pConfig' parameter to the 'OpenTimer' macros. *) $define TIMER_INT_OFF %01111111 ' Interrupts disabled - bit 7 $define TIMER_INT_ON %11111111 ' Interrupts enabled '-------- Timer 0 Declaration --------------------- (* Timer0 configuration masks -- to be 'anded' together and passed to the * 'OpenADC' macro. *) $define T0_16BIT %10111111 ' Timer 0 is in 16 Bit mode - bit 6 $define T0_8BIT %11111111 ' Timer 0 is in 8 bit mode - bit 6 $define T0_SOURCE_INT %11011111 ' Internal clock source - bit 5 $define T0_SOURCE_EXT %11111111 ' External clock source - bit 5 $define T0_EDGE_RISE %11101111 ' External rising edge clocs timer - bit 4 $define T0_EDGE_FALL %11111111 ' External falling edge clocks timer $define T0_PS_1_1 %11111111 ' Prescaler 1:1 (No Prescaler) - bits 0-3 $define T0_PS_1_2 %11110000 ' 1:2 $define T0_PS_1_4 %11110001 ' 1:4 $define T0_PS_1_8 %11110010 ' 1:8 $define T0_PS_1_16 %11110011 ' 1:16 $define T0_PS_1_32 %11110100 ' 1:32 $define T0_PS_1_64 %11110101 ' 1:64 $define T0_PS_1_128 %11110110 ' 1:128 $define T0_PS_1_256 %11110111 ' 1:256 '-------- Timer 1 Declaration --------------------- (* Timer1 configuration masks -- to be 'anded' together and passed to the * 'OpenADC' macro. *) $define T1_8BIT_RW %10111111 ' 8-bit mode $define T1_16BIT_RW %11111111 ' 16-bit mode $define T1_PS_1_1 %11001111 ' 1:1 prescale value $define T1_PS_1_2 %11011111 ' 1:2 prescale value $define T1_PS_1_4 %11101111 ' 1:4 prescale value $define T1_PS_1_8 %11111111 ' 1:8 prescale value $define T1_OSC1EN_OFF %11110111 ' Timer 1 oscillator enable off $define T1_OSC1EN_ON %11111111 ' Timer 1 oscillator enable on $define T1_SYNC_EXT_ON %11111011 ' Synchronise external clock input $define T1_SYNC_EXT_OFF %11111111 ' Do not synchronise external clock input $define T1_SOURCE_INT %11111101 ' Internal clock source $define T1_SOURCE_EXT %11111111 ' External clock source '-------- Timer 2 Declaration --------------------- (* Timer2 configuration masks -- to be 'anded' together and passed to the * 'OpenADC' macro. *) $define T2_POST_1_1 0x87 ' Postscaler 1:1 $define T2_POST_1_2 0x8F ' Postscaler 1:2 $define T2_POST_1_3 %10010111 ' Postscaler 1:3 $define T2_POST_1_4 %10011111 ' Postscaler 1:4 $define T2_POST_1_5 %10100111 ' Postscaler 1:5 $define T2_POST_1_6 %10101111 ' Postscaler 1:6 $define T2_POST_1_7 %10110111 ' Postscaler 1:7 $define T2_POST_1_8 %10111111 ' Postscaler 1:8 $define T2_POST_1_9 %11000111 ' Postscaler 1:9 $define T2_POST_1_10 %11001111 ' Postscaler 1:10 $define T2_POST_1_11 %11010111 ' Postscaler 1:11 $define T2_POST_1_12 %11011111 ' Postscaler 1:12 $define T2_POST_1_13 %11100111 ' Postscaler 1:13 $define T2_POST_1_14 %11101111 ' Postscaler 1:14 $define T2_POST_1_15 %11110111 ' Postscaler 1:15 $define T2_POST_1_16 %11111111 ' Postscaler 1:16 $define T2_PS_1_1 %11111100 ' Prescale 1:1 $define T2_PS_1_4 %11111101 ' Prescale 1:4 $define T2_PS_1_16 %11111110 ' Prescale 1:16 '-------- Timer 3 Declaration --------------------- (* Timer3 configuration masks -- to be 'anded' together and passed to the * 'OpenTimer' macro. *) $define T3_8BIT_RW 0xFE ' 8-bit mode $define T3_16BIT_RW 0xFF ' 16-bit mode $define T3_PS_1_1 0xCF ' 1:1 prescale value $define T3_PS_1_2 0xDF ' 1:2 prescale value $define T3_PS_1_4 0xEF ' 1:4 prescale value $define T3_PS_1_8 0xFF ' 1:8 prescale value $define T3_SYNC_EXT_ON 0xFB ' Synchronise external clock input $define T3_SYNC_EXT_OFF 0xFF ' Do not synchronise external clock input $define T3_SOURCE_INT 0xFD ' Internal clock source $define T3_SOURCE_EXT 0xFF ' External clock source $define T3_SOURCE_CCP 0xFF ' T3 is source for CCP $define T1_CCP1_T3_CCP2 0xBF ' T1 is source for CCP1 and T3 is source for CCP2 $define T1_SOURCE_CCP 0xB7 ' T1 is source for CCP $endif