Contents
Previous Chapter
Next Chapter



7 System Support Module

Internal clocks and resets for eCOG1X are generated by the System Support Module (SSM).

The operations of the system support module are grouped into two main functional areas. The SSM controls all internal clocks for the eCOG1X CPU and peripherals, and it also controls all CPU and peripheral internal resets. Five clock sources are used to provide all eCOG1X internal system clocks. Two crystal oscillators provide two accurate reference clocks which can be driven into two PLLs providing a further two reference clocks. A relaxation oscillator provides a fifth clock source that requires no external components. eCOG1X provides a controlled power on reset and allows software reset control of the CPU and individual peripherals.

The SSM also provides a module for controlling the CPU clock whilst in sleep mode.

The following diagram shows the principal modules of the SSM.

Figure 12: Principal modules in the eCOG1X SSM.

7.1 System Clock Control

eCOG1X clock control is provided using four principal functional blocks.

System clocks and PLLs
CPU/memory clock selector
Divider chains
Peripheral clock selectors

Five primary clocks are generated by the system clock generator. These in turn drive the CPU/memory clock select block to control the clocks for the eCOG1X CPU and memories. The peripheral clock divider chains use the primary clocks to provide a series of divided clock outputs. These are selected by the peripheral clock selector block for the various eCOG1X peripherals.

The clock control functional blocks and relationships are shown in the following diagram.

Figure 13: Detailed eCOG1X clocking scheme.

7.1.1 Clock Configuration

The recommended order for system clock configuration is to set the PLLs as required in the System Clock Generation block, configure the dividers in the CPU/Memory Clock Selector block, configure the peripheral clock divider chains and then to select the clocks to the peripherals as required in the Peripheral Clock Selector. In general, each peripheral can select a divider chain, a divider tap output from the selected divider chain, and a clock prescaler division factor.

7.1.2 System Clock Generation

This block controls the five primary system clocks.

Two crystal oscillator circuits are available for use with external quartz crystals. The low reference oscillator is used with a low frequency crystal, such as a 32.768kHz watch crystal, and generates the low reference clock. The high reference oscillator is used with a higher frequency crystal, with a frequency between 5MHz and 10MHz, and generates the high reference clock. The recommended high reference crystal frequency is 8.0MHz.

The external quartz crystals used with the two oscillators each require two load capacitors. The maximum load capacitance value for the 32kHz oscillator is 25pF, and for the 8MHz oscillator is 32pF. This includes any package and stray capacitance due to the circuit board layout. The recommended load capacitor values are 10pF for the 32kHz oscillator and 22pF for the 8MHz oscillator. Higher capacitor values increase slightly the power consumption of the oscillator circuits.

A relaxation oscillator provides a third clock source which can be used with no external components for minimum cost systems, provided the application does not require an accurate clock frequency. On devices in the 208BGA package, the relaxation oscillator frequency can be adjusted over a range from 1MHz to 11MHz by changing the value of an external resistor connected from the REXT pin to GND. In the smaller 68QFN and 100QFN packages, the relaxation oscillator runs at the frequency corresponding to an open circuit at the REXT pin with the external resistor not fitted, nominally 1MHz.

Two PLL multipliers are provided to generate a further two higher frequency system clocks. The low frequency PLL is driven by the low reference clock and multiplies the clock frequency by a factor between x2 and x305, providing an output frequency from 65.536kHz to 9.99MHz. The high frequency PLL is normally driven by the high reference clock for best performance with low jitter. It multiplies the selected clock frequency by a factor between x2 and x50, providing an output frequency from 16MHz to 400MHz from the nominal 8.0MHz crystal. The multiplication factors for the two PLLs are set under software control by writing to the low_pll_sel and high_pll_sel fields in the ssm.pll_ctrl register.

The high PLL can also be driven by the low PLL clock or the relaxation oscillator clock. This can save the external components used for the high reference crystal oscillator and the power consumption of the oscillator, but has poorer clock jitter performance. Setting the pll_stepup field in the ssm.pll_cfg register feeds the output of the low PLL into the input of the high PLL. This allows the 32kHz crystal to generate high speed internal clocks up to 400MHz. Setting the relax_pll field in the ssm.pll_cfg register feeds the output of the relaxation oscillator into the input of the high PLL. Note that the user must ensure that the output frequency of the low PLL or the relaxation oscillator remains within the allowed input frequency range for the high PLL (TBD) when either of these two options is enabled.

The oscillators and PLLs are enabled, disabled and their status read from the low_osc, high_osc, relax_osc, low_pll and high_pll fields in the ssm.clk_en1, ssm.clk_dis1 and ssm.sts1 registers. The clock sources are controlled by a hardware interlock to ensure that they cannot be disabled if they are being used to generate the CPU clock and to prevent any condition that might cause the eCOG1X to lockup.

7.1.3 CPU/Memory Clock Selector

The CPU/memory clock selector contains logic for detecting valid running clocks and selecting the master clock from the available running clocks. It also provides a prescaler and divider to control the frequencies of the clocks to the CPU and memory devices.

Control logic in this block selects the clock source for the master clock in_clk from the available primary clocks. The master clock is used to generate clocks for the memory devices and for the eCOG1X CPU. Two divider blocks are used to generate the memory and cpu clocks mem_clk and cpu_clk. The first divider divides the master clock in_clk by a factor determined by the prescaler field in the ssm.cpu register and generates mem_clk for the on-chip memory blocks. The second divider divides mem_clk by a factor determined by the cpu_clk_div field in the ssm.cpu register and generates cpu_clk for the processor core. The smallest overall division from in_clk to cpu_clk is 2 and the largest is 128.

At power-on, either the high reference clock or low reference clock is selected, dependent on which is available. Software selects the clock source for in_clk by writing to the clk_sel field in the ssm.cfg register. A clock source is only selected successfully if it is enabled and producing an output clock signal. The sts field in the ssm.cpu register indicates which clock source is currently selected.

7.1.4 Divider Chains

There are five 16-bit divider chains, each clocked from one of the principal system clock sources, and used to produce the source clock signals for all the peripheral modules. The divider chains provide a range of clock frequencies to the internal peripherals, to be selected according to the speed of the peripheral or any low power requirements of the application. For each peripheral module, one output from one of the five divider chains is selected to provide its clock signal.

Each of the 16 outputs from the five divider chains are fed into the peripheral clock selector block, giving a total of 80 possible clock source frequencies for each peripheral.

7.1.5 Peripheral Clock Selector

Each peripheral can be set to use one of the five divider chains for its clock source. Note that some peripherals are grouped together and share the same divider chain selection.

Three registers are used to select the clock source and divider chain for each peripheral or group. Each peripheral or group has a three-bit field in one of these registers, which selects one of the five clock sources and its associated divider chain.

Table 21: Clock source selection values

Bit field value

Selected clock source

0

Off (disabled)

1

High reference oscillator

2

High PLL

4

Low reference oscillator

5

Low PLL

7

Relaxation oscillator

ssm.clk_src1

This register contains bit fields for selecting the clock source and divider chain for the DUART1, DUART2 and DUSART peripherals, and for timer groups 1 and 2.

ssm.clk_src2

This register contains bit fields for selecting the clock source and divider chain for the USB and analogue peripherals, the flash memory auto power down timer, and for two groups, (1) ESPI and I2S, and (2) LCD controller and sleep timeout counter.

ssm.clk_src3

This register contains a bit field for selecting the clock source and divider chain for the Ethernet MAC and dual smart card (DSCI) peripherals.

An additional register ssm.tmr_src is used to select either timer group 1 or group 2 (and the associated clock source and divider chain) for each of the timer peripherals CNT1, CNT2, PWM1, PWM2, CAP, WDOG, TMR, LTMR and MCPWM.

Six registers, detailed below, are used to select one clock output from the divider chains. The selected divider chain output is used as the clock input to the peripheral. Each peripheral module has a four-bit field in one of these registers, which selects one of the 16 outputs from the divider chain driven by the selected clock source. Setting this field to '1111' selects the fastest output of the divider chain, corresponding to a clock frequency equal to the selected source clock divided by two. Setting the field to '0000' selects the slowest output, corresponding to a clock frequency equal to the selected source clock divided by 216. Other values select the outputs and associated division ratios between these two extremes.

ssm.clk_div1

This register contains bit fields for selecting one of the sixteen divider chain outputs for the sleep timeout counter, DUART1, DUART2 and DUSART peripherals.

ssm.clk_div2

This register contains bit fields for selecting one of the sixteen divider chain outputs for the CNT1, CNT2, PWM1 and PWM2 peripherals.

ssm.clk_div3

This register contains bit fields for selecting one of the sixteen divider chain outputs for the CAP, WDOG, TMR and LTMR peripherals.

ssm.clk_div4

This register contains bit fields for selecting one of the sixteen divider chain outputs for the MCPWM, USB, USB wakeup and ESPI peripherals.

ssm.clk_div5

This register contains bit fields for selecting one of the sixteen divider chain outputs for the I2S, LCD, ADC1 and ADC2 peripherals.

ssm.clk_div6

This register contains bit fields for selecting one of the sixteen divider chain outputs for the DACs, flash auto power down timer, Ethernet MAC and dual smart card (DSCI) peripherals.

Five registers are used to set a clock prescaler division factor for most peripherals. Note that some peripheral modules do not have a clock prescaler at this point in the SSM, and the LCD and MCPWM peripherals have their own separate prescalers within the peripheral block itself. Each peripheral module with a prescaler in the SSM has a four-bit field in one of these registers. The prescaler division factor is equal to one higher than the value of the bit field, thus providing a range of division factors between 1 and 16.

ssm.prescale1

This register contains bit fields to set the clock prescaler division factor for the UART1A, UART1B, UART2A and UART2B peripherals.

ssm.prescale2

This register contains bit fields to set the clock prescaler division factor for the DUSART, CNT1, CNT2 and PWM1 peripherals.

ssm.prescale3

This register contains bit fields to set the clock prescaler division factor for the PWM2, CAP, WDOG and TMR peripherals.

ssm.prescale4

This register contains bit fields to set the clock prescaler division factor for the LTMR, USB, ESPI and I2S peripherals.

ssm.prescale5

This register contains bit fields to set the clock prescaler division factor for the ADC1, ADC2, Ethernet MAC and dual smart card (DSCI) peripherals.

7.1.6 Peripheral Clock Enables

The clock oscillators, PLL multipliers and the associated divider chains are enabled and disabled by setting bit fields in the ssm.clk_en1 and ssm.clk_dis1 registers. Similarly, the peripheral clocks can be individually enabled and disabled.

Setting bit fields in the ssm.clk_en1 and ssm.clk_en2 registers enables the corresponding peripheral clock signals. Setting the relevant fields in the ssm.clk_dis1 and ssm.clk_dis2 registers disables the corresponding peripheral clocks. Bit fields set to '1' in the ssm.sts1 and ssm.sts2 registers indicate that the associated peripheral clocks have been enabled.

The peripheral functions include logic to detect a change of state on any external signal. When a change occurs on a configured peripheral signal, the clock to the peripheral is enabled automatically. This automatic clock activation is disabled by setting the associated bits in the ssm.clk_deact1 and ssm.clk_deact2 registers.

ssm.clk_en1, ssm.clk_dis1, ssm.clk_deact1, ssm.sts1

These registers contain bit fields for enabling and disabling the clock signals for the high PLL, low PLL, high reference oscillator, low reference oscillator and relaxation oscillator, and for the Ethernet MAC, USB, LCD, ESPI, I2S, MCPWM, UART1A, UART1B, UART2A, UART2B and DUSART peripherals.

ssm.clk_en2, ssm.clk_dis2, ssm.clk_deact2, ssm.sts2

These registers contain bit fields for enabling and disabling the clock signals for the CNT1, CNT2, PWM1, PWM2, CAP, WDOG, TMR, LTMR, ADC1, ADC2, DACs, EMI and DSCI peripherals, and for the flash memory auto power down timer. They also contain a bit field for controlling the relaxation oscillator low power suspend mode.

7.2 PLL and VCO Frequencies

The two PLL multipliers support a wide range of output frequencies and multiplication factors from a single input reference frequency. When quartz crystals or input clock signals are used with the recommended frequencies, then all possible values for the multiplication factors can be used. If a higher frequency crystal or input clock signal is used, then some multiplication factors should not be used because either the PLL output or the VCO output frequency exceeds the maximum limit.

Note that if the high PLL is used as the memory clock source and the EMI peripheral is used, then the high PLL output frequency must be limited to a maximum of 385MHz. If the EMI peripheral is not used, the maximum high PLL output frequency of 400MHz can be used to generate the internal memory and CPU clocks.

7.2.1 Low PLL and VCO Frequencies

The following table lists the low PLL multiplication factors and shows the VCO and PLL output frequencies for the recommended 32.768kHz crystal. The PLL multiplication factor N is controlled by the value F[8:0] stored in the low_pll_sel bit field of the ssm.pll_ctrl register. The maximum low PLL output frequency is 9.99MHz, and the maximum VCO frequency is 50MHz.

Low PLL VCO and Output Frequencies

F[8:0]

N divider

V divider

NxV

VCO (MHz)

Output (kHz)

0

2

512

1024

33.55

66

1

3

256

768

25.17

98

2

4

256

1024

33.55

131

3

5

256

1280

41.94

164

4

6

128

768

25.17

197

5

7

128

896

29.36

229

6

8

128

1024

33.55

262

7

9

128

1152

37.75

295

8

10

64

640

20.97

328

9

11

64

704

23.07

360

10

12

64

768

25.17

393

11

13

64

832

27.26

426

12

14

64

896

29.36

459

13

15

64

960

31.45

492

14

16

64

1024

33.55

524

15

17

64

1088

35.65

557

16

18

32

576

18.87

590

17

19

32

608

19.92

623

18

20

32

640

20.97

655

19

21

32

672

22.02

688

20

22

32

704

23.07

721

21

23

32

736

24.12

754

...

...

...

 

 

 

Table 22: Low PLL and VCO frequencies

Low PLL VCO and Output Frequencies

F[8:0]

N divider

V divider

NxV

VCO (MHz)

Output (MHz)

38

40

32

1280

41.94

1.31

39

41

32

1312

42.99

1.34

40

42

16

672

22.02

1.38

41

43

16

688

22.54

1.41

...

...

 

 

 

 

78

80

16

1280

41.94

2.62

79

81

16

1296

42.47

2.65

80

82

8

656

21.50

2.69

81

83

8

664

21.76

2.72

...

...

 

 

 

 

158

160

8

1280

41.94

5.24

159

161

8

1288

42.20

5.28

160

162

4

648

21.23

5.31

161

163

4

652

21.36

5.34

...

...

 

 

 

 

302

304

4

1216

39.85

9.96

303

305

4

1220

39.98

9.99

304

305

4

1220

39.98

9.99

...

...

 

 

 

 

511

305

4

1220

39.98

9.99

7.2.2 High PLL and VCO Frequencies

The following table lists the high PLL multiplication factors, and shows the VCO and PLL output frequencies both for the recommended 8.0MHz crystal and for a 10.0MHz crystal. The PLL multiplication factor N is controlled by the value F[6:0] stored in the high_pll_sel bit field of the ssm.pll_ctrl register. The maximum high PLL output frequency is 400MHz, and the maximum VCO frequency is also 400MHz. Note that if a 10MHz crystal is used for the high oscillator, some PLL multiplier selections cannot be used because the VCO frequency exceeds the maximum limit. These are highlighted in red.

Table 23: High PLL and VCO frequencies

High PLL VCO and Output
Frequencies (MHz)

Input clock frequency

8.0MHz

10.0MHz

F[6:0]

N divider

V divider

VCO

Output

VCO

Output

0

2

16

256

16

320

20

1

3

8

192

24

240

30

2

4

8

256

32

320

40

3

5

8

320

40

400

50

4

6

4

192

48

240

60

5

7

4

224

56

280

70

6

8

4

256

64

320

80

7

9

4

288

72

360

90

8

10

4

320

80

400

100

9

11

4

352

88

440

110

10

12

4

384

96

480

120

11

13

2

208

104

260

130

12

14

2

224

112

280

140

13

15

2

240

120

300

150

14

16

2

256

128

320

160

15

17

2

272

136

340

170

16

18

2

288

144

360

180

17

19

2

304

152

380

190

18

20

2

320

160

400

200

19

21

2

336

168

420

210

20

22

2

352

176

440

220

21

23

2

368

184

460

230

22

24

2

384

192

480

240

23

25

2

400

200

500

250

24

26

1

208

208

260

260

25

27

1

216

218

270

270

26

28

1

224

224

280

280

27

29

1

232

232

290

290

28

30

1

240

240

300

300

29

31

1

248

248

310

310

30

32

1

256

256

320

320

31

33

1

264

264

330

330

32

34

1

272

272

340

340

33

35

1

280

280

350

350

34

36

1

288

288

360

360

35

37

1

296

296

370

370

36

38

1

304

304

380

380

37

39

1

312

312

390

390

38

40

1

320

320

400

400

39

41

1

328

328

410

410

40

42

1

336

336

420

420

41

43

1

344

344

430

430

42

44

1

352

352

440

440

43

45

1

360

360

450

450

44

46

1

368

368

460

460

45

47

1

376

376

470

470

46

48

1

384

384

480

480

47

49

1

392

392

490

490

48

50

1

400

400

500

500

...

50

1

400

400

500

500

63

50

1

400

400

500

500

7.3 Peripheral Clock Frequency Limits

The clock sources, PLLs and SSM provide clock signals to the on-chip peripheral modules over a wide frequency range. There are maximum (and in some cases minimum) frequency limits on the clock signals provided by the SSM to the peripheral modules.

The following table lists any limits or constraints on input clock frequencies for the CPU and the on-chip peripherals, after the SSM clock dividers and prescalers. Note that each frequency listed here is the absolute maximum internal clock frequency for the peripheral. This means only that the internal peripheral hardware can be clocked at this maximum frequency, it does not mean that the complete peripheral function including external signals operates successfully at this frequency. Input and output delay times and pin loadings must be taken into account when determining the maximum operating frequency for any peripheral including external signals.

Table 24: CPU and peripheral clock frequency limits

Module

Clock frequency (MHz)

Min.

Max.

CPU

 

71

EMI 1

 

150

Timer

TMR

 

175

Counter/timers

CNT1

 

192

CNT2

 

189

PWM timers

PWM1

 

206

PWM2

 

194

Capture timer

CAP

 

203

Watchdog timer

WDOG

 

196

Long interval timer

LTMR

 

140

DUART

UART1A

 

195

UART1B

 

215

UART2A

 

202

UART2B

 

202

DUSART

 

86

Flash memory timer

 

175

ADC

12 bits

 

3.2

10 bits

 

4.9

8 bits

 

6.0

6 bits

 

8.0

DAC 2

 

0.25

ESPI

 

209

I2S

 

78

LCD

 

364

MCPWM

 

158

DSCI

 

172

EMAC

10Mb/s

3.0

87

100Mb/s

30

87

USB

48 ± 0.05%

Notes:

  1. If the high PLL is used as the memory clock source and the EMI peripheral is used, then the high PLL output frequency must be limited to a maximum of 385MHz. If the EMI peripheral is not used, the maximum high PLL output frequency of 400MHz can be used to generate the internal memory and CPU clocks.
  2. The maximum useful DAC clock frequency is 250kHz since the DAC analogue output has a settling time of 4µs.
    The DAC interface logic can be clocked at much higher frequencies.

7.4 Sleep

On executing a sleep instruction, the processor enters the sleep state. The CPU is woken from the sleep state on any wakeup event: an interrupt from a peripheral device, an input event on an external pin, or the expiry of the sleep timeout counter.

The SSM supports the CPU operating in the sleep state by controlling the way in which the CPU responds to wakeup events. It is also possible to switch off the CPU and peripheral clocks during the sleep state to save power if required by the application.

Two register bits are used to control the sleep mechanism. These bits are known as the morning and evening bits and are bits 0 and 1 respectively of the sleep control register ssm.sleep. Setting the evening bit clears the morning bit and allows the CPU to go into sleep mode when it executes any subsequent sleep instructions. When the morning bit is set, the CPU executes sleep instructions as nop s (no operation), and the sleep mechanism is disabled.

7.4.1 Sleep and Interrupts

If an interrupt is generated by a peripheral while the CPU is sleeping, it wakes up and starts to execute the appropriate interrupt service routine. It continues to execute code until the end of the ISR is reached and the rti (return from interrupt) instruction is executed. The CPU then returns to and executes the original sleep instruction. What happens next depends on the state of the morning and evening bits. If the evening bit is set, the CPU returns to sleep mode; however if the morning bit was set by the ISR, then the sleep instruction executes as a nop, resulting in the CPU staying awake, and code execution continues from the next instruction after the sleep.

This mode of operation may be described as 'doze' mode, where the CPU sleeps and is woken by external events. Normal operation is with doze mode enabled. When a wakeup event occurs, the CPU clock and register interface clock are enabled. If the wakeup event also causes an interrupt, then the CPU is awakened from sleep state to execute the interrupt service routine. Setting the doze_dis field in the ssm.wakeup_cfg register inhibits the CPU clock on a wakeup event and hence any further interrupts are not serviced. Conversely, setting the clk_en bit in the ssm.wakeup_cfg register forces the CPU clock and register interface clock to keep running even in the sleep state.

It is recommended that every sleep instruction is immediately followed by code to set the evening bit. This ensures that the CPU is in the evening state when the next sleep instruction is encountered. If the evening bit is not set, then any subsequent sleep instructions are ignored and the CPU does not go into sleep mode.

It should be noted that if an interrupt service routine is running when another interrupt event occurs, then the second interrupt is not serviced until the first service routine has completed and returned.

If an interrupt service routine directly executes a sleep instruction (when the evening bit is set), then the CPU goes into sleep mode, the ISR does not complete and consequently does not return. The interrupt logic does not generate any further interrupts, as the first ISR has not executed the rti instruction and the CPU does not return from interrupt mode to user mode. The CPU stays in the sleep state until the device is reset, or, if enabled, the sleep timeout counter expires causing the CPU to wake up.

7.4.2 Sleep and Peripheral Clock Control

It is possible to configure the eCOG1X such that the clocks that drive selected on-chip peripherals are disabled automatically during sleep mode. This allows the user to leave running only the peripherals that are intended to wake the CPU by generating interrupts. The other peripherals then consume only a minimal amount of power during sleep mode as their clock signal is disabled.

Four SSM registers control the behaviour of the peripheral clocks during sleep mode. These are the clock disable on sleep registers ssm.clk_sleep_dis1/2 and the clock enable on wakeup registers ssm.clk_wake_en1/2. These registers are used to select which clocks are disabled automatically when the CPU goes into sleep mode, and which are re-enabled automatically when the CPU wakes up. The contents of the sleep disable and wake enable registers need not be the same; the user may decide to disable a clock on sleep but not enable it automatically on wakeup. The application may later re-enable any clocks left disabled by setting the appropriate bit in the clock enable registers ssm.clk_en1/2. In addition, the clock deactivate registers ssm.clk_deact1/2 may be used to deactivate peripheral clocks and prevent them being restarted on any wakeup event.

The CPU clock and register interface clock signals cpu_clk and if_clk are used to drive the CPU and MMU/peripheral registers respectively. Setting the clk_en bit field to '1' in the ssm.wakeup_cfg register forces these clocks to continue to run whilst the CPU is in sleep mode.

The sleep timeout counter provides a safeguard in case the interrupts that are intended to wake the CPU do not occur. If it is disabled in sleep mode by setting the timeout field in the ssm.clk_sleep_dis2 register, then this safeguard is absent; if the expected interrupts do not occur, the CPU remains in sleep mode until the microcontroller is reset.

Note that the sleep timeout counter has no control field in the ssm.clock_wake_en2 register. This counter is only active in sleep mode.

7.5 Deep Sleep

In combination with the automatic power down of the flash memory, it is possible to configure the eCOG1X to stop the clock from which it is running and so enter a completely static state.

The only clock source that can be used in this way is the relaxation oscillator. When the CPU enters the sleep state and the flash automatically powers down to Stop mode, the relaxation oscillator can then be stopped. When a wakeup event occurs, the relaxation oscillator is restarted and execution resumes.

With the CPU clock source set to the relaxation oscillator, the fd.ssm.clk_dis1.relax_osc bit field must be set. Normally this disables the relaxation oscillator, but since it is selected as the CPU clock source, it remains enabled. The fd.ssm.clk_dis2.relax_osc_suspend bit field must also be set. This configures the relaxation oscillator such that when the CPU is in Sleep state and the flash has automatically changed to the Stop mode, the oscillator is disabled.

Note that when disabling other clock sources and peripheral clocks in this process, the peripheral clock for the flash timer is left enabled. The following example code disables all the clocks appropriately and leaves the flash timer running.

// Disable all the clocks except the flash power down timer
// This also enables the relax_osc_suspend mode
rg.ssm.clk_dis2 = 0x6FFF;
rg.ssm.clk_dis1 = 0xFFFF; 

When a sleep instruction is executed and the fd.ssm.sleep.evening bit field is set, the CPU enters the sleep state. Following this, as the CPU has now stopped performing instruction fetch read cycles from the flash memory, the flash timer automatically powers down the flash memory to Stop mode. Once the flash memory is in Stop mode, the relaxation oscillator is disabled automatically and the eCOG1X enters a completely static state. This gives the lowest possible power supply current.

When a wakeup event is received from a GPIO interrupt, the relaxation oscillator is enabled and execution restarts in the same way as waking from normal sleep mode.

This mode is advantageous as it allows a fast start up from sleep mode, but retains the low power consumption associated with using a low frequency clock. If the relaxation oscillator frequency is adjusted to 10MHz with an external tuning resistor, then the wakeup time is approximately 5µs. If the relaxation oscillator frequency is at its default value (approximately 1MHz) with no external tuning resistor, then the wakeup time is approximately 50µs.

A simple test using the eCOG1X processor daughter board from the development kit shows that it requires a standby current of only 5µA on the 1.8V supply in this deep sleep mode.

Important Note:
All internal clocks are stopped in deep sleep mode. Since all eICE debug interface transfers are clocked by the internal CPU clock source, this means that in deep sleep mode all eICE commands are ignored and no debug operations are possible until the device is woken by an external interrupt event. When debugging a system that will use deep sleep mode in the final application, it is recommended that the CyanIDE project is set up for separate release and debug build variants, with the debug build modified such that it does not set the relax_osc_suspend bit in the ssm.clk_dis2 register. This leaves the relaxation oscillator running during sleep mode and allows eICE operations to take place, and uses only slightly more power than the fully stopped release build.

7.6 Wakeup

Wakeup events are generated by a number of sources: an interrupt from an on-chip peripheral, an edge or level detected on a GPIO input, or expiry of the sleep timeout counter.

7.6.1 Input Events

An external input wakeup event is generated when an event from an external input to the peripheral clock domain interacts with the CPU clock domain. The action of waking up the CPU on an input wakeup event is disabled by setting the wakeon_if_dis field in the ssm.wakeup_cfg register. The default is for input wakeup events to be enabled.

The GPIO signals may be configured to generate interrupts and wake up the processor core on a high or low level, a rising or falling edge or any edge on the selected port pin. GPIO interrupts are controlled by bit fields in three registers, gpio.xy.cfg_edge1, gpio.xy.cfg_edge0 and gpio.xy.int_level. The combination of bit fields in these three registers is used to select the interrupt event. The bit field values are shown in the table below.

Table 25: GPIO interrupt configuration

gpio.xy.

Interrupt Function

cfg_edge1

cfg_edge0

int_level

0

0

0

low level

0

0

1

high level

0

1

X

falling edge

1

0

X

rising edge

1

1

X

any edge

GPIO interrupts are enabled by writing a '1' to bit fields in the gpio.xy.int_en registers, and disabled by writing a '1' to bit fields in the gpio.xy.int_dis registers. Interrupt status is read from the gpio.xy.int_sts registers, and interrupts are cleared by writing a '1' to bit fields in the gpio.xy.int_clr registers. See Section 9.9 for further details of the GPIO control registers.

7.6.2 Sleep Timeout

In the event that no interrupts are generated to wake the CPU from the sleep state, a wakeup event may be generated after an interval governed by the sleep timeout counter. This is an 8 bit counter that is clocked from the selected output of one of the five peripheral clock dividers.

The counter is started each time a sleep instruction is executed. A wakeup event occurs when its count reaches zero. When using the 8MHz high reference clock, the maximum timeout period available is of the order of 2.1 seconds, while with the 32.768kHz reference it is 512 seconds. The sleep timeout counter may be disabled by setting the timeout bit in the clock disable on sleep register ssm.clk_sleep_dis2, as described earlier. Note that if no interrupts occur to trigger a wakeup, this may result in the CPU remaining inactive until reset.

Any of the five available clocks may be selected as the clock source for the sleep timeout counter. The selection is made by the timeout_lcd bit field in the ssm.clk_src2 register. Note that the sleep timeout counter and the LCD controller are grouped together and share the same clock source selection. As these are both low speed peripherals, this is not a major restriction.

The corresponding divider chain output tap is selected by setting the 4 bit timeout bit field in the ssm.clk_div1 register. Setting this field to '1111' selects the fastest output of the divider chain, giving a timeout clock frequency equal to the selected source clock divided by two. Setting the field to '0000' selects the slowest output, giving a clock frequency equal to the selected source clock divided by 216. Other values select the outputs and associated division ratios between these two extremes.

7.6.3 Sleep Recovery Period

The CPU has a recovery period after a wakeup event, during which it does not go back into sleep mode even if it executes another sleep instruction. The CPU must execute code for a minimum of four CPU clock cycles before it is able to go back to sleep. If less than four clocks have elapsed since the wakeup event, the CPU ignores the sleep command and continues to run the subsequent code.

In the majority of cases this does not present a problem as it takes very little code to use up the required minimum number of clock cycles. Care should be taken if two successive sleep instructions are separated by only one or two lines of code in the application.

7.6.4 Time to Wakeup

There is a delay between the time at which the wakeup event occurs and the time at which the CPU starts to execute code. This delay is nominally 16 CPU clock periods.

In the case where an interrupt is generated by an external signal on a GPIO port, the interrupt occurs asynchronously with the CPU clock. This results in up to one extra clock cycle being required, leading to a total of 16 to 17 CPU clock periods of the currently selected CPU clock.

The table below shows the wakeup times for some possible CPU clock configurations.

Table 26: Wakeup times at various CPU clock speeds

Clock Source

Prescaler Setting

CPU Clock
Frequency

Wakeup Time

Low Reference (32.768kHz)

Ref / 2

16.384kHz

0.98 - 1.04ms

Low PLL (8.192MHz)

Ref / 2

4.096MHz

3.9 - 4.2µs

Relaxation Oscillator (1MHz)

Ref / 2

500kHz

32 - 34µs

Relaxation Oscillator (10MHz)

Ref / 2

5MHz

3.2 - 3.4µs

High Reference (8.0MHz)

Ref / 2

4.0MHz

4.0 - 4.3µs

High PLL (256MHz)

Ref / 4

64MHz

0.25 - 0.27µs

7.7 System Reset Control

The SSM provides extended power on reset, CPU reset, and a means to control reset to individual peripheral modules.

7.7.1 Power On Reset.

When the power supply falls below the power on reset threshold, eCOG1X is held in the reset state. When the power supply rises above the power on reset threshold, the SSM provides an extended version of the external power-on reset input. The reset signal to the eCOG1X is extended and held active while the active clock sources are detected and a master clock is selected. It is then held active for a further 3ms after the external reset signal goes inactive, to prevent the internal reset going inactive before the supply is at the correct operating voltage.

7.7.2 CPU Reset Generation

The SSM generates a CPU reset upon the following conditions:

A CPU reset is achieved by writing a '1' to the cpu_rst field in the ssm.rst_set2 register.

During the debug process, the eCOG1X CPU can be reset via the eICE interface by applying the following routine:

  1. Put the CPU into a halt state (by using an eICE STOP command)
  2. Write a '1' to the if_rst field of the ssm.rst_set2 register and wait for a period greater than the current period of the if_clk clock signal. The register interface clock signal if_clk is explained further in the next section.
  3. Send an eICE CPU reset command.

The CPU is now initialised.

7.7.3 Peripheral Reset Control

The SSM provides control logic to reset one or all of the eCOG1X peripherals whilst leaving the CPU in its running state.

Individual reset of the peripheral devices is performed by setting and then clearing the relevant peripheral set/clr fields in the ssm.rst_set1/2 and ssm.rst_clr1/2 registers. Clearing a reset should be considered as bringing a module into service.

A register interface clock pervades throughout the eCOG1X device. This provides a clock signal to the configuration registers, internal to each peripheral device. This register control clock signal (if_clk) is used in conjunction with a register control reset signal (if_rst). All peripheral devices that have internal configuration registers, and are hence controlled by if_clk and if_rst, can be reset by the if_rst signal. Writing a '1' to the if_rst bit field in the ssm.rst_set2 register resets the peripherals as shown in the Reset Summary section.

Resetting the peripherals must be done with regard to the peripheral clock. The clock to the peripheral should be disabled, the reset asserted then cleared, and then the clock re-enabled. The five clock divider chains should be held in reset while any peripheral clocks they drive are changed.

7.8 Reset summary

Table 27: Major functional blocks and their reset sources.

CPU / Peripheral

Power-on
Reset

CPU Reset
(cpu_rst)

Register Interface
Reset (if_rst)

Individual Software Reset
(
module.register.field)

CPU

Y

Y

 

 

MMU

Y

Y

Y

 

CACHE
CONTROLLER

Y

 

 

 

SSM

Y

 

Y

 

FLASH
CONTROLLER

Y

 

Y

 

Low PLL divider

Y

 

Y

ssm.rst_set1.low_pll_div_chn

Low OSC divider

Y

 

Y

ssm.rst_set1.low_ref_div_chn

High PLL divider

Y

 

Y

ssm.rst_set1.high_pll_div_chn

High OSC divider

Y

 

Y

ssm.rst_set1.high_ref_div_chn

Relaxation OSC divider

Y

 

Y

ssm.rst_set1.relax_osc_div_chn

Ethernet MAC

Y

 

Y

ssm.rst_set1.emac

USB

Y

 

Y

ssm.rst_set1.usb

LCD

Y

 

Y

ssm.rst_set1.lcd

ESPI

Y

 

Y

ssm.rst_set1.espi

I2S

Y

 

Y

ssm.rst_set1.i2s

MCPWM

Y

 

Y

ssm.rst_set1.mcpwm

DUART1

Y

 

Y

ssm.rst_set1.duart1

DUART2

Y

 

Y

ssm.rst_set1.duart2

DUSART

Y

 

Y

ssm.rst_set1.dusart

CNT1

Y

 

Y

ssm.rst_set1.cnt1

CNT2

Y

 

Y

ssm.rst_set1.cnt2

PWM1

Y

 

Y

ssm.rst_set2.pwm1

PWM2

Y

 

Y

ssm.rst_set2.pwm2

CAP

Y

 

Y

ssm.rst_se2.cap

WDOG

Y

 

Y

ssm.rst_set2.wdog

TMR

Y

 

Y

ssm.rst_set2.tmr

LTMR

Y

 

Y

ssm.rst_set2.ltmr

Analogue

Y

 

Y

ssm.rst_set2.aci

EMI

Y

 

Y

ssm.rst_set2.emi

EHI

Y

 

Y

 

Note that all peripheral reset signals controlled by the ssm.rst_set1 and ssm.rst_set2 registers are asserted by a power-on reset and remain in the reset state until cleared by software.

7.9 System Support Module Registers

The System Support Module contains the following registers:

Table 28: System Support Module Registers

Address

Name

Reset

Type

Page

0xFE3A

ssm.rst_set1

0x0000

W

7.9.1

0xFE3C

ssm.rst_set2

0x0000

W

7.9.2

0xFE3E

ssm.rst_clr1

0x0000

RW

7.9.3

0xFE40

ssm.rst_clr2

0x0000

RW

7.9.4

0xFE42

ssm.clk_en1

0x0000

W

7.9.5

0xFE44

ssm.clk_en2

0x0000

W

7.9.6

0xFE46

ssm.clk_dis1

0x0000

W

7.9.7

0xFE48

ssm.clk_dis2

0x0000

W

7.9.8

0xFE4A

ssm.clk_deact1

0x0000

RW

7.9.9

0XFE4C

ssm.clk_deact2

0x0000

RW

7.9.10

0xFE4E

ssm.clk_sleep_dis1

0x0000

RW

7.9.11

0xFE50

ssm.clk_sleep_dis2

0x0000

RW

7.9.12

0xFE52

ssm.clk_wake_en1

0x0000

RW

7.9.13

0xFE54

ssm.clk_wake_en2

0x0000

RW

7.9.14

0xFE56

ssm.cpu

0x0000

RW

7.9.15

0xFE58

ssm.osc_sts

0x0000

R

7.9.16

0xFE5A

ssm.pll_cfg

0x0000

RW

7.9.17

0xFE5C

ssm.pll_ctrl

0x0000

RW

7.9.18

0xFE5E

ssm.sts1

0x0000

R

7.9.19

0xFE60

ssm.sts2

0x0000

R

7.9.20

0xFE62

ssm.clk_src1

0x0000

RW

7.9.21

0xFE64

ssm.clk_src2

0x0000

RW

7.9.22

0xFE66

ssm.clk_src3

0x0000

RW

7.9.23

0xFE68

ssm.clk_div1

0x0000

RW

7.9.24

0xFE6A

ssm.clk_div2

0x0000

RW

7.9.25

0xFE6C

ssm.clk_div3

0x0000

RW

7.9.26

0xFE6E

ssm.clk_div4

0x0000

RW

7.9.27

0xFE70

ssm.clk_div5

0x0000

RW

7.9.28

0xFE72

ssm.clk_div6

0x0000

RW

7.9.29

0xFE74

ssm.tmr_src

0x0000

RW

7.9.30

0xFE76

ssm.prescale1

0x0000

RW

7.9.31

0xFE78

ssm.prescale2

0x0000

RW

7.9.32

0xFE7A

ssm.prescale3

0x0000

RW

7.9.33

0xFE7C

ssm.prescale4

0x0000

RW

7.9.34

0xFE7E

ssm.prescale5

0x0000

RW

7.9.35

0xFE80

ssm.wakeup_cfg

0x0000

RW

7.9.36

0xFE82

ssm.sleep

0x0000

RW

7.9.37

0xFE84

ssm.test_cfg

0x0000

RW

7.9.38

7.9.1 ssm.rst_set1

Address: 0xFE3A

Reset: 0x0000

Type: W

This register controls the reset signals to the separate peripheral clock domains. It forms a set/clear pair with the ssm.rst_clr1 register. Setting a bit to '1' asserts the internal reset signal for the corresponding clock domain. Reading this register returns zero.

The five divider chains must be held in reset while any clocks they drive are changed.

The register contains the following fields.

Bits

Field

Type

15

cnt2: Writing a '1' to this field resets the CNT2 counter/timer.

W

14

cnt1: Writing a '1' to this field resets the CNT1 counter/timer.

W

13

dusart: Writing a '1' to this field resets the DUSART peripheral.

W

12

duart2: Writing a '1' to this field resets the DUART2 peripheral.

W

11

duart1: Writing a '1' to this field resets the DUART1 peripheral.

W

10

mcpwm: Writing a '1' to this field resets the MCPWM peripheral.

W

9

i2s: Writing a '1' to this field resets the I2S peripheral.

W

8

espi: Writing a '1' to this field resets the ESPI peripheral.

W

7

lcd: Writing a '1' to this field resets the LCD controller.

W

6

usb: Writing a '1' to this field resets the reset for the USB peripheral.

W

5

emac: Writing a '1' to this field resets the Ethernet MAC.

W

4

relax_osc_div_chn: Resets the relaxation oscillator divider chain.

W

3

high_ref_div_chn: Resets the high reference oscillator divider chain.

W

2

high_pll_div_chn: Resets the high frequency PLL clock divider chain.

W

1

low_ref_div_chn: Resets the low reference oscillator divider chain.

W

0

low_pll_div_chn: Resets the low frequency PLL clock divider chain.

W

7.9.2 ssm.rst_set2

Address: 0xFE3C

Reset: 0x0000

Type: W

This register controls the reset signals to the separate peripheral clock domains. It forms a set/clear pair with the ssm.rst_clr2 register. Setting a bit to '1' asserts the internal reset signal for the corresponding clock domain. Reading this register returns zero.

The five divider chains must be held in reset while any clocks they drive are changed.

The register contains the following fields.

Bits

Field

Type

10

if_rst: Writing a '1' to this bit triggers a pulse on the register interface reset signal, if_rst. Care must be taken when this bit is set, it may force erroneous interrupt and flow bits active if all the peripheral modules are not already in their reset state.

W

9

cpu_rst: Writing a '1' to this bit triggers a pulse on the internal reset signal to the CPU core, cpu_rst.

W

8

dsci: Writing a '1' to this field resets the DSCI peripheral.

W

7

emi: Writing a '1' to this field resets the EMI peripheral.

W

6

aci: Writing a '1' to this field resets the ACI analogue controller.

W

5

ltmr: Writing a '1' to this field resets the LTMR timer.

W

4

tmr: Writing a '1' to this field resets the TMR timer.

W

3

wdog: Writing a '1' to this field resets the WDOG watchdog timer.

W

2

cap: Writing a '1' to this field resets the CAP input capture timer.

W

1

pwm2: Writing a '1' to this field resets the PWM2 timer.

W

0

pwm1: Writing a '1' to this field resets the PWM1 timer.

W

7.9.3 ssm.rst_clr1

Address: 0xFE3E

Reset: 0x0000

Type: RW

This register controls the reset signals to the separate peripheral clock domains. It forms a set/clear pair with the ssm.rst_set1 register. Setting a bit to '1' clears the internal reset signal for the corresponding clock domain. Reading this register returns the current value of the reset latch bits, with a '1' indicating that the corresponding reset is cleared.

All reset signals are set at power on. It is recommended that the clock to the peripheral module is inactive when the corresponding reset is cleared.

The register contains the following fields.

Bits

Field

Type

15

cnt2: Writing a '1' to this field clears the CNT2 timer reset.

RW

14

cnt1: Writing a '1' to this field clears the CNT1 timer reset.

RW

13

dusart: Writing a '1' to this field clears the DUSART reset.

RW

12

duart2: Writing a '1' to this field clears the DUART2 reset.

RW

11

duart1: Writing a '1' to this field clears the DUART1 reset.

RW

10

mcpwm: Writing a '1' to this field clears the MCPWM reset.

RW

9

i2s: Writing a '1' to this field clears the I2S reset.

RW

8

espi: Writing a '1' to this field clears the ESPI reset.

RW

7

lcd: Writing a '1' to this field clears the LCD controller reset.

RW

6

usb: Writing a '1' to this field clears the USB reset.

RW

5

emac: Writing a '1' to this field clears the Ethernet MAC reset.

RW

4

relax_osc_div_chn: Clears the relaxation oscillator divider reset.

RW

3

high_ref_div_chn: Clears the high oscillator divider chain reset.

RW

2

high_pll_div_chn: Clears the high PLL clock divider chain reset.

RW

1

low_ref_div_chn: Clears the low oscillator clock divider chain reset.

RW

0

low_pll_div_chn: Clears the low PLL clock divider chain reset.

RW

7.9.4 ssm.rst_clr2

Address: 0xFE40

Reset: 0x0000

Type: RW

This register controls the reset signals to the separate peripheral clock domains. It forms a set/clear pair with the ssm.rst_set2 register. Setting a bit to '1' clears the internal reset signal for the corresponding clock domain. Reading this register returns the current value of the reset latch bits, with a '1' indicating that the corresponding reset is cleared.

All reset signals are set at power on. It is recommended that the clock to the peripheral module is inactive when the corresponding reset is cleared.

The register contains the following fields.

Bits

Field

Type

8

dsci: Writing a '1' to this field clears the DSCI reset.

RW

7

emi: Writing a '1' to this field clears the EMI reset.

RW

6

aci: Writing a '1' to this field clears the ACI analogue controller reset.

RW

5

ltmr: Writing a '1' to this field clears the LTMR timer reset.

RW

4

tmr: Writing a '1' to this field clears the TMR timer reset.

RW

3

wdog: Writing a '1' to this field clears the WDOG timer reset.

RW

2

cap: Writing a '1' to this field clears the CAP input capture timer reset.

RW

1

pwm2: Writing a '1' to this field clears the PWM2 timer reset.

RW

0

pwm1: Writing a '1' to this field clears the PWM1 timer reset.

RW

7.9.5 ssm.clk_en1

Address: 0xFE42

Reset: 0x0000

Type: W

This is a real time control register used to enable the clocks in the system. It forms a set/clear pair with the ssm.clk_dis1 register. Writing a '1' to a bit field enables the internal clock signal for the corresponding clock domain. Reading this register returns zero. The clock enable status bits for these clock domains are read via the ssm.sts1 register.

The register contains the following fields.

Bits

Field

Type

15

dusart: Writing a '1' to this field enables the DUSART peripheral clock.

W

14

uart2b: Writing a '1' to this field enables the UART2B peripheral clock.

W

13

uart2a: Writing a '1' to this field enables the UART2A peripheral clock.

W

12

uart1b: Writing a '1' to this field enables the UART1B peripheral clock.

W

11

uart1a: Writing a '1' to this field enables the UART1A peripheral clock.

W

10

mcpwm: Writing a '1' to this field enables the MCPWM clock.

W

9

i2s: Writing a '1' to this field enables the I2S peripheral clock.

W

8

espi: Writing a '1' to this field enables the ESPI peripheral clock.

W

7

lcd: Writing a '1' to this field enables the LCD controller clock.

W

6

usb: Writing a '1' to this field enables the USB peripheral clock.

W

5

emac: Writing a '1' to this field enables the EMAC peripheral clock.

W

4

relax_osc: Writing a '1' to this field enables the relaxation oscillator.

W

3

low_osc: Writing a '1' to this field enables the low ref oscillator.

W

2

high_osc: Writing a '1' to this field enables the high ref oscillator.

W

1

low_pll: Writing a '1' to this field enables the low frequency PLL.

W

0

high_pll: Writing a '1' to this field enables the high frequency PLL.

W

7.9.6 ssm.clk_en2

Address: 0xFE44

Reset: 0x0000

Type: W

This is a real time control register used to enable the clocks in the system. It forms a set/clear pair with the ssm.clk_dis2 register. Writing a '1' to a bit field enables the internal clock signal for the corresponding clock domain. Reading this register returns zero. The clock enable status bits for these clock domains are read via the ssm.sts2 register.

The register contains the following fields.

Bits

Field

Type

14

relax_osc_suspend: Writing a '1' to this field prevents the relaxation oscillator from being suspended in deep sleep mode. The corresponding status bit in the ssm.sts2 register is set to ‘0’.

W

13

dsci: Writing a '1' to this field enables the DSCI peripheral clock.

W

12

flash_tmr: Writing a '1' to this field enables the peripheral clock for the flash memory auto power-down timer.

W

11

emi: Writing a '1' to this field enables the EMI peripheral clock.

W

10

dacs: Writing a '1' to this field enables the DACs peripheral clock.

W

9

adc2: Writing a '1' to this field enables the ADC2 peripheral clock.

W

8

adc1: Writing a '1' to this field enables the ADC1 peripheral clock.

W

7

ltmr: Writing a '1' to this field enables the long interval timer clock.

W

6

tmr: Writing a '1' to this field enables the TMR timer clock.

W

5

wdog: Writing a '1' to this field enables the watchdog timer clock.

W

4

cap: Writing a '1' to this field enables the input capture timer clock.

W

3

pwm2: Writing a '1' to this field enables the PWM2 timer clock.

W

2

pwm1: Writing a '1' to this field enables the PWM1 timer clock.

W

1

cnt2: Writing a '1' to this field enables the CNT2 timer clock.

W

0

cnt1: Writing a '1' to this field enables the CNT1 timer clock.

W

7.9.7 ssm.clk_dis1

Address: 0xFE46

Reset: 0x0000

Type: W

This is a real time control register used to disable the clocks in the system. It forms a set/clear pair with the ssm.clk_en1 register. Writing a '1' to a bit field disables the internal clock signal for the corresponding clock domain. Reading this register returns zero. The clock enable status bits for these clock domains are read via the ssm.sts1 register. When a clock is disabled, it can be enabled automatically by the corresponding clock wakeup signal or by a change of state on one of the peripheral signals. When a clock is deactivated, it cannot be enabled by its respective hardware generated clock wakeup or state change signal.

The register contains the following fields.

Bits

Field

Type

15

dusart: Writing a '1' to this field disables the DUSART peripheral clock.

W

14

uart2b: Writing a '1' to this field disables the UART2B peripheral clock.

W

13

uart2a: Writing a '1' to this field disables the UART2A peripheral clock.

W

12

uart1b: Writing a '1' to this field disables the UART1B peripheral clock.

W

11

uart1a: Writing a '1' to this field disables the UART1A peripheral clock.

W

10

mcpwm: Writing a '1' to this field disables the MCPWM clock.

W

9

i2s: Writing a '1' to this field disables the I2S peripheral clock.

W

8

espi: Writing a '1' to this field disables the ESPI peripheral clock.

W

7

lcd: Writing a '1' to this field disables the LCD controller clock.

W

6

usb: Writing a '1' to this field disables the USB peripheral clock.

W

5

emac: Writing a '1' to this field disables the EMAC peripheral clock.

W

4

relax_osc: Writing a '1' to this field disables the relaxation oscillator.

W

3

low_osc: Writing a '1' to this field disables the low ref oscillator.

W

2

high_osc: Writing a '1' to this field disables the high ref oscillator.

W

1

low_pll: Writing a '1' to this field disables the low frequency PLL.

W

0

high_pll: Writing a '1' to this field disables the high frequency PLL.

W

7.9.8 ssm.clk_dis2

Address: 0xFE48

Reset: 0x0000

Type: W

This is a real time control register used to disable the clocks in the system. It forms a set/clear pair with the ssm.clk_en2 register. Writing a '1' to a bit field disables the internal clock signal for the corresponding clock domain. Reading this register returns zero. The clock enable status bits for these clock domains are read via the ssm.sts2 register. When a clock is disabled, it can be enabled automatically by the corresponding clock wakeup signal or by a change of state on one of the peripheral signals. When a clock is deactivated, it cannot be enabled by its respective hardware generated clock wakeup or state change signal.

The register contains the following fields.

Bits

Field

Type

14

relax_osc_suspend: Writing a '1' to this field allows the relaxation oscillator to be suspended in deep sleep mode. The corresponding status bit in the ssm.sts2 register is also set to ‘1’.

W

13

dsci: Writing a '1' to this field disables the DSCI peripheral clock.

W

12

flash_tmr: Writing a '1' to this field disables the peripheral clock for the flash memory auto power-down timer.

W

11

emi: Writing a '1' to this field disables the EMI peripheral clock.

W

10

dacs: Writing a '1' to this field disables the DACs peripheral clock.

W

9

adc2: Writing a '1' to this field disables the ADC2 peripheral clock.

W

8

adc1: Writing a '1' to this field disables the ADC1 peripheral clock.

W

7

ltmr: Writing a '1' to this field disables the long interval timer clock.

W

6

tmr: Writing a '1' to this field disables the TMR timer clock.

W

5

wdog: Writing a '1' to this field disables the watchdog timer clock.

W

4

cap: Writing a '1' to this field disables the input capture timer clock.

W

3

pwm2: Writing a '1' to this field disables the PWM2 timer clock.

W

2

pwm1: Writing a '1' to this field disables the PWM1 timer clock.

W

1

cnt2: Writing a '1' to this field disables the CNT2 timer clock.

W

0

cnt1: Writing a '1' to this field disables the CNT1 timer clock.

W

7.9.9 ssm.clk_deact1

Address: 0xFE4A

Reset: 0x0000

Type: RW

This is a configuration register used to deactivate selected peripheral clocks. When a peripheral clock is disabled, it can be enabled automatically by the corresponding clock wakeup signal or by a change of state on one of the peripheral signals. When a clock is deactivated by setting a bit in this register, it cannot be enabled by its respective hardware generated clock wakeup or peripheral state change signal until the deactivate bit is cleared.

The register contains the following fields.

Bits

Field

Type

15

dusart: Setting this bit to '1' deactivates the DUSART peripheral clock.

RW

14

uart2b: Setting this bit to '1' deactivates the UART2B peripheral clock.

RW

13

uart2a: Setting this bit to '1' deactivates the UART2A peripheral clock.

RW

12

uart1b: Setting this bit to '1' deactivates the UART1B peripheral clock.

RW

11

uart1a: Setting this bit to '1' deactivates the UART1A peripheral clock.

RW

10

mcpwm: Setting this field to '1' deactivates the MCPWM clock.

RW

9

i2s: Setting this field to '1' deactivates the I2S peripheral clock.

RW

8

espi: Setting this field to '1' deactivates the ESPI peripheral clock.

RW

7

lcd: Setting this field to '1' deactivates the LCD controller clock.

RW

5

emac: Setting this field to '1' deactivates the EMAC peripheral clock.

RW

7.9.10 ssm.clk_deact2

Address: 0xFE4C

Reset: 0x0000

Type: RW

This is a configuration register used to deactivate selected peripheral clocks. When a peripheral clock is disabled, it can be enabled automatically by the corresponding clock wakeup signal or by a change of state on one of the peripheral signals. When a clock is deactivated by setting a bit in this register, it cannot be enabled by its respective hardware generated clock wakeup or peripheral state change signal until the deactivate bit is cleared.

The register contains the following fields.

Bits

Field

Type

13

dsci: Setting this field to '1' deactivates the DSCI peripheral clock.

RW

10

dacs: Setting this field to '1' deactivates the DACs peripheral clock.

RW

9

adc2: Setting this field to '1' deactivates the ADC2 peripheral clock.

RW

8

adc1: Setting this field to '1' deactivates the ADC1 peripheral clock.

RW

7

ltmr: Setting this field to '1' deactivates the long interval timer clock.

RW

6

tmr: Setting this field to '1' deactivates the TMR timer clock.

RW

5

wdog: Setting this field to '1' deactivates the watchdog timer clock.

RW

4

cap: Setting this field to '1' deactivates the input capture timer clock.

RW

3

pwm2: Setting this field to '1' deactivates the PWM2 timer clock.

RW

2

pwm1: Setting this field to '1' deactivates the PWM1 timer clock.

RW

1

cnt2: Setting this field to '1' deactivates the CNT2 timer clock.

RW

0

cnt1: Setting this field to '1' deactivates the CNT1 timer clock.

RW

7.9.11 ssm.clk_sleep_dis1

Address: 0xFE4E

Reset: 0x0000

Type: RW

This is a real time control register used to disable selected peripheral clocks automatically when the CPU enters sleep mode. When a peripheral clock is disabled, it can be enabled automatically by the corresponding clock wakeup signal or by a change of state on one of the peripheral signals. When a peripheral clock is deactivated, it cannot be enabled by its respective hardware generated clock wakeup or peripheral state change signal until the deactivate bit is cleared.

The register contains the following fields.

Bits

Field

Type

15

dusart: When set, this field disables the DUSART clock in sleep mode.

RW

14

uart2b: When set, this field disables the UART2B clock in sleep mode.

RW

13

uart2a: When set, this field disables the UART2A clock in sleep mode.

RW

12

uart1b: When set, this field disables the UART1B clock in sleep mode.

RW

11

uart1a: When set, this field disables the UART1A clock in sleep mode.

RW

10

mcpwm: When set, disables the MCPWM clock in sleep mode.

RW

9

i2s: When set, disables the I2S peripheral clock in sleep mode.

RW

8

espi: When set, disables the ESPI peripheral clock in sleep mode.

RW

7

lcd: When set, disables the LCD controller clock in sleep mode.

RW

5

emac: When set, disables the Ethernet MAC clock in sleep mode.

RW

7.9.12 ssm.clk_sleep_dis2

Address: 0xFE50

Reset: 0x0000

Type: RW

This is a real time control register used to disable selected peripheral clocks automatically when the CPU enters sleep mode. When a peripheral clock is disabled, it can be enabled automatically by the corresponding clock wakeup signal or by a change of state on one of the peripheral signals. When a peripheral clock is deactivated, it cannot be enabled by its respective hardware generated clock wakeup or peripheral state change signal until the deactivate bit is cleared.

The register contains the following fields.

Bits

Field

Type

14

timeout: When set, this field disables the clock to the sleep timeout counter in sleep mode. The sleep timeout function is used to wakeup the CPU if no other wakeup event occurs within the timeout period. Setting this bit means that the CPU stays in the sleep state indefinitely if there are no interrupts to trigger a wakeup.

RW

13

dsci: When set, disables the clock to the DSCI in sleep mode.

RW

10

dacs: When set, disables the clock to the DACs in sleep mode.

RW

9

adc2: When set, disables the ADC2 peripheral clock in sleep mode.

RW

8

adc1: When set, disables the ADC1 peripheral clock in sleep mode.

RW

7

ltmr: When set, this field disables the LTMR timer clock in sleep mode.

RW

6

tmr: When set, this field disables the TMR timer clock in sleep mode.

RW

5

wdog: When set, disables the WDOG timer clock in sleep mode.

RW

4

cap: When set, this field disables the CAP timer clock in sleep mode.

RW

3

pwm2: When set, disables the PWM2 timer clock in sleep mode.

RW

2

pwm1: When set, disables the PWM1 timer clock in sleep mode.

RW

1

cnt2: When set, this field disables the CNT2 timer clock in sleep mode.

RW

0

cnt1: When set, this field disables the CNT1 timer clock in sleep mode.

RW

7.9.13 ssm.clk_wake_en1

Address: 0xFE52

Reset: 0x0000

Type: RW

This is a real time control register used to enable selected peripheral clocks automatically when the CPU exits from sleep mode. When a peripheral clock is disabled, it can be enabled automatically by the corresponding clock wakeup signal or by a change of state on one of the peripheral signals. When a peripheral clock is deactivated, it cannot be enabled by its respective hardware generated clock wakeup or peripheral state change signal until the deactivate bit is cleared.

The register contains the following fields.

Bits

Field

Type

15

dusart: When set, this field enables the DUSART clock on wakeup.

RW

14

uart2b: When set, this field enables the UART2B clock on wakeup.

RW

13

uart2a: When set, this field enables the UART2A clock on wakeup.

RW

12

uart1b: When set, this field enables the UART1B clock on wakeup.

RW

11

uart1a: When set, this field enables the UART1A clock on wakeup.

RW

10

mcpwm: When set, this field enables the MCPWM clock on wakeup.

RW

9

i2s: When set, this field enables the I2S peripheral clock on wakeup.

RW

8

espi: When set, this field enables the ESPI peripheral clock on wakeup.

RW

7

lcd: When set, this field enables the LCD controller clock on wakeup.

RW

5

emac: When set, enables the Ethernet MAC clock on wakeup.

RW

7.9.14 ssm.clk_wake_en2

Address: 0xFE54

Reset: 0x0000

Type: RW

This is a real time control register used to enable selected peripheral clocks automatically when the CPU exits from sleep mode. When a peripheral clock is disabled, it can be enabled automatically by the corresponding clock wakeup signal or by a change of state on one of the peripheral signals. When a peripheral clock is deactivated, it cannot be enabled by its respective hardware generated clock wakeup or peripheral state change signal until the deactivate bit is cleared.

The register contains the following fields.

Bits

Field

Type

13

dsci: When set, this field enables the clock to the DSCI on wakeup.

RW

10

dacs: When set, this field enables the clock to the DACs on wakeup.

RW

9

adc2: When set, enables the ADC2 peripheral clock on wakeup.

RW

8

adc1: When set, enables the ADC1 peripheral clock on wakeup.

RW

7

ltmr: When set, this field enables the LTMR timer clock on wakeup.

RW

6

tmr: When set, this field enables the TMR timer clock on wakeup.

RW

5

wdog: When set, this field enables the WDOG timer clock on wakeup.

RW

4

cap: When set, this field enables the CAP timer clock on wakeup.

RW

3

pwm2: When set, this field enables the PWM2 timer clock on wakeup.

RW

2

pwm1: When set, this field enables the PWM1 timer clock on wakeup.

RW

1

cnt2: When set, this field enables the CNT2 timer clock on wakeup.

RW

0

cnt1: When set, this field enables the CNT1 timer clock on wakeup.

RW

7.9.15 ssm.cpu

Address: 0xFE56

Reset: 0x0000

Type: RW

This is a real time control register used to set the clock source and divider values for the memory interface clock mem_clk, the CPU clock cpu_clk and the register interface clock if_clk.

The register contains the following fields.

Bits

Field

Type

15:11

sts: This bit field indicates the clock source which is being used to generate the CPU clock and memory interface clock. This field can have one of the following values.

'00001': relaxation oscillator clock

'00010': low_pll_clk

'00100': high_pll_clk

'01000': low_ref_clk

'10000': high_ref_clk

R

10:6

clk_sel: This bit field selects the clock source that is used to clock the memory interface and CPU clock dividers. The clock source should be changed only when the clock status field ssm.cpu.sts above indicates that the previous change has taken effect. This field can have one of the following values.

'00001': relax_osc_clk: Selects the relaxation oscillator clock.

'00010': low_pll_clk: Selects the low PLL clock.

'00100': high_pll_clk: Selects the high PLL clock.

'01000': low_ref_clk: Selects the low reference clock.

'10000': high_ref_clk: Selects the high reference clock.

RW

5:3

cpu_clk_div: This field selects the divider value used to generate cpu_clk from the memory interface clock. The CPU clock frequency must not exceed 71MHz. This field can have one of the following values.

'000': div1: Clock is not divided.

'001': div2: Clock is divided by 2.

'010': div3: Clock is divided by 3.

'011': div4: Clock is divided by 4.

'100': div5: Clock is divided by 5.

'101': div6: Clock is divided by 6.

'110': div7: Clock is divided by 7.

'111': div8: Clock is divided by 8.

RW

2:0

prescaler: This field selects the divider value used to generate the memory interface clock from the selected source clock. This field can have one of the following values.

'000': div2: Clock is divided by 2.

'001': div4: Clock is divided by 4.

'010': div6: Clock is divided by 6.

'011': div8: Clock is divided by 8.

'100': div10: Clock is divided by 10.

'101': div12: Clock is divided by 12.

'110': div14: Clock is divided by 14.

'111': div16: Clock is divided by 16.

RW

7.9.16 ssm.osc_sts

Address: 0xFE58

Reset: 0x0000

Type: R

This read-only status register provides information about the clock oscillators and PLLs.

The register contains the following fields.

Bits

Field

Type

6

high_pll_lock: This field indicates the high frequency PLL lock state.
It returns a '1' when the high PLL is locked (error < 1%).

R

5

low_pll_lock: This field indicates the low frequency PLL lock state.
It returns a '1' when the low PLL is locked (error < 1%).

R

4

high_pll_ok: Returns '1' when the high PLL is running.

R

3

low_pll_ok: Returns '1' when the low PLL is running.

R

2

relax_osc_ok: Returns '1' when the relaxation oscillator is running.

R

1

high_ref_ok: Returns '1' when the high reference oscillator is running.

R

0

low_ref_ok: Returns '1' when the low reference oscillator is running.

R

7.9.17 ssm.pll_cfg

Address: 0xFE5A

Reset: 0x0000