Is it possible to "brick" a Silicon Labs 8-bit MCU? That is, is it possible to put the device into a state where it is unrecoverable, unable to be modified, or connected to with a debug adapter?
Yes, there are several ways in which this can happen. The primary cause is a lack of time for the debug adapter to access the device between reset and the device becoming unresponsive. The debug adapter will need a small amount of time where the device is responsive after reset in order to connect, so performing some action which halts the device immediately after reset can cause a device to become unrecoverable.
Primary means of performing this are:
* Switching to a non-functioning clock
* Going into a low power mode
* Issuing a reset
In order to avoid this problem, it is advised to add a small (1 ms) delay at the beginning of user firmware, before any other code begins executing. This should allow plenty of time for the debug adapter to connect to the device and halt it before the device can disable itself. This delay can be removed from tested and production-ready code.
Note that when using the J-Link adapter on the EFM8 STK to debug a device, a much longer (200 ms) delay is required.
An alternative approach to a fixed delay is to add a trap at the beginning (though after the watchdog disable) that checks if a GPIO pin is held low. If it's high, it continues through without a pause. However, it it's low, it polls forever. Something to the effect of:
while (GPIO == 0);
This ensures that if you download code that would normally render the device inoperable, you can always hold a pin low to trap the core and get access again.
Do the JTAG devices in the C8051F12x, C8051F04x, or C8051F02x family require a 10 MOhm external feedback resistor for their external crystal oscillator circuits? The datasheets for these devices list a circuit with both the resistor included and excluded.
These devices have an internal 10 MOhm feedback resistor and thus do not require an external one. On later devices (C8051F3xx and later), this external resistor is required.
How do 8-bit MCUs handle a Start + Stop + Address bus condition? Normally, a master should send a Start condition, then immediately followed by address - will the device NAK an address if a Stop comes between the Start and the Address?
This is an undefined condition on the I2C bus, so there is no correct way to respond to it. Our 8-bit MCUs will ACK this address, as if it were received without the Stop condition. Waveforms that display this condition are as follows:
Figure 1. Normal I2C Transaction
This figure shows a normal transaction - a Start condition immediately followed by an address.
Figure 2. Start + Stop + Address
This figure shows the behavior of the 8-bit device receiving a Start + Stop + Address. Here, you can see that the device will still ACK the address, even after receiving a Stop condition.
Since this behavior is undefined in the I2C specification, this is not technically incorrect behavior. However, if you would like the Stop condition to be registered by the device, it is possible to implement this in software. Attached to this article is an example that uses port-match to track stop conditions on the C8051F390. The resulting device response is below:
What is the source of the offset error on the ADC?
The offset error is caused by slight process variations in the fabrication of the analog transistors in the ADC. These variations will result is a steady state offset in the output of the ADC measurements because the input signal path, and the reference signal path are not identical. For more information on the architecture of the ADC used, please see the article in the link below:
Is there any additional latency, compared to other interrupts, between an external interrupt pin triggering and the associated interrupt handler being called?
Yes. External interrupts incur an additional four clock cycles of latency. This is due to de-glitching and synchronization flops on the external interrupt pin. This means that, generally speaking, a normal interrupt will have a minimum of 12 clock cycles before reaching the interrupt handler, while external interrupts will take a minimum of 16 clock cycles.
1. In Simplicity Studio, File > New > Silicon Labs MCU Project
2. I suggest choosing an SDK, so you don't have to manual include this the include/header files into your project. Include/header files are part of the SDK.
3. For project type, choose Empty C project (even though you will code in assembly).
4. Link to sources vs Link libraries and copy sources vs Copy contents vs In-place
These options are relevant when using an existing example. The existing examples resides in the SDK directory. This eclipse-base IDE has local "workspace" directory, where you can choose to import a copy of the source code, so you don't edit the original example in the SDK path.
Link to sources = Create IDE project files (.project and .cproject) in workspace. Don't make a copy of the source in the workspace. Any edits you make will the edit the source files in SDK path.
Link libraries and copy sources = Create IDE project files (.project and .cproject) in workspace. Do not make a copy of the library files in the workspace. Make a copy of the source files in the workspace. Any edits to the source files will take place locally in the workspace.
Copy contents = Create IDE project files (.project and .cproject) in workspace. Make a copy of the library and source files in the workspace. Any edits you make will the edit the source files locally in the workspace.
In-place = Create IDE project files (.project and .cproject) where the source files are located (not in the workspace). All source files not copied into workspace.
TIP: In the project explorer window, anytime a folder/file is linked, you will see a shortcut arrow icon (just like shortcut in Windows) next to the folder.
When creating an empty project, you typically keep your source files in your workspace. Therefore, we suggest "Link libraries and copy sources".
5. In Build Configuration, only check Keil.
6. After clicking Finish, you should see a project with a .c and .A51 extension. You can delete those (from your file system) since they are not needed when coding in assembly.
7. Create a new file with .asm extension, and build. If you selected EFM8SB1 as the part in step 1, attached is a blinky example written in assembly (SB1_blinky.asm) for testing purposes.
TIP: when you start a debug session with an assembly project, the IDE will not halt the MCU. In the Debug window, click the .omf file, then you can halt execution using Run > Suspsend (or click the pause button).
Is it possible to slow the C2 clock frequency while debugging C8051 devices?
Yes, but only in the 8-bit Silicon Labs IDE. To access this feature, press the key combo CTRL+ALT+S. After pressing this combination, a new button will appear in the Connection Options window near the bottom - "C2 Clock Strobe Configuration". You can use this to lower the C2CK frequency.