APPLICATION. si32library. Callback CMSIS HARDWARE. Figure 1. Firmware Layer Block Diagram



Similar documents
PC Base Adapter Daughter Card UART GPIO. Figure 1. ToolStick Development Platform Block Diagram

QSG105 GETTING STARTED WITH SILICON LABS WIRELESS NETWORKING SOFTWARE

How To Develop A Toolstick

AN220 USB DRIVER CUSTOMIZATION

ZigBee-2.4-DK 2.4 GHZ ZIGBEE DEVELOPMENT KIT USER S GUIDE. 1. Kit Contents. Figure GHz ZigBee Development Kit

CP2110-EK CP2110 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Relevant Documentation. 3. Software Setup

UG103.8 APPLICATION DEVELOPMENT FUNDAMENTALS: TOOLS

AN588 ENERGY HARVESTING REFERENCE DESIGN USER S GUIDE. 1. Kit Contents. 2. Introduction. Figure 1. Energy Harvesting Sensor Node

AN220 USB DRIVER CUSTOMIZATION

AN655 R ANGE TEST APPLICATION FOR EZRADIO AND EZRADIOPRO. 1. Introduction. 2. Supported Radio Types

In the idle state, the TIP lead will be high impedance to ground and the RING lead will have the battery voltage. See Figure 1.

1 Software Overview ncp-uart ash-v3-test-app ash-v3-test-app Command Line Options Testing... 2

USB FM Radio-RD USB FM RADIO USER S GUIDE. 1. USB FM Radio Setup. One-time set-up enables configuration of presets and region specific FM band

AN335 USB DRIVER INSTALLATION METHODS. 1. Introduction. 2. Relevant Documentation. 3. DPInst Installation and Customization

AN437. Si4432 RF PERFORMANCE AND FCC COMPLIANCE TEST RESULTS. 1. Introduction. 2. Relevant Measurements to comply with FCC

AN335 USB DRIVER INSTALLATION UTILITY. 1. Description. 2. Installation Install Package

Software Real Time Clock Implementation on MC9S08LG32

AN108 IMPLEMENTING A REALTIME CLOCK. Relevant Devices. Introduction. Key Points. Overview

AN104 I NTEGRATING KEIL 8051 TOOLS INTO THE SILICON LABS IDE. 1. Introduction. 2. Key Points. 3. Create a Project in the Silicon Labs IDE

IRTC Compensation and 1 Hz Clock Generation

Backup Power Domain. AN Application Note. Introduction

Freescale Semiconductor, Inc. Product Brief Integrated Portable System Processor DragonBall ΤΜ

Initializing the TSEC Controller

Flexible Active Shutter Control Interface using the MC1323x

Genesi Pegasos II Setup

APPLICATION NOTE. Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Atmel AVR 8-bit Microcontroller. Introduction.

PAC52XX Clock Control Firmware Design

AND8336. Design Examples of On Board Dual Supply Voltage Logic Translators. Prepared by: Jim Lepkowski ON Semiconductor.

AN LPC1700 timer triggered memory to GPIO data transfer. Document information. LPC1700, GPIO, DMA, Timer0, Sleep Mode

AN LPC1700 RTC hardware auto calibration. Document information. RTC, Hardware Auto Calibration, LPC1700, Graphic LCD

AN111: Using 8-Bit MCUs in 5 Volt Systems

Programming Audio Applications in the i.mx21 MC9328MX21

UG103.9 EMBER APPLICATION DEVELOPMENT FUNDAMENTALS: ZLL

RENESAS TECHNICAL UPDATE

This tutorial material is part of a series to be published progressively by Doulos.

Figure 1. 8-Bit USB Debug Adapter

Current Digital to Analog Converter

Windows 7: Using USB TAP on a Classic CodeWarrior Installation (MGT V9.2 DSC V8.3)

AVR1321: Using the Atmel AVR XMEGA 32-bit Real Time Counter and Battery Backup System. 8-bit Microcontrollers. Application Note.

AN3332 Application note

APPLICATION NOTE. AT07175: SAM-BA Bootloader for SAM D21. Atmel SAM D21. Introduction. Features

USER GUIDE EDBG. Description

AN3265 Application note

Processor Expert Software Microcontrollers Driver Suite Getting Started Guide

AN114. Scope. Safety. Materials H AND SOLDERING TUTORIAL FOR FINE PITCH QFP DEVICES. Optional. Required. 5. Solder flux - liquid type in dispenser

Bootloader with AES Encryption

User Guide. Introduction. HCS12PLLCALUG/D Rev. 0, 12/2002. HCS12 PLL Component Calculator

AN962: Implementing Master-Slave Timing Redundancy in Wireless and Packet- Based Network Applications

AN862. OPTIMIZING Si534X JITTER PERFORMANCE IN NEXT GENERATION INTERNET INFRASTRUCTURE SYSTEMS. 1. Introduction

AN803. LOCK AND SETTLING TIME CONSIDERATIONS FOR Si5324/27/ 69/74 ANY-FREQUENCY JITTER ATTENUATING CLOCK ICS. 1. Introduction

Hardware Configurations for the i.mx Family USB Modules

APPLICATION NOTE Atmel AT02509: In House Unit with Bluetooth Low Energy Module Hardware User Guide 8-bit Atmel Microcontroller Features Description

Features + REFCLK CLKOUT. Si DATAOUT DATAIN LOS LTR RESET/CAL CLKDSBL LOS_LVL REXT SLICE_LVL BER_LVL. Si5013-EVB

AND9035/D. BELASIGNA 250 and 300 for Low-Bandwidth Applications APPLICATION NOTE

UG129: ZigBee USB Virtual Gateway Reference Design (RD ) User's Guide

Implementing SPI Master and Slave Functionality Using the Z8 Encore! F083A

Internal Oscillator. I 2 C Interface. SPI Interface. Controller. Internal Registers Port Controller. Eight I/O Pins. Figure 1.

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

Freescale Semiconductor, I

PowerQUICC II Pro (MPC83xx) PCI Agent Initialization

Developing an Application on Core8051s IP-Based Embedded Processor System Using Firmware Catalog Drivers. User s Guide

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

AN710 BRINGING UP CUSTOM DEVICES FOR THE EMBER EM35XX SOC OR NCP PLATFORM. (Formerly document )

Making Prototyping Boards for the EFM32 kits

AN141 SMBUS COMMUNICATION FOR SMALL FORM FACTOR DEVICE FAMILIES. 1. Introduction. 2. Overview of the SMBus Specification. 2.1.

Local Interconnect Network (LIN) Physical Interface

CodeWarrior Development Studio for Freescale S12(X) Microcontrollers Quick Start

CodeWarrior Development Studio Floating Licensing Quick Start

SMARTCARD XPRO. Preface. SMART ARM-based Microcontrollers USER GUIDE

etpu Host Interface by:

EE8205: Embedded Computer System Electrical and Computer Engineering, Ryerson University. Multitasking ARM-Applications with uvision and RTX

UM1680 User manual. Getting started with STM32F429 Discovery software development tools. Introduction

UG103.8: Application Development Fundamentals: Tools

Programmazione Microcontrollori

ES_LPC4357/53/37/33. Errata sheet LPC4357/53/37/33. Document information

Procidia Control Solutions Dedicated Backup in a Single Variable Control Loop

AN4646 Application note

APPLICATION NOTE. AT16268: JD Smart Cloud Based Smart Plug Getting. Started Guide ATSAMW25. Introduction. Features

Performance Monitor on PowerQUICC II Pro Processors

Quick Start Guide. MRB-KW01 Development Platform Radio Utility Application Demo MODULAR REFERENCE BOARD

Product Brief. 2.0 microtoled. Intelligent GOLDELOX Display Module. µtoled-20-g2. Rev 1.0

AVR317: Using the Master SPI Mode of the USART module. 8-bit Microcontrollers. Application Note. Features. Introduction

How To Control A Motor Control On An Hvac Platform

AND8365/D. 125 kbps with AMIS-4168x APPLICATION NOTE

TS1005 Demo Board COMPONENT LIST. Ordering Information. SC70 Packaging Demo Board SOT23 Packaging Demo Board TS1005DB TS1005DB-SOT

AN10866 LPC1700 secondary USB bootloader

XPort Universal Demo Board User Guide

AN3998 Application note

AN974 APPLICATION NOTE

An Introduction to MPLAB Integrated Development Environment

AVR319: Using the USI module for SPI communication. 8-bit Microcontrollers. Application Note. Features. Introduction

Detecting a CPM Overload on the PowerQUICC II

Getting Started with Kinetis SDK (KSDK)

M68EVB908QL4 Development Board for Motorola MC68HC908QL4

Freescale Variable Key Security Protocol Transmitter User s Guide by: Ioseph Martínez and Christian Michel Applications Engineering - RTAC Americas

AND9190/D. Vertical Timing Optimization for Interline CCD Image Sensors APPLICATION NOTE

AVR131: Using the AVR s High-speed PWM. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

APPLICATION NOTE. AT17284: Proximetry Cloud Based Smart Plug User Guide. SMART ARM-based Microcontrollers. Introduction. Features

Sensor Puck SENSOR PUCK USER S GUIDE. 1. Introduction. 2. Evaluation Kit Description

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

Transcription:

PRECISION32 SOFTWARE DEVELOPMENT KIT CODE EXAMPLES OVERVIEW 1. Introduction The Precision32 code examples are part of the Software Development Kit (SDK) installed with the Precision32 software package available at www.silabs.com/32bit-software. The code examples are simple and complete examples that illustrate and highlight the peripheral modes and features. They are also modular so code can be copied into an application base, making peripheral-specific code development easy. Figure 1 shows the Precision32 firmware layer block diagram. CODE EXAMPLES APPLICATION si32library Callback RTOS CMSIS CoreSupport (from ARM) CMSIS CMSIS DeviceSupport (from Silicon Labs) HARDWARE 2. Relevant Documentation Figure 1. Firmware Layer Block Diagram Precision32 Application Notes are listed on the following website: www.silabs.com/32bit-mcu. AN664: Precision32 CMSIS and HAL User s Guide AN667: Getting Started with the Silicon Labs Precision32 IDE AN670: Getting Started with the Silicon Labs Precision32 AppBuilder AN673: Precision32 Software Development Kit (SDK) Overview Rev. 0.1 2/12 Copyright 2012 by Silicon Laboratories AN668

3. Code Example Organization The code examples are separated by device and are located in si32-x.y\examples\device, where x is the major SDK version, and y is the minor SDK version. Each code example has its own folder named with the peripheral or example name. The IDE can import these code examples using the instructions in the application note, AN667: Getting Started with the Silicon Labs Precision32 IDE. Sub-directories under the example folder include example projects for uvision and IAR. Figure 2 displays the code example organization on disk. Figure 2. Code Example Organization 2 Rev. 0.1

4. Detailed Documentation The detailed documentation for each code example is in the Readme file in the example folders.this file includes a basic description of the example, the resources and clock speeds used, notes on the example and supported modes, and detailed how-to-use steps. The _Readme.txt file shown in Figure 3 is installed in si32-x.y\example\sim3u1xx\ for SiM3U1xx devices after installing the Precision32 software package. Figure 3. Code Example Documentation Rev. 0.1 3

5. SiM3U1xx Example uses the SiM3U1xx RTC0 module and SysTick to toggle two LEDs. PB2.10 (LED on the SiM3U1xx MCU card) toggles every 500 ms using the RTC counting 10 ms intervals. PB2.11 (also an LED) toggles every second using SysTick. The example also reads the switches on the MCU card (PB2.8 and PB2.9) every 500 ms and prints their status to the Console view (semi-hosting) by default. The code examples follow the Silicon Labs AppBuilder file generation structure: generated files are included in the src\generated folder with the g- prefix, and application files are in the src folder with my- prefix. All of the modes implemented in the example are called from main. In the example, main calls gmodes_enter_my_default_mode() from gmodes.c, which then calls gcpu_enter_default_config() in gcpu.c, and so forth. These code examples use the Silicon Labs Hardware Access Layer (HAL) macros by default. Figure 4. Example 4 Rev. 0.1

5.1. Application-Specific Files AN668 5.1.1. main.c The main.c file calls functions from the gmodes.c and the port HAL as shown in Figure 5. This file also includes all the main application code that sits in a while(1) loop, toggling the LED pins or reading the switches and printing their status to the Console view. main.c gmodes.c SI32_PBSTD_A_Type.c Figure 5. main.c Dependencies 5.1.2. mycpu.c This file has the application-specific implementation of mysysteminit() called by system_sim3u1xx.c in the HAL. For, this function: Disables the Watchdog Timer. Enables APB to the Port Bank modules. Sets the Serial Wire Viewer pin (PB1.3) to push-pull. Figure 6 shows the dependencies for mycpu.c. mycpu.c SI32_CLKCTRL_A_Type.c system_sim3u1xx.c SI32_WDTIMER_A_Type.c SI32_PBSTD_A_Type.c Figure 6. mycpu.c Dependencies 5.1.3. mypb.c This file doesn t include any application-specific code for the example. Rev. 0.1 5

5.1.4. myrtc0.c The myrtc0.c file includes the second-level handlers for the RTC0 Alarm 0 and RTC0 oscillator fail interrupts. These second-level handlers are called from the first-level handlers in grtc0.c. The second-level Alarm 0 handler: Reads the RTC0 counter value. Sets the RTC0 Alarm 0 value with a new value equal to the current counter value + 10 ms. Increments msticks_10, which keeps track of the 10 ms intervals. Clears the Alarm 0 interrupt in the RTC0 module. The second-level oscillator fail handler sits in a while(1) loop to indicate an unrecoverable error condition. Figure 6 shows the dependencies for myrtc0.c. myrtc.c grtc.c SI32_RTC_A_Type.c SI32_RTC_A_Type.c SI32_RTC_A_Type.c 5.2. AppBuilder-Generated Files Figure 7. myrtc0.c Dependencies 5.2.1. gcpu.c This file contains the SysTick handler, which increments the msticks variable, and the gcpu_enter_default_config() function, which is called from gmodes_enter_my_default_mode() in gmodes.c. This function sets the SystemCoreClock variable to 20 MHz, since uses the Low Power Oscillator, and sets the SysTick timer to trigger every millisecond. Figure 8 shows the dependencies for gcpu.c. gcpu.c gmodes.c core_cm3.h Figure 8. gcpu.c Dependencies 6 Rev. 0.1

5.2.2. gmodes.c The gmodes.c file has two functions: gmodes_enter_my_default_mode() and gmodes_enter_my_off_mode(). The default mode function places the device in the default mode after a reset and calls gcpu_enter_default_config() from gcpu.c, gpb_enter_default_config() from gpb.c, and grtc0_enter_default_config() from grtc0.c. The off mode function is not currently called from anywhere in the project and includes calls to grtc0_enter_off_config() from grtc0.c and gpb_enter_off_config() from gpb.c. Figure 9 illustrates the dependencies diagram for gmodes.c. gcpu.c gmodes.c gpb.c grtc0.c Figure 9. gmodes.c Dependencies Rev. 0.1 7

5.2.3. gpb.c This file includes two functions: gpb_enter_off_config() and gpb_enter_default_config(). The gpb_enter_off_config() function is called by gmodes_enter_my_off_mode() in gmodes.c and sets all the pins to digital input mode, disables crossbar 1, and disables the APB clock to the port registers. The gpb_enter_default_config() function: Enables the APB clock to the port registers. Sets the SWV pin to push-pull. Enables crossbar 1. Sets the PB2.10 and PB2.11 pins to push-pull. Sets the PB2.8 and PB2.9 pins to digital input mode. Configures the PB0.9 and PB0.10 RTC0 oscillator input pins as analog inputs. Configures PB2.7 to output the RTC0 clock by setting PB2.7 to push-pull, skipping the PB2.0-PB2.6 pins on crossbar 1, and enabling the oscillator output on crossbar 1. Figure 10 shows the dependencies for gpb.c. gpb.c SI32_CLKCTRL_A_Type.c SI32_PBSTD_A_Type.c SI32_PBCFG_A_Type.c Figure 10. gpb.c Dependencies 8 Rev. 0.1

5.2.4. grtc0.c The grtc0.c file includes the first-level interrupt handlers for the RTC0 oscillator fail (RTC0FAIL_IRQHandler()) and Alarm 0 (RTC0ALRM_IRQHandler()). These first-level interrupt handlers just call the second-level handlers and must use the handler names defined in sim3u1xx.h, the device-specific header file. In addition to the first-level interrupt handlers, grtc0.c has two functions: grtc_enter_off_config() and grtc0_enter_default_config(). The grtc_enter_off_config() function disables the Alarm 0 interrupt in the RTC0 module, clears any pending oscillator fail or Alarm 0 interrupts in the NVIC, and disables these two interrupts in the NVIC. In addition, the function stops the RTC0 timer, disables the RTC0 module, and disables the APB clock to RTC0. The grtc0_enter_default_config() function: Enables the APB clock to the RTC0 module. Enables the RTC module and configures it for crystal oscillator mode. Sets the initial Alarm 0 value for 10 ms. Clears any pending interrupts and enables the interrupts in the NVIC. Enables the Alarm 0 interrupt in the RTC0 module. Enables the RTC0 output. Figure 11 shows the dependencies for grtc0.c. grtc0.c myrtc0.c SI32_CLKCTRL_A_Type.c SI32_RTC_A_Type.c core_cm3.h Figure 11. grtc0.c Dependencies Rev. 0.1 9

CONTACT INFORMATION Silicon Laboratories Inc. 400 West Cesar Chavez Austin, TX 78701 Tel: 1+(512) 416-8500 Fax: 1+(512) 416-9669 Toll Free: 1+(877) 444-3032 Please visit the Silicon Labs Technical Support web page: https://www.silabs.com/support/pages/contacttechnicalsupport.aspx and register to submit a technical support request. The information in this document is believed to be accurate in all respects at the time of publication but is subject to change without notice. Silicon Laboratories assumes no responsibility for errors and omissions, and disclaims responsibility for any consequences resulting from the use of information included herein. Additionally, Silicon Laboratories assumes no responsibility for the functioning of undescribed features or parameters. Silicon Laboratories reserves the right to make changes without further notice. Silicon Laboratories makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Silicon Laboratories assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. Silicon Laboratories products are not designed, intended, or authorized for use in applications intended to support or sustain life, or for any other application in which the failure of the Silicon Laboratories product could create a situation where personal injury or death may occur. Should Buyer purchase or use Silicon Laboratories products for any such unintended or unauthorized application, Buyer shall indemnify and hold Silicon Laboratories harmless against all claims and damages. Silicon Laboratories and Silicon Labs are trademarks of Silicon Laboratories Inc. Other products or brandnames mentioned herein are trademarks or registered trademarks of their respective holders. 10 Rev. 0.1