S12Z SW example of COP Watchdog Reset

Document created by iggi Employee on Aug 5, 2015Last modified by ebiz_ws_prod on Dec 13, 2017
Version 10Show Document
  • View in full screen mode

The example demonstrates the COP watchdog reset on MC9S12ZVL32 microcontroller. The code can be used on any MagniV device based on S12Z core.

The example project is created in CodeWarrior v10.6 (Eclipse IDE).

The SW code has been tested on TRK-S12ZVL board.

 

* Brief description:

The Phase Locked Loop (PLL) is set by default to PEI mode, so the bus clock is 6.25MHz based on 1MHz internal RC oscillator (IRC1M).

The RGB LED (red) is used to indicate MCU runs after reset. When the RGB colour changes to green, the COP time-out period has started.
After the period times out, the COP generates a reset and COPRF flag is set.

After the reset, based on COPRF flag, the Blue LED is turned on indicating previous reset has been generated by COP watchdog.

The COP time-out period is set to maximum (CPMUCOP register, bits CR[2:0]=7). The number of COPCLK cycles to time-out is 2^24 = 16777216.

The COPCLK is based on IRCCLK (by default) with 1MHz clock frequency. The maximum COP time-out period in this case is approximately 16.78 seconds.

- On the TRK-S12ZVL board:

  Port P is used to drive RGB LED. Anode is connected to VDDX, a cathode to port  pin. Port P can be set as output (DDRP=0xFF) and logic zero on output enables LED.

 

- Reference documentation:

MC9S12ZVL Family Reference Manual & Datasheet

TRK-S12ZVL Board schematics

Original Attachment has been moved to: EX-TIC-S12ZVL-COP_Watchodg-CW106.zip

2 people found this helpful

Attachments

    Outcomes