/** ###################################################################
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : MTIM1.C
**     Project   : DC15
**     Processor : MC9S08QG8CPB
**     Beantype  : Init_MTIM
**     Version   : Bean 01.041, Driver 01.02, CPU db: 2.87.108
**     Compiler  : CodeWarrior HCS08 C Compiler
**     Date/Time : 2/15/2007, 3:44 PM
**     Abstract  :
**          This bean provides initialization of the MTIM module.
**          The MTIM is a simple 8-bit timer with several software selectable clock
**          sources and a programmable interrupt. The central component of the MTIM
**          is the 8-bit counter that can operate as a free-running counter or
**          a modulo counter. A timer overflow interrupt can be enabled to generate
**          periodic interrupts for time-based software loops.
**     Settings  :
**          Bean name                                      : MTIM1
**          Device                                         : MTIM
**          Clock source                                   : Bus clock
**          Prescaler                                      : 32
**          Modulo register value                          : 0
**          Period                                         : 1.024 ms
**          Counter Reset                                  : yes
**          Pins                                           : 
**          External clock source                          : Disabled
**          Interrupt                                      : Vmtim
**          Overflow interrupt                             : Enabled
**          ISR name                                       : isrVmtim
**          Call Init method                               : yes
**          Enable MTIM module                             : yes
**     Contents  :
**         Init - void MTIM1_Init(void);
**
**     (c) Copyright UNIS, spol. s r.o. 1997-2006
**     UNIS, spol. s r.o.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
** ###################################################################*/

/* MODULE MTIM1. */

#include "MTIM1.h"

/*
** ###################################################################
**
**  The interrupt service routine(s) must be implemented
**  by user in one of the following user modules.
**
**  If the "Generate ISR" option is enabled, Processor Expert generates
**  ISR templates in the CPU event module.
**
**  User modules:
**      DC15.c
**
** ###################################################################

      ISR(isrVmtim)
      {
      // NOTE: The routine should include the following actions to obtain
      //       correct functionality of the hardware.
      //
      //       The MTIMSC register should be read and
      //       TOF bit must be set to 0 to clear the interrupt request.
      //       Example: MTIMSC;
      //                MTIMSC_TOF = 0;
      }

*/
/*
** ===================================================================
**     Method      :  MTIM1_Init (bean Init_MTIM)
**
**     Description :
**         This method initializes registers of the MTIM module
**         according to this Peripheral Initialization Bean settings.
**         Call this method in user code to initialize the module.
**         By default, the method is called by PE automatically; see
**         "Call Init method" property of the bean for more details.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
void MTIM1_Init(void)
{
  /* MTIMMOD: MOD=0 */
  setReg8(MTIMMOD, 0x00);               
  /* MTIMCLK: ??=0,??=0,CLKS=0,PS=5 */
  setReg8(MTIMCLK, 0x05);               
  /* MTIMSC: TOF=0,TOIE=1,TRST=1,TSTP=0,??=0,??=0,??=0,??=0 */
  setReg8(MTIMSC, 0x60);                
}

/* END MTIM1. */

/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 2.99 [03.85]
**     for the Freescale HCS08 series of microcontrollers.
**
** ###################################################################
*/
