Figure 32.1 on page 757 of the EFM32LG Reference Manual states "There is no ESD diode to Vdd because if using LCD voltage boost the pin voltage will be higher than Vdd. Nevertheless there is an ESD protection block against over voltage."
What is this ESD protection block, and is it present on EFM32LG devices without an LCD controller?
Answer
The ESD structure that connects the I/O pad to IOVDD is indeed not a simple diode, but is rather a PMOS structure. This is present on the pad whether the device has an LCD controller (and thus the LCD voltage boost feature) or not.
On devices with the LCD voltage boost, an over voltage-tolerant circuit biases the PMOS transistor in the ESD structure to raise the threshold voltage of the ESD diode when the pin voltage exceeds VDD. In general, however, voltage on the I/O pins should be limited to the datasheet maximum values of VDD+0.3, and the maximum VDD voltage of 3.8V should be observed. If the I/O pin voltage exceeds VDD+0.3V, conduction will occur between the pin pad and the VDD rail due to the ESD structure. Please note that this condition is for ESD protection and extended exposure of the pin to voltage in excess of VDD+0.3V can cause permanent damage to the device.
How can I measure temperature using the internal ADC temperature sensor?
Answer
The "Temperature Measurement" subsection of the ADC chapter in the reference manual contains an expression for this temperature result (TCELSIUS) in terms of the following parameters:
CAL_TEMP - available in the Device Information (DI) Page, see "DI Page Entry Map" section in Reference Manual for more information
ADC0CAL3_TEMPREAD1V25 - also available in DI page
V_TS_SLOPE - available in the device Datasheet
VFS - specified as 1.25V (1250mV) in the provided expression
ADC_result - ADC measurement at 1.25V VFS option and 12-bit resolution
The "inttemp" example for the EFM32 Pearl Gecko (available in-full within Simplicity Studio) demonstrates in ConvertToCelsius() how this technique is implemented using the DI contents on the Pearl Gecko and the formula provided in section 22.3.8.9 "Temperature Measurement" of the Pearl Gecko Reference Manual. Though the variable names are slightly different, this is an identical procedure to that given in section 23.3.4.1 "Temperature Measurement" of the EFR32BG1 Reference Manual.
/**************************************************************************//**
* @brief Convert ADC sample values to celsius.
* @detail See section 25.3.4.1 in the reference manual for detail on
* temperature measurement and conversion.
* @param adcSample Raw value from ADC to be converted to celsius
* @return The temperature in degrees celsius.
*****************************************************************************/
static float ConvertToCelsius(int32_t adcSample)
{
uint32_t calTemp0;
uint32_t calValue0;
int32_t readDiff;
float temp;
/* Factory calibration temperature from device information page. */
calTemp0 = ((DEVINFO->CAL & _DEVINFO_CAL_TEMP_MASK)
>> _DEVINFO_CAL_TEMP_SHIFT);
calValue0 = ((DEVINFO->ADC0CAL3
/* _DEVINFO_ADC0CAL3_TEMPREAD1V25_MASK is not correct in
current CMSIS. This is a 12-bit value, not 16-bit. */
& 0xFFF0)
>> _DEVINFO_ADC0CAL3_TEMPREAD1V25_SHIFT);
if ((calTemp0 == 0xFF) || (calValue0 == 0xFFF))
{
/* The temperature sensor is not calibrated */
return -100.0;
}
/* Vref = 1250mV
TGRAD_ADCTH = 1.835 mV/degC (from datasheet)
*/
readDiff = calValue0 - adcSample;
temp = ((float)readDiff * 1250);
temp /= (4096 * -1.835);
/* Calculate offset from calibration temperature */
temp = (float)calTemp0 - temp;
return temp;
}
The Pearl Gecko reference manual states for Power Configuration 2 (DC-DC) of the EMU chapter: "IOVDD could be connected to either the main supply (as shown below) or to VDCDC, depending on the system IO requirements." If I connect IOVDD to VDCDC, will a pin reset still wake the device from EM4 Shutoff (EM4S)? This seems unlikely, since the DC-DC is not available in EM4S so VDCDC will be unpowered.
Answer
The integrated DC-DC on EFM32 Pearl Gecko is indeed unavailable while in EM4S. However, VDCDC is still powered while in EM4 Shutoff. In your example, IOVDD will also then be powered in EM4S, so a pin RESET is still detectable.
This result arises from the fact that in EM4 Shutoff, the DC-DC converter configuration is reset to its default Startup configuration (DC-DC converter disabled, bypass switch is on), in which the VREGVDD input voltage is directly shorted to the DC-DC converter output through an internal switch. Consult the datasheet for more information on the Bypass switch impedance specification.
From Tables 4.5 ("Current Consumption 3.3V without DC/DC"), 4.6 ("Current Consumption 3.3V with DC-DC"), and 4.4 ("Current Consumption 1.85V without DC/DC") of the EFM32PG1 datasheet, it seems that the current consumption is less when using a 3.3V supply and the internal DC DC converter, than when using a much smaller 1.85V supply and disabling the internal DC DC converter. This makes no sense to me - is it a datasheet error?
Answer
This observation regarding the datasheet current consumption specifications is common, but the specs are indeed correct. Often, the missing key consideration is that though these tables depict current consumption, actual power consumption (dissipation) is a function of both the current consumed and the applied voltage.
For example, the current consumption values in the "1.85V w/out DC-DC" table, when multiplied by 1.85V, yield lower power consumption than the smaller values in the "3.3V with DC-DC" table multiplied by a larger 3.3V supply. Power consumption is even higher in the 3.3V system that does not use the DC-DC.
I am able to put the device in bootloader mode by pulling SWCLK high and then pulling RESET low. However, the chip ID message does not immediately appear. What's going on?
Answer
The chip ID indeed does not appear immediately. You should send one upper case 'U' (0x55) for the autobaud command, and then the ID will appear. See AN0003 section 1.2 for more information. Application Notes can be found on the Silicon Labs website: www.silabs.com/32bit-appnotes.
How to place the flash erase/write functions in em_msc.c into Flash?
Answer
By default, all flash erase/write functions in em_msc.c are located in RAM. In order to save RAM space, these functions can relocated to flash by defining the EM_MSC_RUN_FROM_FLASH symbol in corresponding the IDE.
Note:
This method does not apply to EFM32 Gecko (EFM32G) devices.
During a write or erase, flash read accesses will be stalled, effectively halting code execution from flash. Code execution continues upon write/erase completion. Code residing in RAM may be executed during a write/erase operation.
The IFC Read-Clear Operation is a new feature in EFM32 Gecko Series 1 and EFR32 Wireless Gecko Series 1 devices.
In addition to the normal interrupt setting and clearing operations via the IFS/IFC registers, there is an additional atomic Read-Clear operation that can be enabled by setting IFCREADCLEAR = 1 in the MSC_CTRL register.
When enabled, reads of peripheral IFC registers will return the interrupt vector (mirroring the IF register), while at the same time clearing whichever interrupt flags are set. This operation is functionally equivalent to reading the IF register and then writing the result immediately back to the IFC register.
Are there any tools or firmware libraries that can be used to create embedded graphical user interfaces (GUIs) for LCD or other embedded displays using EFM32 MCUs?
Answer
For development of embedded projects requiring a display element, Silicon Labs provides what is called the Display Device Driver Stack, which is basically an abstraction layer for driving different kinds of displays. This is what is used to generate the graphics for the Space Invaders demo, and is a good starting point for generating a simple embedded GUI. This library and API is documented in the Gecko SDK and it is used in a number of examples, including the Space Invaders example. Please note that Space Invader and all the other demos can be opened as example projects in Simplicity Studio and used as templates to illustrate how the display API is used, what files are needed, how it is configured/customized, etc. Here is a link to the Gecko SDK page that discusses this module:
In addition to the Silicon Labs Display Device Driver Stack, Simplicity Studio offers its customers the use of the embedded GUI library emWin by SEGGER. For more information on integrating emWin into an embedded project, please see AN0047: Interfacing Graphical Displays:
To add the emWin module to a project, open the Project Properties window by clicking [Project]>[Properties] in the Simplicity Studio IDE perspective. Then expand [C/C++ Build]>[Project Modules] and in the window to the right expand [efm32]>[reptile] and select [emWin]. This is illustrated in the following screenshot. Please refer to the software examples available with AN0047 as a guide for getting started with emWin.
32-bit Knowledge Base
ESD protection on EFM32LG GPIO pins
EFR32 ADC Internal Temperature Sensor
Does pin RESET wake EFM32PG from EM4S mode if IOVDD is powered by the DC-DC regulator?
DC-DC Current Consumption vs. Power Consumption
AN0003 UART Bootloader - Chip ID does not appear immediately
EFR32MG Temperature Sensor Transfer Function
Placing the flash erase/write functions in em_msc.c into Flash
IFC Read-Clear Operation
Tools for Creating an Embedded GUI with EFM32
Using a pin in a 4-pin LCD group for non-LCD functionality