DOCA0275EN-00

Timer Logic Commands

Overview

The custom logic editor uses the following timer commands:

  • TIMER_SEC

  • TIMER_TENTHS

  • TIMER_K_SEC

  • TIMER_K_TENTHS

NOTE: When a custom logic file is uploaded to the simulator and a timer is enabled, it will function as expected. However, once a timer has been enabled and executed, it cannot be enabled again. This is a limitation of the TIMER_SEC and TIMER_TENTHS. To enable the timer again, the custom logic file should be uploaded again. It is recommend that this limitation is considered when designing and testing the custom logic files when working with timers.

TIMER_SEC

The TIMER_SEC command:

  • Counts time in seconds, up to the number of counts specified by a temporary register

  • Calculates the end time in a second temporary register

  • Is enabled by, and reports its counting status to, a third temporary register

Arguments

Representation

3

TIMER_SEC TmpReg1 TmpReg2 TmpReg3

Input Argument

Type

Range/Bit

Description

TmpReg1

UINT

0–65,535

Timer preset value

TmpReg3

UINT

Bit0

  • Starts the timer on a rising edge

  • Stops the timer on a falling edge

Output Argument

Type

Range/Bit

Description

TmpReg2

UINT

0–65,535

Calculated end time

TmpReg3

UINT

Bit1

Timer done:

  • Bit set when timer reaches TmpReg2

  • Bit reset when:

    • TmpReg3.Bit0 is reset

    • Power is cycled

Bit2

Timer execution in progress

Bit reset when timer reaches TmpReg2

Bit3

TmpReg3.Bit0 history bit

Bit4

Reserved

TIMER_TENTHS

The TIMER_TENTHS command:

  • Counts time in tenths of seconds, up to the number of counts specified by a temporary register

  • Calculates the end time in a second temporary register

  • Is enabled by, and reports its counting status to, a third temporary register

NOTE: The multiplication factor for the TIMER_TENTHS command is 10. For example, if the required value is 6 seconds, the input value should be multiplied by a factor of 10, meaning the input value provided should be 60 seconds.

Arguments

Representation

3

TIMER_TENTHS TmpReg1 TmpReg2 TmpReg3

Input Argument

Type

Range/Bit

Description

TmpReg1

UINT

0–65,535

Timer preset value

TmpReg3

UINT

Bit0

  • Starts the timer on a rising edge

  • Stops the timer on a falling edge

Output Argument

Type

Range/Bit

Description

TmpReg2

UINT

0–65,535

Calculated end time

TmpReg3

UINT

Bit1

Timer done:

  • Bit set when timer reaches TmpReg2

  • Bit reset when:

    • TmpReg3.Bit0 is reset

    • Power is cycled

Bit2

Timer execution in progress

Bit reset when timer reaches TmpReg2

Bit3

TmpReg3.Bit0 history bit

Bit4

Reserved

TIMER_K_SEC

The TIMER_K_SEC command:

  • Counts time in seconds, up to the number of counts specified by a constant value

  • Calculates the end time in a temporary register

  • Is enabled by, and reports its counting status to, a second temporary register

Arguments

Representation

3

TIMER_K_SEC KValue TmpReg1 TmpReg2

Input Argument

Type

Range/Bit

Description

KValue

UINT

0–65,535

Timer preset value

TmpReg2

UINT

Bit0

  • Starts the timer on a rising edge

  • Stops the timer on a falling edge

Output Argument

Type

Range/Bit

Description

TmpReg1

UINT

0–65,535

Calculated end time

TmpReg2

UINT

Bit1

Timer done:

  • Bit set when timer reaches TmpReg1

  • Bit reset when:

    • TmpReg2.Bit0 is reset

    • Power is cycled

Bit2

Timer execution in progress

Bit reset when timer reaches TmpReg1

Bit3

TmpReg2.Bit0 history bit

Bit4

Reserved

TIMER_K_TENTHS

The TIMER_K_TENTHS command:

  • Counts time in tenths of seconds, up to the number of counts specified by a constant value

  • Calculates the end time in a temporary register

  • Is enabled by, and reports its counting status to, a second temporary register

Arguments

Representation

3

TIMER_K_TENTHS KValue TmpReg1 TmpReg2

Input Argument

Type

Range/Bit

Description

KValue

UINT

0–65,535

Timer preset value

TmpReg2

UINT

Bit0

  • Starts the timer on a rising edge

  • Stops the timer on a falling edge

Output Argument

Type

Range/Bit

Description

TmpReg1

UINT

0–65,535

Calculated end time

TmpReg2

UINT

Bit1

Timer done:

  • Bit set when timer reaches TmpReg1

  • Bit reset when:

    • TmpReg2.Bit0 is reset

    • Power is cycled

Bit2

Timer execution in progress

Bit reset when timer reaches TmpReg1

Bit3

TmpReg2.Bit0 history bit

Bit4

Reserved

QR Code is a registered trademark of DENSO WAVE INCORPORATED in Japan and other countries.

Was this helpful?