Where can I find example code for the C8051xxxx MCU?
Example code for Silicon Labs's MCUs is available in two main locations.
The first is the Application Note webpage:
On the Application Note webpage, the example code is organized by topic, such as ADC or UART. Check the beginning of the application note to determine if the application note is applicable to your MCU.
Example code is also part of the Silicon Labs IDE. The Silicon Labs IDE is available for download at:
If the IDE is installed to the default directory, the example code is installed at:
In the Examples directory, the example code is organized by the MCU family. There are over 1000 pieces of example code currently available in this directory.
Where can I find Ethernet examples for Silicon Labs MCUs?
Ethernet examples for the 'F12x and the 'F34x are attached to this article. These are the lowest layer, hardware-level routines intended to be interfaced with a Ethernet stack.
Can we use EFM8 STK on board JLink debugger to program C8051 device?
Yes, this is possible.
The steps as follows:
1. Upgrade the adapter firmware on the EFM8 STK to latest version 0v15p3b761. Two ways to update and verify the adapter firmware:
a. Connect the STK to PC and start Simplicity Studio V4, Select you STK in device view. Clicking on Adapter Firmware Version->Change->Adapter Configuration, that allows you to update the Jlink adapter's firmware. You can see firmware version next to "Adapter Firmware Version" in launcher view.
b. Start the Simplicity Commander and connect Jlink adapter of STK, under the Kit->Update Kit->Installation package, user can select fimrware package by clicking on Browse button, Then click on Install Package button to install it. The firmware version is displayed on the Kit->Kit Information->Firmware version.
2. Connect the VTARGET, C2D, C2CK and GND signals of the Debug Connector on the EFM8 Starter Kit to the target .
3. Make sure target MCU powered up.
4. Change STK Debug Mode to Debug Out. Both Simplicity Studio and Simplicity Commander can do this job.
5. Using Segger JLink tool to program the blinky hex image file to C8051F380 and run the code:
SEGGER J-Link Commander V6.17a (Compiled Jul 10 2017 17:13:16) DLL version V6.17a, compiled Jul 10 2017 17:12:41 Connecting to J-Link via USB...O.K. Firmware: Silicon Labs J-Link OB compiled May 19 2017 10:18:02 Hardware version: V1.00 S/N: 440033288 VTref = 3.250V Type "connect" to establish a target connection, '?' for help J-Link>device C8051F380 J-Link>connect Please specify target interface: C) C2 (Default) TIF> Specify target interface speed [kHz]. : 1000 kHz Speed> Device "C8051F380" selected. Connecting to target via C2 DevID, DerivID: 0x28, 0xD0 Core: CIP-51 (8051 compatible) Device series: C8051F38x series device CPU supports 4 code breakpoints Flash infos: 512 byte sectors, 126 sectors, all sectors unlocked Memory zones: C CODE I IDATA D DDATA X XDATA DSR DSR C2 C2 8051 (EFM8) identified. J-Link>loadfile F38x_Blinky.hex Downloading file [F38x_Blinky.hex]... O.K. J-Link>g J-Link>
Note: The Flash Programmer integrated in the Simplicity Studio has problem to program C8051F380 through the EFM8 STK on-board JLinker debugger. So here we choose Jlink commander tool to program C8051 devices.
Please also check the Segger website to see what C8051Fxxx part was supported by the JLink debugger.
For 8-bit MCU like EFM8UB2, a port pin isavailable on crossbar, do I need to enable crossbar if a port pin work as general purpose GPIO (non peripheral mode)?
For port pin is available on crossbar, if you need to control it's level through the Px.x latch value, you need to enable the crossbar.
Take the EFM8UB2 as example, you could see what port pin was available on crossbar in figure 11.4 on page 83 of the reference manual.
The port I/O cell block diagram shown in figure 11.2 on page 79 of reference manual.From the below diagram, we can know once the crossbar is disabled, the Px.x latch value wont' take effects on port pin.
What is the difference of GPIO structure on Silicon Labs MCU families.
5V tolerance of GPIO pins on Silicon Labs MCU families as followsType A:
Pins are tolerant of the IO power supply voltage plus 2.5V, so they are 5V tolerant with a 3.3V supply. When the pin voltage rises more than 2V above the supply, the leakage currents from the pin to the supply and from the pin to ground will increase with voltage. When the power supply is 0V, the applied pin voltage can be as high as 3.3V at room temperature with moderate leakage; but at that voltage, the leakage can be very high at elevated temperature.
Devices: EFM8UB1, C8051F86x.etc
There is a statement in EFM8LB1 spec that pin leakage current is in the range of [-1.1 4] uA . Does this leakage current affects ADC result of external signal?
Correct, the leakage mainly dominated by the ESD protection circuit for the port structure. It may flow in or out of the device. The leakage current is strongly sensitive to the temperature.
Let us assume 100nA leakage, and output impedance for source signal to be measured is 10k ohm. Then the measurement error caused by the leakage likes an offset error of ADC result. This example gets 100nA*10kOhm = 1mV voltage offset (measured) on the pin.
Under condition that ADC is configured as 2.5V VFS and 12-bit resolution. Then we have 1 LSB equals to be about 2.5V/4096 = 610uV
Then the 10k Ohm resistance of external source signal to be measured would see 1 LSB offset error as 1mV>610uV.
Related KBA: Comparator Input Leakage