AN0009.0: EFM32 and EZR32 Series 0 スタ ート・ガイド

Document preview
File info: application/pdf · 25 pages · 1.28MB

AN0009.0: EFM32 and EZR32 Series 0 スタ ート・ガイド

MCU, MCU, MCU, MCU, 32-bit, EFM32 and EZR32 Series 0 スタート・ガイド, このアプリケーション・ノートでは, EFM32 and EZR32 Series 0 で使用可能なソフトウェア例, ライブラリ, ドキュメント, ソフトウェア・ツールについて紹介します, MCU, 32-bit, EFM32 and EZR32 Series 0 スタート・ガイド, このアプリケーション・ノートでは、EFM32 and EZR32 Series 0 で使用可能なソフトウェア例、ライブラリ、ドキュメント、ソフトウェア・ツールについて紹介します,

Full PDF Document

Loading PDF...
Download PDF

If the inline viewer fails, it will open the original document in compatibility mode automatically. You can also open the file directly.

Extracted Text

AN0009.0: EFM32 and EZR32 Series 0  

EFM32 and EZR32 Series 0  
 emlib Simplicity Studio  
 MCU  EZR32  Simplicity Studio  AN0822Simplicity StudioTM User Guide Silicon Labs  (www.silabs.com/32bit-appnotes)   Simplicity Studio 


� Simplicity Studio EFM32 and EZR32 Series 0  
�  �  � emlib  � LED  � LCD  �  � 

silabs.com | Building a more connected world.

Rev. 1.21

AN0009.0: EFM32 and EZR32 Series 0 

 1  

MCU Series 0 consists of: � EFM32 Gecko (EFM32G) � EFM32 Giant Gecko (EFM32GG) � EFM32 Wonder Gecko (EFM32WG) � EFM32 Leopard Gecko (EFM32LG) � EFM32 Tiny Gecko (EFM32TG) � EFM32 Zero Gecko (EFM32ZG) � EFM32 Happy Gecko (EFM32HG)
Wireless MCU Series 0 consists of: � EZR32 Wonder Gecko (EZR32WG) � EZR32 Leopard Gecko (EZR32LG) � EZR32 Happy Gecko (EZR32HG)

silabs.com | Building a more connected world.

Rev. 1.21 | 2

 2  

AN0009.0: EFM32 and EZR32 Series 0 


2.1 
 Silicon Labs  EFM32 Series 0   IDE 
� Silabs.com (http://www.silabs.com/simplicity)  Simplicity Studio  � IAR                          Segger J-Link              (https://
www.segger.com/jlink-software.html)
Simplicity Studio  [Update Software]  

Note: Simplicity Studio  IDE IAR  IDE   EFM32 and EZR32 Series 0   IDE Simplicity Studio 

silabs.com | Building a more connected world.

Rev. 1.21 | 3

AN0009.0: EFM32 and EZR32 Series 0 

2.2 
 an0009_efm32_getting_started 
Simplicity Studio  [Getting Started]  [Application Notes]    [Application Notes] 

Click any Application Note
to open dialog
 2.1. Simplicity Studio 
[Application Notes] [AN0009 Getting Started with EFM32AN0009 EFM32  ] [Import Project......]   1   IDE  Simplicity IDE  IDE 
 IDE iararm  Simplicity Studio  [Applications Notes]  [Open Folder ]  IDE  IAR   efm32.eww  1   Note:   *_solution.c 

silabs.com | Building a more connected world.

Rev. 1.21 | 4

AN0009.0: EFM32 and EZR32 Series 0 

 3  
[CMSIS]  [emlib]  EFM32 and EZR32 Series 0  C 
3.1 
EFM32 and EZR32 Series 0 CMURTCADC...  (CMU) 1  (TIMERn)   (n)   2  USART0  IrDA USART1  
EFM32 and EZR32 Series 0  /   

silabs.com | Building a more connected world.

Rev. 1.21 | 5

AN0009.0: EFM32 and EZR32 Series 0 

3.2 
EFM32 and EZR32 Series 0 / 32  0  31  32   OUTEN   PRSSEL  �  �  �  �  � 

 3.1.  silabs.com | Building a more connected world.

Rev. 1.21 | 6

AN0009.0: EFM32 and EZR32 Series 0 

3.3 
  
 3.1. Register Access Types

Access Type R RW RW1
(R)W1
W1 W RWH RW(nB), RWH(nB), etc.
RW(a), R(a), etc.

Description Read only. Writes are ignored Readable and writable Readable and writable. Only writes to 1 have effect Sometimes readable. Only writes to 1 have effect. Currently only used for IFC registers Read value undefined. Only writes to 1 have effect Write only. Read value undefined. Readable, writable, and updated by hardware "(nB)" suffix indicates that register explicitly does not support peripheral bit set or clear "(a)" suffix indicates that register has actionable reads

3.4 CMSIS  emlib
Cortex  (CMSIS)  ARM Cortex  Silicon Labs  CMSIS   CMSIS  Cortex  
 c  em_device.h  EFM32 and EZR32 Series 0  
EFM32 and EZR32 Series 0 Silicon Labs  [emlib]  C   v1.1  Gecko SDK  e mlib  em_xxx.cem_dac.c  em_xxx.hem_dac.h 
C:\SiliconLabs\SimplicityStudio\v4\developer\sdks\gecko_sdk_suite\v1.1\platform\emlib
 em_chip.h CHIP_Init()   main() em_device.h CHIP_Init()   CHIP_Init() 
3.4.1 CMSIS 
EFM32 and EZR32 Series 0[CMSIS]  [emlib]  Doxygen Simplicity Studio   [Documentation] [Gecko SDK DocumentationGecko SDK ] Silicon Labs  (http://devtools.silabs.com/dl/ documentation/doxygen/)  GitHub (https://siliconlabs.github.io/Gecko_SDK_Doc/) 

silabs.com | Building a more connected world.

Rev. 1.21 | 7

AN0009.0: EFM32 and EZR32 Series 0 

3.4.2 
emlib  
typedef struct { __IO uint32_t CTRL; __I uint32_t STATUS; __IO uint32_t CH0CTRL; __IO uint32_t CH1CTRL; __IO uint32_t IEN; __I uint32_t IF; __O uint32_t IFS; __O uint32_t IFC; __IO uint32_t CH0DATA; __IO uint32_t CH1DATA; __O uint32_t COMBDATA; __IO uint32_t CAL; __IO uint32_t BIASPROG; } DAC_TypeDef;
[emlib]  DAC0   CH0DATA 
DAC0->CH0DATA = 100;

myVariable = DAC0->STATUS;

3.4.3 
 efm32xx_xxx.hefm32tg_dac .h  [emlib] 

#define _DAC_CTRL_REFRSEL_SHIFT #define _DAC_CTRL_REFRSEL_MASK #define _DAC_CTRL_REFRSEL_DEFAULT #define _DAC_CTRL_REFRSEL_8CYCLES #define _DAC_CTRL_REFRSEL_16CYCLES #define _DAC_CTRL_REFRSEL_32CYCLES #define _DAC_CTRL_REFRSEL_64CYCLES #define DAC_CTRL_REFRSEL_DEFAULT #define DAC_CTRL_REFRSEL_8CYCLES #define DAC_CTRL_REFRSEL_16CYCLES #define DAC_CTRL_REFRSEL_32CYCLES #define DAC_CTRL_REFRSEL_64CYCLES

20 0x300000UL 0x00000000UL 0x00000000UL 0x00000001UL 0x00000002UL 0x00000003UL (_DAC_CTRL_REFRSEL_DEFAULT << 20) (_DAC_CTRL_REFRSEL_8CYCLES << 20) (_DAC_CTRL_REFRSEL_16CYCLES << 20) (_DAC_CTRL_REFRSEL_32CYCLES << 20) (_DAC_CTRL_REFRSEL_64CYCLES << 20)



#define DAC_CTRL_DIFF #define _DAC_CTRL_DIFF_SHIFT #define _DAC_CTRL_DIFF_MASK #define _DAC_CTRL_DIFF_DEFAULT #define DAC_CTRL_DIFF_DEFAULT

(0x1UL << 0) 0 0x1UL 0x00000000UL (_DAC_CTRL_DIFF_DEFAULT << 0)

silabs.com | Building a more connected world.

Rev. 1.21 | 8

AN0009.0: EFM32 and EZR32 Series 0 

3.4.4    
DAC0->CTRL = DAC0->CTRL | DAC_CTRL_LPFEN;

DAC0->CTRL |= DAC_CTRL_LPFEN;

DAC0->CTRL = DAC0->CTRL & ~DAC_CTRL_LPFEN; // or DAC0->CTRL &= ~DAC_CTRL_LPFEN;
 OR   
DAC0->CTRL = (DAC0->CTRL & ~_DAC_CTRL_REFRSEL_MASK) | DAC_CTRL_REFRSEL_16CYCLES;
3.4.5   (DOUT)  GPIO  GPIO ABC ...DOUT  GPIO_Px_DOUT  x 

 3.2. GPIO 
CMSIS  P[x]  A=0B=1C=2... C  DOUT 
GPIO->P[2].DOUT = 0x000F;

silabs.com | Building a more connected world.

Rev. 1.21 | 9

AN0009.0: EFM32 and EZR32 Series 0 
 1 -- 
 4   1 -- 
CMSIS /Simplicity Studio  IAR Embedded Workbench  Simplicity Studio  IAR  IDE 
Simplicity Studio 
1.  PC Simplicity Studio  2. [Device]  EFM32 Giant Gecko  (EFM32GG-STK3700) 
 3. [Getting Started] [Application Notes
]  4. [AN0009 Getting Started with EFM32AN0009 EFM32 ] 
[Import Project...]  5.  [<kit_name>_1_registers.slsproj] [OK]  6. 1_registers.c 

IAR 
1. efm32  (an\an0009_efm32_getting_started\iar\efm32.eww) 2. IAR Embedded Workbench  [<kit_name>_1_registers]  3.  1_registers.c 
4.1  1 -- 
TIMER0  RC  (HFRCO)   TIMER0   CMU CMU  HFPERCLKEN0  TIMER0 TIMER0  
4.2  2 -- 
TIMER0  CMD  START  1 
4.3  3 -- 
 1000  while 

silabs.com | Building a more connected world.

Rev. 1.21 | 10

AN0009.0: EFM32 and EZR32 Series 0 
 1 -- 
4.4 
Simplicity IDE  [Project] [<kit_name>_1_registers]  [Debug]  [Registers] TIMER0  STATUS  RUNNING  0 
 [Resume] [Step Over]  1  [Registers]  RUNNING  1  CNT [Registers] CNT  

Resume

Step Over

Build and Debug

Disconnect

Reset

Registers View

Expressions View

Double-click to add a breakpoint
 4.1. Simplicity IDE 
IAR [<kit_name>_1_registers]  [Download & Debug] [View]->[Register ] TIMER0  STATUS RUNNING  0   [Run to Cursor] [Step Into] [Register]  RUNNING  1   [Step Into] CNT  [Register] CNT 

silabs.com | Building a more connected world.

Rev. 1.21 | 11

Reset

Step Into Exit debug

AN0009.0: EFM32 and EZR32 Series 0 
 1 -- 
Download and Debug

Run to cursor

Run

 4.2. IAR 

silabs.com | Building a more connected world.

Rev. 1.21 | 12

AN0009.0: EFM32 and EZR32 Series 0 
 2 -- STK  LED   5   2 -- STK  LED  GPIO  STK  LED  LED  emlib  AN0009  Simplicity Studio  [<kit_name>_2_leds]  IAR efm32  emlib C  C   emlib Simplicity Studio  [Documentation ]  [Gecko SDK DocumentationGecko SDK ]  API   http://devtools.silabs.com/dl/documentation/doxygen/ Giant Gecko  [Modules->EMLIB]  [CMU]   [Functions]  
 5.1. CMU  emlib 

silabs.com | Building a more connected world.

Rev. 1.21 | 13

AN0009.0: EFM32 and EZR32 Series 0 
 2 -- STK  LED 
5.1  1 -- GPIO  CMU GPIO 
void CMU_ClockEnable(CMU_Clock_TypeDef clock, bool enable) [CMU_Clock_TypeDef]  GPIO 
CMU_ClockEnable(cmuClock_GPIO, true);

 5.2. CMU_ClockEnable 
5.2  2 -- LED  GPIO  [Device]  [Solutions]  Simplicity Studio  [Documentation]   LED  EFM32 Series 0  LED   � EFM32-Gxxx-STK: 4 LEDs on port C, pins 0-3 � EFM32TG-STK3300: 1 LED on port D, pin 7 � EFM32GG-STK3700: 2 LEDs on port E, pins 2-3 � EFM32ZG-STK3200: 2 LEDs on port C, pins 10-11  GPIO GPIO 
void GPIO_PinModeSet(GPIO_Port_TypeDef port, unsigned int pin, GPIO_Mode_TypeDef mode, unsigned int out)
LED DOUT  0 

silabs.com | Building a more connected world.

Rev. 1.21 | 14

AN0009.0: EFM32 and EZR32 Series 0 
 2 -- STK  LED 
5.3  3 --  GPIO  STK  0 (PB0)   � EFM32-Gxxx-STK: Port B, pin 9 � EFM32TG-STK3300: Port D, pin 8 � EFM32GG-STK3700: Port B, pin 9 � EFM32ZG-STK3200: Port C, pin 8 
5.4  4 --  LED  PB0  LED  LED  1  PB0  High  
5.5  -- LED  LED / LED LED   HFRCO LED   1  TIMER0 
void Delay(uint16_t milliseconds)
TIMER0_CTRL  PRESC 

silabs.com | Building a more connected world.

Rev. 1.21 | 15

AN0009.0: EFM32 and EZR32 Series 0 
 3a --  LCD 
 6   3a --  LCD 
 LCD  STK  LCD  LCD  LCD AN0009  Simplicity Studio  [<kit_name>_3_lcd]  IAR efm32  
6.1  1 -- LCD 
LCD segmentlcd.h  SegmentLCD_Init()   LCD 
6.2  2 -- LCD 
 LCD LCD  
void SegmentLCD_Number(int value) void SegmentLCD_Write(char *string) void SegmentLCD_Symbol(lcdSymbol s, int on);
 2  

silabs.com | Building a more connected world.

Rev. 1.21 | 16

6.3  3 -- 

AREGA7

Barrel shift right/left AREGA6

AN0009.0: EFM32 and EZR32 Series 0 
 3a --  LCD 
AREGA0

Seg7

Seg6

Seg0

AREGB7

AREGB6

AREGB0

ALOGSEL

Barrel shift right/left

 6.1. 
LCD  8 LCD  8   2  AND  OR2 LCD_AREGALCD_AREGB   LCD  
LCD_BACTRL
� Frame Counter Enable � FCTOP  � Animation Enable � AND  OR  � AREGA  AREGB  � Giant Gecko STK (STK3700) ALOC  SEG8TO15 
LCD_AREGA/LCD_AREGB
� 
LCD 

silabs.com | Building a more connected world.

Rev. 1.21 | 17

AN0009.0: EFM32 and EZR32 Series 0 
 3b --  LCD
 7   3b --  LCD
 LCD  STK Happy GeckoZero GeckoPearl GeckoEFR32xG  STK   LCD  LCD [<kit_name>_3_lcd_mem]  
Gecko SDK  LCD  [Software Documentation]  [Kit Driver]  [Display ] 

 7.1. 
7.1  1 --  DISPLAY_Init()   TEXTDISPLAY  TEXTDISPLAY_New()  TEXTDISPLAY 
7.2  2 --  LCD  TEXTDISPLAY  LCD TEXTDISPLAY_WriteString()  TEXTDISPLAY_WriteCha r() 

silabs.com | Building a more connected world.

Rev. 1.21 | 18

AN0009.0: EFM32 and EZR32 Series 0 
 4 -- 
 8   4 -- 
 (EMx) RTC  RTCC  [<kit_name>_4_energymodes] 
8.1 STK  VMCU   LCD  Simplicity Studio  Energy Profiler  PC 
8.2  1 -- EM1  EM1 SCB_SCR  SLEEPDEEP  CMSIS 
SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; __WFI();
 EMU  emlib  SLEEPDEEP  WFI 
void EMU_EnterEM1()
8.3  2 -- EM2  EM2  WFI SCB_SCR  SLEEPDEEP  EM2 LFRCO  LFXO  emlib  LFRCO 
void CMU_OscillatorEnable(CMU_Osc_Typedef osc, bool enable, bool wait)
 SLEEPDEEP WFI  EM2 
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; __WFI();
EMU  emlib  SLEEPDEEP  WFI 
void EMU_EnterEM2(bool restore)
 emlib   Note:  EM1 EM2  STK 

silabs.com | Building a more connected world.

Rev. 1.21 | 19

AN0009.0: EFM32 and EZR32 Series 0 
 4 -- 
8.4  3 -- EM3  EM3 EM2   emlib  2  LFRCO 
void CMU_OscillatorEnable(CMU_Osc_Typedef osc, bool disable, bool wait)
 SLEEPDEEP WFI  EM3 
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; __WFI();
EMU  emlib  LF SLEEPDEEP WFI 
void EMU_EnterEM3(bool restore)
 emlib   Note:  EM1 EM3  STK 
8.5  4 -- MCU Series 0  (RTC)  EM2 5  (RTC) CMU  emlib RTC RTC /LE   (cmuClock_HFLE)  RTC  emlib 
void RTC_Init(const RTC_Init_TypeDef *init)
 RTC_Init  3  
rtcInit.comp0Top = true;
RTC  0 (COMP0)  COMP0 RTC  32.768 kHz 5 
void RTC_CompareSet(unsigned int comp, uint32_t value)
 RTC COMP0 RTC  
void RTC_IntEnable(uint32_t flags)
 RTC RTC  CortexM  IRQn_Type  RTC_IRQn 
NVIC_EnableIRQ(RTC_IRQn);
RTC  (RTC_IRQHandler)RTC COMP0  Cortex-M   RTC emlib 

silabs.com | Building a more connected world.

Rev. 1.21 | 20

AN0009.0: EFM32 and EZR32 Series 0 
 4 -- 
8.6  -- EM2  LCD 
LCD  LCD EM2  LCD   EM2 
Note:  LCD  RTC  RTCC  LCD   LCD 

silabs.com | Building a more connected world.

Rev. 1.21 | 21

AN0009.0: EFM32 and EZR32 Series 0 

 9  
 GPIO STK  LCD  emlib/CMSIS  Simplicity Studio  [Getting Started ]  [Software Examples]  [Application Notes] 

 9.1. Simplicity Studio 

silabs.com | Building a more connected world.

Rev. 1.21 | 22

 10  

AN0009.0: EFM32 and EZR32 Series 0 


 1.22 2018  1  � EFM32PG13/EFM32JG13  � EFM32TG11 

 1.21
2017  6 
� AN0009  AN0009.0MCU/ MCU  0  AN0009.1MCU/ SoC  1  �  4  RTC  � EFM32PG12EFM32GG11EFR32MG1EFR32MG12 EFR32MG13 

 1.20
2017  1 
� Simplicity Studio V4  � EFM32G  � EFM32PG1 

 1.19 2017  11  � EFM32 Gemstones  EFR32 Wireless Gecko 

 1.18
2014  5 
� CMSIS 3.20.5  �  Silicon Labs  � Simplicity IDE  � Sourcery CodeBench Lite 

 1.17 2013  10  � 

 1.16
2013  10 
�  � Zero Gecko  (EFM32ZG-STK3200)  �  � STK3700  LCD 

 1.15 2013  5  � ARM-GCC  Atollic TrueStudio 

silabs.com | Building a more connected world.

Rev. 1.21 | 23

AN0009.0: EFM32 and EZR32 Series 0 
  1.14 2012  11  � Giant Gecko  (EFM32GG-STK3700)  �  BSP 
 1.13 2012  4  �  CMSIS_V3 
 1.12 2012  3  � efm32lib  efm32_emu.c  LED  � CodeSourcery 
 1.11 2011  10  �  IDE 
 1.10 2011  9  � Tiny Gecko  (EFM32TG-STK3300) 
 1.03 2011  5  �  BSP 
 1.02 2010  11  �  EFM32LIB  c  �  EFM32LIB  PDF 
 1.01 2010  11  � lcdcontroller.c segmentlcd.c / � CMSIS Doxygen  �  src  � chip init  efm32lib 
 1.00 2010  9  � 

silabs.com | Building a more connected world.

Rev. 1.21 | 24

Simplicity Studio
One-click access to MCU and wireless tools, documentation, software, source code libraries & more. Available for Windows, Mac and Linux!

IoT Portfolio www.silabs.com/IoT

SW/HW www.silabs.com/simplicity

Quality www.silabs.com/quality

Support and Community community.silabs.com

Disclaimer Silicon Labs intends to provide customers with the latest, accurate, and in-depth documentation of all peripherals and modules available for system and software implementers using or intending to use the Silicon Labs products. Characterization data, available modules and peripherals, memory sizes and memory addresses refer to each specific device, and "Typical" parameters provided can and do vary in different applications. Application examples described herein are for illustrative purposes only. Silicon Labs reserves the right to make changes without further notice and limitation to product information, specifications, and descriptions herein, and does not give warranties as to the accuracy or completeness of the included information. Silicon Labs shall have no liability for the consequences of use of the information supplied herein. This document does not imply or express copyright licenses granted hereunder to design or fabricate any integrated circuits. The products are not designed or authorized to be used within any Life Support System without the specific written consent of Silicon Labs. A "Life Support System" is any product or system intended to support or sustain life and/or health, which, if it fails, can be reasonably expected to result in significant personal injury or death. Silicon Labs products are not designed or authorized for military applications. Silicon Labs products shall under no circumstances be used in weapons of mass destruction including (but not limited to) nuclear, biological or chemical weapons, or missiles capable of delivering such weapons.
Trademark Information Silicon Laboratories Inc.� , Silicon Laboratories�, Silicon Labs�, SiLabs� and the Silicon Labs logo�, Bluegiga�, Bluegiga Logo�, Clockbuilder�, CMEMS�, DSPLL�, EFM�, EFM32�, EFR, Ember�, Energy Micro, Energy Micro logo and combinations thereof, "the world's most energy friendly microcontrollers", Ember�, EZLink�, EZRadio�, EZRadioPRO�, Gecko�, ISOmodem�, Micrium, Precision32�, ProSLIC�, Simplicity Studio�, SiPHY�, Telegesis, the Telegesis Logo�, USBXpress�, Zentri and others are trademarks or registered trademarks of Silicon Labs. ARM, CORTEX, Cortex-M3 and THUMB are trademarks or registered trademarks of ARM Holdings. Keil is a registered trademark of ARM Limited. All other products or brand names mentioned herein are trademarks of their respective holders.

Silicon Laboratories Inc. 400 West Cesar Chavez Austin, TX 78701 USA
http://www.silabs.com