Utilizing the Trigger Routing Unit for System Level Synchronization

Similar documents
Engineer-to-Engineer Note

Engineer-to-Engineer Note

Designing with STM32F3x

Hello, and welcome to this presentation of the STM32 Digital Filter for Sigma-Delta modulators interface. The features of this interface, which

32-bit ARM Cortex-M0, Cortex-M3 and Cortex-M4F microcontrollers

Electric Bike BLDC Hub Motor Control Using the Z8FMC1600 MCU

EIE/ENE 334 Microprocessors

Microcontroller: Timers, ADC

Microcontrollers: Lecture 3 Interrupts, Timers. Michele Magno

VORAGO Timer (TIM) subsystem application note

SPI Slave to PWM Generation

Motor Control using NXP s LPC2900

Lab 1.2 Joystick Interface

ADVANCED EMBEDDED MONITORING SYSTEM FOR ELECTROMAGNETIC RADIATION

Hello, and welcome to this presentation of the STM32G0 digital-to-analog converter. This block is used to convert digital signals to analog voltages

Iowa State University Electrical and Computer Engineering. E E 452. Electric Machines and Power Electronic Drives

AN-1397 APPLICATION NOTE

ELCT 912: Advanced Embedded Systems

Peripheral Link Driver for ADSP In Embedded Control Application

AN4507 Application note

Hello and welcome to this Renesas Interactive Course that provides an overview of the timers found on RL78 MCUs.

LED controllers. Voltage-switch drivers, constant-current drivers, and Flash LED drivers

Hello, and welcome to this presentation of the STM32L4 comparators. It covers the main features of the ultra-lowpower comparators and some

AN4062 Application note

Hello, and welcome to this presentation of the FlexTimer or FTM module for Kinetis K series MCUs. In this session, you ll learn about the FTM, its

RB01 Development Platform Hardware

3.3V regulator. JA H-bridge. Doc: page 1 of 7

Graphical Control Panel User Manual

UM2068 User manual. Examples kit for STLUX and STNRG digital controllers. Introduction

Temperature Monitoring and Fan Control with Platform Manager 2

Temperature Monitoring and Fan Control with Platform Manager 2

ZKit-51-RD2, 8051 Development Kit

STELLARIS ERRATA. Stellaris LM3S8962 RevA2 Errata

Single Phase Two-Channel Interleaved PFC Operating in CrM Using the MC56F82xxx Family of Digital Signal Controllers

Software Radio Satellite Terminal: an experimental test-bed

AN3252 Application note

USB4. Encoder Data Acquisition USB Device Page 1 of 8. Description. Features

Microprocessor & Interfacing Lecture Programmable Interval Timer

Stellaris ARM Cortex -M4F Training. Peripheral Overview

PWM 180-Pin Probing Board Manual

802.11g Wireless Sensor Network Modules

Exercise 3: Sound volume robot

FlexDDS-NG DUAL. Dual-Channel 400 MHz Agile Waveform Generator

AN2581 Application note

Training Schedule. Robotic System Design using Arduino Platform

Unit-6 PROGRAMMABLE INTERRUPT CONTROLLERS 8259A-PROGRAMMABLE INTERRUPT CONTROLLER (PIC) INTRODUCTION

Using Z8 Encore! XP MCU for RMS Calculation

Timer A (0 and 1) and PWM EE3376

Course Introduction. Content 20 pages 3 questions. Learning Time 30 minutes

DTMF Signal Detection Using Z8 Encore! XP F64xx Series MCUs

Using the Z8 Encore! XP Timer

NuMicro Family M051 DN/DE Series Product Brief

a8259 Features General Description Programmable Interrupt Controller

AN0026.0: EFM32 and EZR32 Wireless MCU Series 0 Low Energy Timer

DSP BASED SYSTEM FOR SYNCHRONOUS GENERATOR EXCITATION CONTROLL

AN2424 Application note

AC LAB ECE-D ecestudy.wordpress.com

I-7088, I-7088D, M-7088 and M-7088D User Manual

Generating DTMF Tones Using Z8 Encore! MCU

LM4: The timer unit of the MC9S12DP256B/C

Digital Debug With Oscilloscopes Lab Experiment

DNT2400. Low Cost 2.4 GHz FHSS Transceiver Module with I/O

AVR42778: Core Independent Brushless DC Fan Control Using Configurable Custom Logic on ATtiny817. Features. Introduction. AVR 8-bit Microcontroller

INTERFACING WITH INTERRUPTS AND SYNCHRONIZATION TECHNIQUES

APPLICATION NOTE. AT11009: Migration from ATxmega64D3/128D3/192D3/256D3 Revision E to Revision I. Introduction. Features.

JTAG pins do not have internal pull-ups enabled at power-on reset. JTAG INTEST instruction does not work

AN 761: Board Management Controller

MAX11300PMB1 Peripheral Module and Munich (USB2PMB1) Adapter Board Quick Start Guide

DDS24 custom component Application Note 0.0

Dual FOC Servo Motor Control on i.mx RT

Characteristic Sym Notes Minimum Typical Maximum Units Operating Frequency Range MHz. RF Chip Rate 11 Mcps RF Data Rates 1, 2, 5.

Dual core architecture with custom N-PLC optimized DSP and Data Link Layer / Application 32bit controller

Lab 2.2 Custom slave programmable interface

Timer A. Last updated 8/7/18

MCU Product Selection Guide

Practical Exercise. STM32F4 Discovery. Alessandro Palla

Low Cost PMSM Sensorless Field-Oriented Control Based on KE02

Embedded Robotics. Software Development & Education Center

Brian Hanna Meteor IP 2007 Microcontroller

Select the single most appropriate response for each question.

Ultrasonic Positioning System EDA385 Embedded Systems Design Advanced Course

Lab 5 Timer Module PWM ReadMeFirst

TLE9879 EvalKit V1.2 Users Manual

The Information contained herein is subject to change without notice. Revisions may be issued regarding changes and/or additions.

KV4x Family Product Brief Supports 150 MHz devices with 64 KB to 256 KB Flash

OBJECTIVE The purpose of this exercise is to design and build a pulse generator.

DNT24MCA DNT24MPA. Low Cost 2.4 GHz FHSS Transceiver Modules with I/O. DNT24MCA/MPA Absolute Maximum Ratings. DNT24MCA/MPA Electrical Characteristics

Three-Phase BLDC Sensorless Motor Control Using the MKV4x In Quadcopter Application

Figure 1. LDC Mode Operation Example

AN0026.1: EFM32 and EFR32 Wireless SOC Series 1 Low Energy Timer

Fixed-function (FF) implementation for PSoC 3 and PSoC 5LP devices

M0518. M0518 Board Supporting Package Directory Introduction. Rev M of 11 Rev Nuvoton Technology Corp.

Fixed-function (FF) implementation for PSoC 3 and PSoC 5 devices

GUJARAT TECHNOLOGICAL UNIVERSITY

IES Digital Mock Test

LV-Link 3.0 Software Interface for LabVIEW

PIC Functionality. General I/O Dedicated Interrupt Change State Interrupt Input Capture Output Compare PWM ADC RS232

AN5086 Application note

Mapping Peripheral Capabilities When Migrating From 8-bit to 16-bit PIC MCUs

SmartFusion csoc: Enhancing Analog Front-End Performance Using Oversampling and Fourth- Order Sigma-Delta Modulator

Transcription:

Engineer-to-Engineer Note EE-360 Technical notes on using Analog Devices DSPs, processors and development tools Visit our Web resources http://www.analog.com/ee-notes and http://www.analog.com/processors or e-mail processor.support@analog.com or processor.tools.support@analog.com for technical support. Utilizing the Trigger Routing Unit for System Level Synchronization Contributed by Akash Agarwal and Joe Tarkoff Rev October 9, 203 Introduction In embedded processor systems, synchronization of operation between events is of paramount importance. Interrupts are a common way of synchronizing operation between events. These can be timed by enabling the first event as an interrupt, which gets detected by the core. On detection of the interrupt, the core can start or stop a new process or event. Interrupts provide a reliable synchronization medium as they are serviced through the processor core. However, interrupts can add latency due to the time needed for core detection, context saving, and event servicing. The event processing latency depends on many conditions, such as priority levels or handling of simultaneous interrupts. Several Analog Devices Processors provide the so called Trigger Routing Unit (TRU). The TRU is particularly well suited for system events synchronization, helping reduce the delays involved in the synchronization process, as it removes the core processing of the event and increases determinism. Therefore, the TRU provides an efficient alternative to core interrupts for event synchronization in embedded systems. Although the concepts described in this EE-Note are TRU generic, this document focuses on how to utilize the Trigger Routing Unit on ADSP-BF60x Blackfin Processors. For processor specific details, refer to the device Data Sheet and Hardware Reference. The following items are discussed in this Engineer-to-Engineer Note: Trigger Routing Unit Trigger s and s TRU Programming Guidelines Code Examples TRU Description The TRU provides a system level sequence control without core intervention. It maps the trigger masters (trigger generators) to trigger slaves (triggers receivers). SEC Core s Peripheral Infrastructure TRU s Peripheral Infrastructure Core Figure. Interrupt and trigger execution sequence Copyright 204, Analog Devices, Inc. All rights reserved. Analog Devices assumes no responsibility for customer product design or the use or application of customers products or for any infringements of patents or rights of others which may result from Analog Devices assistance. All trademarks and logos are property of their respective holders. Information furnished by Analog Devices applications and development tools engineers is believed to be accurate and reliable, however no responsibility is assumed by Analog Devices regarding technical accuracy and topicality of the content provided in Analog Devices Engineer-to-Engineer Notes.

As shown in Figure, a System Event generated at a master may be forwarded to the System Event Controller (SEC). At the SEC, the interrupt source and priority are determined based on the programmed configuration. The interrupt is then forwarded to the assigned core, which executes the corresponding interrupt service routine (ISR). The processing of the interrupt at the SEC and the ISR execution by the core add further latency. In case of triggers, the TRU acts as a switch forwarding the request without any further processing. Upon receiving a trigger, this gets routed to the slave based on the programmed configuration. Trigger s and Trigger s On ADSP-BF60x Processors trigger slaves need to be pre-configured in order to respond to a trigger. In most cases, trigger masters generate a trigger when the corresponding interrupt is enabled. However, in certain cases triggers need to be specifically enabled []. The TRU supports routing of any trigger master to any trigger slave, while also supporting routing of a single master trigger to multiple slaves. The possible trigger propagation sequences are shown next: Single & Single Single & Multiple s n Multiple Roles (s & s) Chain Trigger On ADSP-BF60x processors, there are many modules, which can be programmed to act as both trigger master and slave. Table provides a detailed list of modules that can serve in this dual role, or as a trigger master or trigger slave only. & Only Only GP Timer CGU Event RCU System Reset SPORT DMA PINT (GPIO) NMI SPI DMA RSI DMA (SDIO) GP Counter Status PWM 0/ TRU Interrupt ACM Trigger SDU DMA ACM Event SDU LP DMA EMAC Status Core Wakeup UART DMA MDMA 2 EPPI DMA PIXC DMA PVP DMA USB DMA SEC Fault PVP Status Software Driven SWU Events 2 2 2 Table. ADSP-BF60x Trigger s and s Utilizing the Trigger Routing Unit for System Level Synchronization (EE-360) Page 2 of 8

Furthermore, each of the modules listed above have specific events, which can be configured to work as either masters or slaves. Table 2 and Table 3 provide a verbose description of these events. For a more detailed description of events, please refer to the ADSP-BF60x Blackfin Processor Hardware Reference []. Trigger GP Timer DMA CGU PINT (Port) PWM GP Counter ACM EMAC Status SEC Faults Software Driven SWU USB DMA Status / Transfer Complete Events Active Edges (PININT mode) Delay Expired (PWMOUT mode) Width Plus Delay Expired (Watchdog mode) Period Expired (Watchdog) -D trigger at the end of the whole work unit 2-D end of each row, or at the end of whole work unit PLL locked and clocks synchronized CGU Event User-programmable port activity (PINT0-PINT5) Timer's period boundary reached Illegal Gray/Binary Code Events Up/Down Count Events Zero-Count Events Overflow Events Boundary Match Events Zero Marker Events Sampling completion Time Stamp Status MMC Receive Checksum Offload status MMC Transmit/Receive interrupt status Faults generated through the SEC by an interrupt-capable peripheral, core, or infrastructure block Software writes (by master ID) to MMR register User-determined bus monitoring conditions VBUS drops below the VBUS valid threshold during session (A device only) SRP signaling detected (A device only) Device connected /disconnected detected (host mode) Babble detected (host mode) Session ends/ reset signaling detected (peripheral mode) Resume signaling detected in suspend mode Start-of-frame Utilizing the Trigger Routing Unit for System Level Synchronization (EE-360) Page 3 of 8

Daisy chain completion Write error, completion of drain operation Pipe ready Data events PVP Status Output/Status FIFO overflow Input overflow Histogram ready Integral unsigned/signed overflow Divide by zero ACU Output / Multiplication / Addition Saturation Table 2. Trigger Events Trigger GP Timer DMA & MDMA RCU ACM Wake-up Core Interrupt Core Events Start/Stop timer Start DMA transfer System reset all functional units (except RCU_STAT, RCU_BCODE, RCU_CRCTL registers and units on the VDD_EXT power domain) Initiate ADC sampling event Breaks idle state Trigger Routing Unit interrupts (through SEC) Raise 2 (Non-Maskable Interrupt - NMI) Table 3. Trigger Events TRU Programming Guidelines Here next are a few important points to be considered when programming the Trigger Routing Unit: The TRU operates in the System Clock (SYSCLK) domain. Software triggering may be used for trigger assertion. When using the GPIO or PWM as trigger masters for back to back triggers, the trigger assertions latched in the corresponding latch registers (PINT_ILAT and PWM_ILAT) must be cleared in software for back to back triggers to work. For more details on the TRU programming model, please refer to the ADSP-BF60x Blackfin Processor Hardware Reference []. Code Examples The associated.zip file contains two code examples. Example uses the TRU to time a definite frequency signal. Example 2 uses the TRU to time an unknown frequency signal. Both of these examples have been implemented using CrossCore Embedded Studio development tools and the ADSP-BF609 EZ- Board evaluation platform [3]. Utilizing the Trigger Routing Unit for System Level Synchronization (EE-360) Page 4 of 8

Code Example Experimental Setup Figure 2 shows the experimental setup for code example. This example uses the TRU to time a definite external event without utilizing the core. In order to do so, the peripherals are configured in the following roles: GP PB_2 as master GP TMR0 as slave MDMA2 (channels 25 and 26) as slave An Agilent 33250A 80 MHz Function/Arbitrary Function generator [4] is used to generate an external pulse frequency of KHz and period of millisecond (ms). GPIO Port B is configured in GPIO mode and in input direction. Pin Interrupt Port 0 (PINT0) and Port (PINT) are configured to detect the rising and falling edge of the input signal respectively. The GP Timer 0 is configured in continuous PWM out mode counting based on SCLK0. The timer is configured to start on a receiving trigger. The MDMA channels 25-26 are configured to initiate a write to TIMER_RUN_CLR register on a receiving trigger. The TRU is configured to map the PINT0 trigger to the timer and the PINT trigger to MDMA channel. The TMR0_TMR0 pin is observed for the continuous PWM wave on a Tektronix, TDS 7404 Digital Phosphor Oscilloscope [5] and captured using a Tektronix P7330 3.5 GHz differential probe [5]. Figure 2. Experimental setup to time a definite frequency signal Operation The GPIO pins are applied with a single pulse of an external frequency signal of KHz. PB2 pin detects the rising edge and generates PINT0 trigger. The TRU forwards the PINT0 trigger to Timer0, which initiates the timer counting SCLK0 periods. PB2 detects the falling edge of the input signal and generates the PINT trigger. The TRU forwards the PINT trigger to the MDMA channel 25-26. The MDMA channels then initiate a write on bit 0 of TIMER_RUN_CLR register, which then stops Timer0. Utilizing the Trigger Routing Unit for System Level Synchronization (EE-360) Page 5 of 8

Results Code Example 2 Experimental Setup Figure 4 shows the experimental setup for code example 2. This example uses the TRU to time an external event without utilizing the core. In order to do so, the peripherals are configured in the following roles: GP PB_0 as master GP TMR0 as slave MDMA2 (channels 25 and 26) as slave Figure 3. Example scope plot Figure 3, shows the result obtained from the code. The external trigger is indicated in green and the PWM wave is indicated in pink. The oscilloscope plot shows that as the EXT_TRIG signal goes high, Timer0 starts counting, and that as the EXT_TRIG signal goes low, Timer0 stops. The time difference as captured on the oscilloscope is.06 ms. GPIO Port B is configured in GPIO mode and in input direction. Pin Interrupt Port 0 (PINT0) and Port (PINT) are configured to detect the rising and falling edge of the input signal respectively. The GP Timer 0 is configured in continuous PWM out mode counting based on SCLK0. The timer is configured to start on a receiving trigger. The MDMA channels 25-26 are configured to initiate a write to TIMER_RUN_CLR register on a receiving trigger. The TRU is configured to map the PINT0 trigger to the timer and the PINT trigger to MDMA channel. Figure 4. Experimental setup to time an unknown frequency signal Operation When pressing Push Button (PB) on the ADSP-BF609 EZ-Board evaluation platform, pin PB0 detects the rising edge and generates the PINT0 trigger. The TRU forwards the PINT0 trigger to Timer0, which initiates the timer counting on SCLK0. When releasing PB, PINT signal detects the falling edge of the input signal and generates the PINT trigger. The TRU forwards the PINT trigger to the MDMA Utilizing the Trigger Routing Unit for System Level Synchronization (EE-360) Page 6 of 8

channels 25-26. The MDMA channels then initiate a write on bit 0 of TIMER_RUN_CLR registers, which then stops Timer0 and prints the duration, in milliseconds, for which the push button was pressed. Results Figure 5, shows the result obtained from the code. It shows that the Push button (PB) was pressed for 7, 392 ms. Figure 5. Example 2 console output Conclusion This EE-Note discussed a possible way of using the Trigger Routing Unit to off-load event timing activity from the processor s core. As described, the TRU can provide a more deterministic way of synchronizing critical events compared to using interrupts. By off-loading processing tasks from the core, this can be preserved for performing critical operations. This document also provided a couple of examples for using the TRU to time a definite and unknown frequency signals. In these examples, it was also demonstrated how the TRU can be used to trigger memory transfers via de Memory-to- Memory DMA channels and how to write to a given Memory Mapped Register. The capability to write to MMR space using the DMA engine provides a unique way of changing peripheral behavior on-the-fly without processor core intervention. Utilizing the Trigger Routing Unit for System Level Synchronization (EE-360) Page 7 of 8

References [] ADSP-BF60x Blackfin Processor Hardware Reference. Rev 0.5, February 203. Analog Devices, Inc. [2] ADSP-BF606/ADSP-BF607/ADSP-BF608/ADSP-BF609 Blackfin Dual Core Embedded Processors Data Sheet. Rev 0, June 203. Analog Devices Inc. [3] ADSP-BF609 EZ-KIT Lite Evaluation System Manual. Rev.0, March 202. Analog Devices, Inc. [4] 33250A Function / Arbitrary Waveform Generator, 80 MHz (http://www.home.agilent.com/en/pd- 000000803%3Aepsg%3Apro-pn-33250A/function-arbitrary-waveform-generator-80-mhz?&cc=ES&lc=eng). Agilent Technologies, Inc. [5] TDS 7404 Digital Phosphor Oscilloscope (http://www.tek.com/datasheet/digital-phosphor-oscilloscopes-6). Tektronix, Inc. [6] P7330 3.5 GHz High-Performance Differential Probe (http://www.tek.com/datasheet/node/79647-high-performancedifferential-probes). Tektronix, Inc. Document History Revision Rev October 9, 203 by A. Agarwal and J. Tarkoff Description Initial release. Utilizing the Trigger Routing Unit for System Level Synchronization (EE-360) Page 8 of 8