Init_TIM
 
 
 Bean Init_TIM for HCS12
 
Timer Interface Module(TIM)
Peripheral Initialization Bean

Peripheral Beans cover all the hardware functionality and they are intended for expert use of the respective peripherals. This bean implements the peripheral initialization of an internal Timer (TIM) module of the Freescale HCS12 MCU derivatives.

Peripheral initialization
The bean contains no high level methods or events, it provides only initialization of the hardware module. By default is the internal initialization called automatically from the "PE_low_level_init" in CPU module, analogous to the initialization of other PE beans. However the calling of this init code in the CPU module can be disabled and the user may call this function in another module.

If the initialization property "Call init in CPU init.code" is set to "no" then the initialization is removed from the CPU module code and the user have to call the 'BeanName_Init()' function elsewhere, i.e. in the main module.

Interrupt service
Processor Expert™ generates interrupt service support of TIM peripheral only for the interrupt vector which the ISR routine name is specified for. Otherwise the interrupts are served by the default routine(s). The support include interrupt vector hooking and priority setting for the respective interrupt vector.

The peripheral beans does not generate code for the interrupt service routines specified in the Interrupts properties group of the Init_TIM bean (see Bean Inspector window). If there are any of the interrupts enabled in the bean the user is responsible for the handling of such ISR's. Correct interrupt service routine "ISR name" must be implemented in the user code.


Warning: This is low level bean. Usually it is not possible to use one setting of this bean for different microcontrollers.
Timer module
The basic timer consists of a 16-bit, software-programmable counter driven by a seven-stage programmable prescaler. This timer contains 8 (or 6) complete input capture/output compare channels and one pulse accumulator. The input capture function is used to detect a selected transition edge and record the time. The output compare function is used for generating output signals or for timer software delays. The 16-bit pulse accumulator is used to operate as a simple event counter or a gated time accumulator. The pulse accumulator shares timer channel 7 when in event mode. A full access for the counter registers or the input capture/output compare registers should take place in one clock cycle. Accessing high byte and low byte separately for all of these registers may not yield the same result as accessing them in one word.

The timer includes these distinctive features:

  • Eight (or six) input capture/output compare channels.
  • Clock prescaling.
  • 16-bit counter.
  • 16-bit pulse accumulator.

Peripheral Initialization Beans provide a low-level hardware approach to initialize registers of the peripheral module. They are intended for experienced users.


This bean belongs to the category: CPU Internal Peripherals-Peripheral Initialization Beans



Processor ExpertTM and Embedded BeansTM are registered trademarks of UNIS, Ltd.
©1997-2005, UNIS, Ltd.