Init_AnalogModule
 
Component Init_AnalogModule for HC08
Analog Module (AnM)
Component Level: Peripheral Initialization
Properties:
(Properties are parameters of the component. Please see the Embedded Components page for more information.)
  • Component name - Name of the component.
  • Device - Selection of the AnM device module
  • Settings - Common AnM module settings
    • Clock settings - Clock/timing settings of the module
      • Clock divider - This item select the analog module input clock divider value. The ADC clock, ADICLK, is divided by this value to obtain AMCLK.
        Set to 2 for optimal performance. (zero in AMCDIV bits)
        This property modifies the AMCDIV[1:0] bits in the AMSCR register.

        There are 4 options:
        • 2: Set this for optimal performance
        • 4:
        • 8:
        • 16:

    • 2-stage amplifier - Internal amplifier settings group
      • DC offset - Set zero for optimal performance. DC offset adjustment for calibration.
        This item modifies DO[2:0] bits in the AMCR register.
      • 1st-stage amplifier gain - First amplifier gain
        This item modifies GAINA[3:0] bits in the AMGCR register.
      • 2nd-stage amplifier gain - Second amplifier gain
        This item modifies GAINB[3:0] bits in the AMGCR register.
      • Real gain - Real gain is calculated by multiplication 1st and 2nd stage amplifier gain (for information only).
  • Pins - Module pins/signals settings
    • Analog module channels - List of input sources used by the analog module. You may add/delete an item with the +/- buttons and select the input source from the roll-down menu.
      One Item of the list looks like:
      Channel0 - Logic Channel number that it is used for select the hardware input source.
      • Source - Internal or external source for the Analog Module. Internal source is only one (Internal temperature sensor).
        The following items are available only if the group is enabled (the value is "external pin"):
    • Current flow detection output - Enable/disable current flow detect module. The sensitivity of the detection is 9mV (0.9 ampere when resistor is 0.01 ohm).
      This item modifies CDOEN bit in the CONFIG2 register.
      The following items are available only if the group is enabled (the value is "Enabled"):
  • Interrupts - Interrupts settings of the module
    • Analog module - Analog module interrupt settings.
      • Interrupt - Interrupt vector (for information only)
      • Analog module interrupt - Enable/disable analog module interrupt. When enabled the CDIF and OPIF flags will generate a CPU interrupt request.
        This item modifies the AMIEN bit in the AMCR register.
      • ISR name - Name of the interrupt service routine (ISR) invoked by this interrupt vector.
        The user code of the routine should handle all respective interrupt flags correctly. The routine must be implemented in the user code, it is not generated by Processor Expert. Find external prototypes of the ISRs in the component module header file.
  • Initialization - Initialization options of the module
    • Modules power control - This item power on/off the different functions within the analog module.
      This item modifies the PWR[1:0] bits in the AMCR register.
    • Initial channel - This item select input source to be amplified by the two-stage amplifier.
      This item modifies the OPCH1 and OPCH0 bits in the AMCR register.

      There are 4 options:
      • Vssam: External negative reference
      • OPIN1/ATD0: External pin
      • OPIN2/ATD1: External pin
      • TSOUT (internal): Internal temperature sensor

    • Call Init method - The Init method of the component may be called after power-on or reset (in initialization code) by PE.
      - yes The Init method is called by PE
      - no The Init method is not called by PE, it should be called in user s code