Content including 1) peripheral features, work logic and work method; 2) driver design logic and use method; 3) typical use case.
More...
Peripheral features and how this peripheral works
The PMC module contains the core voltage regulators and power monitoring circuitry. Its function is to ensure that the chip is operated only within legal voltage ranges and to assist in the orderly shutdown of the chip in the event that the power supply is interrupted. The PMC module also regulates the internal voltage rails for the core digital and analog logic.
Chip-specific information
- Voltage detection option 2.7v voltage detection temporarily support MC56F81xxx-MC56F84xxx. 2.65V voltage detection temporarily support MC56F80xxx.
Fetures
- Supports multi-level low voltage detection(including 2.0V, 2.2V, and 2.7V/2.65V), and multi-type low voltage interrupt(including kPMC_2P2VLowVoltageInterruptEnable,kPMC_2P7VLowVoltageInterruptEnable/kPMC_2P65VLowVoltageInterruptEnable, kPMC_2P2VHighVoltageInterruptEnable,kPMC_2P7VHighVoltageInterruptEnable/kPMC_2P65VHighVoltageInterruptEnable). When the input supply drops below 2.0V, the PMC module will assert the POR(Power On Reset). If the input supply drops consistently below 2.2V, the PMC module can be configured to generate the LVI22 low voltage interrupt. If the input supply drops consistently below 2.7V/2.65V,the PMC module can be configured to generate the LVI27/LVI265 low voltage interrupt.
- Inside the regulator, there is the bandgap reference, the buffer can be enabled to drive the 1.2V bandgap reference to the ADC
How this peripheral works
Inside the PMC module, the input supply is processed by the internal POR_LVI analog module to generate an internal power-on reset and 2.2V low voltage and 2.7V/2.65V low voltage detection signals. The PMC module performs de-glitch functions on these signals and uses them to generate noise-free versions of the raw POR and low voltage detects. When the input supply is below 2.0V, the internal POR circuit can assert the internal PORT. Inside the PMC module, the LVI logic uses four interrupts enables and two low voltages detects for 2.7V/2.65V and 2.2V to generate a single low voltage interrupt. By properly enabling those four interrupts based upon the current input supply voltage range, the LVI can be configured to generate interrupts at any possible falling or rising transition of two fixed voltage levels.
How this driver is designed to make this peripheral works.
Based on the features of the PMC module, the APIs can be divided in 3 groups:
- Bandgap Control Interfaces The APIs in this function group can be used to control the bandgap in regulator, such as to set the bandgap trim value.
- Interrupt Control Interfaces The APIs in this function group can be used to enable/disable the PMC module's interrupts.
- Status Flags Inferfaces The APIs in this function group can be used to get/clear status flags.
How to use this driver
- To get the voltage detection status flag, invoke PMC_GetStatusFlags() function. In the result value kPMC_Sticky2P7VLowVoltageFlag indicates that the input supply dropped below the 2.7V level at some point,and kPMC_Sticky2P2VLowVoltageFlag indicates that the input supply dropped below the 2.2V level at some point, and kPMC_Sticky2P65VLowVoltageFlag indicates that the input supply dropped below the 2.65V level at some point. To clear those sticky flags, users can invoke PMC_ClearStatusFlags().
Typical Use Case
- 2.7V/2.65V low voltage detection When the input supply is above 2.7V/2.65V, and the users want to enable 2.7V/2.65V low voltage detection, the template is shown below.When the device is MC56F80xxx, the status flag kPMC_2P7VLowVoltageFlag is changed to kPMC_2P65VLowVoltageFlag and the kPMC_2P7VLowVoltageInterruptEnable is changed to kPMC_2P65VLowVoltageInterruptEnable in the sample code. In this type of use case, when the input supply is above 2.7V/2.65V, to enable 2.7V/2.65V low voltage interrupt, both kPMC_2P2VHighVoltageInterruptEnable and kPMC_2P7VHighVoltageInterruptEnable/kPMC_2P65VHighVoltageInterruptEnable should be disabled. Enabling kPMC_2P7VLowVoltageInterruptEnable/kPMC_2P65VLowVoltageInterruptEnable and disabling kPMC_2P2VLowVoltageInterruptEnable will assert low voltage interrupt when the input supply drops below 2.7V/2.65V.
- 2.2V high voltage detection When the input supply is below 2.2V, and the users want to enable 2.2 high voltage detection, the template is shown below.When the device is MC56F80xxx, the sample code should status flag kPMC_2P7VLowVoltageFlag should be changed to kPMC_2P65VLowVoltageFlag. In this type of use case, when the input supply is below 2.2V, to enable 2.2V high voltage interrupt, both kPMC_2P2VLowVoltageInterruptEnable and kPMC_2P7VLowVoltageInterruptEnable/kPMC_2P65VLowVoltageInterruptEnable should be cleared. Enabling kPMC_2P2VHighVoltageInterruptEnable and disabling kPMC_2P7VHighVoltageInterruptEnable/kPMC_2P65VHighVoltageInterruptEnable assert low voltage interrupt when the input supply rises above 2.2V.
- 2.7V/2.65V high voltage detection When the input supply is below 2.7V/2.65V and above 2.2V, and the users want to enable 2.7V/2.65V high voltage detection, the template is shown below.When the device is MC56F80xxx, the status flag kPMC_2P7VLowVoltageFlag is changed to kPMC_2P65VLowVoltageFlag and the kPMC_2P7VHighVoltageInterruptEnable is changed to kPMC_2P65VHighVoltageInterruptEnable in the sample code. In this type of use case, when the input supply is below 2.7V/2.65V and above 2.2V, to enable 2.7V/2.65V high voltage interrupt, kPMC_2P7VHighVoltageInterruptEnable/kPMC_2P65VHighVoltageInterruptEnable and kPMC_2P2VHighVoltageInterruptEnable should be disabled. Enabling kPMC_2P7VLowVoltageInterruptEnable/kPMC_2P65VLowVoltageInterruptEnable and disabling kPMC_2P2VLowVoltageInterruptEnable assert low voltage interrupt only if the input supply rises above 2.7V/2.65V.