/* ** ################################################################### ** ** Filename : FreescaleAnalogModule.C ** ** Project : FreescaleAnalogModule ** ** Processor : MC68HC908SR12CB ** ** Version : Driver 01.00 ** ** Compiler : Metrowerks HC08 C Compiler ** ** Date/Time : 21.11.2002, 15:18 ** ** Abstract : ** ** Main module. ** Here is to be placed user's code. ** ** Settings : ** ** ** Contents : ** ** No public methods ** ** ** Copyright: 1997 - 2009 Freescale Semiconductor, Inc. All Rights Reserved. ** ** ** ** http : www.freescale.com ** mail : support@freescale.com ** ** ################################################################### */ /* MODULE FreescaleAnalogModule */ /*Including used modules for compilling procedure*/ #include "Cpu.h" #include "Events.h" #include "AnM1.h" #include "AD1.h" /*Include shared modules, which are used for whole project*/ #include "PE_Types.h" #include "PE_Error.h" #include "PE_Const.h" #include "IO_Map.h" void main(void) { byte channel = 0; byte err = 0; word data = 0; /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/ PE_low_level_init(); /*** End of Processor Expert internal initialization. ***/ /*Write your code here*/ for(;;){ if( channel == 0) { // set the OPIN1 channel err = AnM1_SetChannel(0); channel = 1; } else { // set the internal temperature sensor channel err = AnM1_SetChannel(1); channel = 0; } // start the ADC and the Analog module measuring and wait for result err = AD1_Measure(TRUE); // get the result value (variable data) err = AD1_GetValue(&data); }; /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/ for(;;){} /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/ } /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/ /* END FreescaleAnalogModule */ /* ** ################################################################### ** ** This file was created by Processor Expert 03.08 for ** the Freescale HC08 series of microcontrollers. ** ** ################################################################### */