8-bit Knowledge Base

    Publish
     
      • How to use Flash Utility Command-line Tool for Multi-Device JTAG Chain Programming

        Jiehui | 08/235/2017 | 12:35 AM

        AN134 describes the Multiple-Device JTAG Chain configuration in the legacy Silicon Labs IDE.

         

        Here is an example on how to use the Flash Utility command-line tool for Multi-Device JTAG programming using Silicon Labs USB Debug Adapter (UDA). For more details on these commands, Please refer to the readme.txt included in the command-line tool.

         

         Multi-JTAG.png

      • Programming the CPT112S and CPT007B

        delu | 08/214/2017 | 02:26 AM

        Question

        Programming the CPT112S and CPT007B

        Answer

        The device ID for CPT007B is 0x25 and the derivative ID is 0x40. The device ID for CPT112S is 0x25 and the derivative ID is 0x50.

         

        You could get this device information with the inspect command device8051.exe tool like below. The commander tool was located in folder like C:\SiliconLabs\SimplicityStudio\v4\developer\adapter_packs\inspect_c8051

         

        C:\SiliconLabs\SimplicityStudio\v4\developer\adapter_packs\inspect_c8051>device8051.exe -slist

         

        deviceCount = 1
        device (TS004A5562) {
          adapterLabel = ToolStick
          SerialNo = TS004A5562
          targetInterface = c2
          Name = CPT112S
          Type = MCU
          Family = 8051
          HardwareID = 0x25
          DerivativeID = 0x50
          HardwareRev = 0x2
          DerivativeRev = 0xa
          Unsupported = 0
          Indeterminate = 0
          Connected = 0
          Locked = 0
        }
        
         


          Then you could use the  xPress configuration tool to generate the configuration hex file and flash8051.exe to program the CPT112S by below steps:

         

        1. Open command line here - C:\SiliconLabs\SimplicityStudio\v4\developer\adapter_packs\c8051\
        2. Make a note of the Toolstick number through Simplicity Studio, In my case, it was TS004A566A
        3. Set the desired configuration for the CPT112S board in Xpress Configurator and generate the hex file
        4. Make a note of where the hex file is located, in my case, it was C:\Users\marao\SimplicityStudio\v4_workspace\cpt112s_a01_gm\cpt112s_a01_gm.hex
        5. In the cmd line tool, enter the following command

          flash8051.exe -sn TS004A566A -tif c2 -upload cpt112s_a01_gm.hex -erasemode page

      • Convert several capsense nodes result to slider position

        delu | 08/214/2017 | 02:26 AM

        Question

        I have used the capsense library, the slider was composed of several sensors. do you have any suggestion how to convert the sensor data to slider position?

        Answer

        You could refer to our example CapsenseCircleSlider for EFM8SB1 device. You could get the example code in folder like below for default installation:

        C:\SiliconLabs\SimplicityStudio\v4\developer\sdks\8051\v4.0.3\examples\EFM8SB1_SLSTK2010A

         

        The example use centroid algorithm to interpolate the 3 nodes data to get the slider position. The bin for the 3 sensors was [20, 40, 60]. the weight 40 was for the sensor with max value captured.

         

        Let us assume the sensor value for the 3 sensors was x, y and z. Then 

        centroid = (x * 20 + y * 40 + z * 60) / (x + y + z)

        This would give a result with range [30 50].

        The max value 50 was getten when y equals z.

        The min result 30 was getten when y equals x.

         

        You should choose suitable bin parameter based on your sensor layout and target slider range.

         

         

         

      • Use 2.4V reference to measure the temperature for EFM8LB1

        delu | 08/214/2017 | 02:22 AM

        Question

        The EFM8LB1_TempSensor_WithCompensation example for EFM8LB1 use the internal 1.65V reference to measure the temperature, could I change the 1.65V internal reference to 2.4V internal pin reference (or other) as ADC reference voltage? 

        If the answer is yes, what factors I should take into consideration when I change the internal reference voltage for the ADC.

        Answer

        Basically the answer is yes because the temperature sensor would convert the die temperature to a voltage, any voltage reference for the ADC could be used to measure the voltage converted by the temperature sensor. 

         

        In the example (refer to file EFM8LB1_TempSensor_WithCompensation.c) we use below formula to convert ADC code to die temperature:
        temp_scaled = ((ADC_AVG - tempsensor_0c)*SCALE) / constant;

        Where:

        constant equals 28.

        tempsensor_0c was a one-point calibration value read from flash.

         

        The key point here is that tempsensor_0c (read from flash) and constant 28 was gotten when ADC was configured to use 1.65V voltage reference and 14-bit mode.

        In fact the constant 28 was gotten with below idea:
        For 14 bit ADC, resolution is 2^14= 16384
        temperature slope = 2.8mV/degC (Table 4.11 of datasheet)
        1.65V full range = 1650mV
        Then 2^14*2.82/1650=28.001745
        This mean when ADC was configured to use 1.65V voltage reference and 14-bit mode, 1 degC temperature change will cause 28 (decimal) ADC code change.

        The tempsensor_0c that read from flash was also gotten when ADC was configured to use 1.65V voltage reference and 14-bit mode. This means that under controlled die temperature (0 degC), use 1.65V internal reference and 14-bit mode, we get a ADC output code as tempsensor_0c.

         

        So if you want to change the ADC reference voltage or bit mode, you should either:

        1. scale the ADC code (get with new reference voltage and bit mode) to a code that you would get with 1.65V and 14-mode.

        2. scale tempsensor_0c and constant 28 in the formula above to suit for the new voltage reference and bit mode.

        Both should work fine.

         

        Let me assume you are taking the option 2 and use 2.4V reference voltage (still 14-bit mode), then you could get:

        tempsensor_0c_after = (tempsensor_0c_flash * 1650 / 2400)

        constant_after = 28 * 1650 / 2400 = 19.25

         

        Then the final formula to get the temperature would be:
        temp_scaled = ((ADC_AVG - tempsensor_0c_after)*SCALE) / 19.25;

         

        Related KBA: Why does the EFM8LB1 temperature sensor calibration use the 1.65 V internal voltage reference?

      • Some changes made on new EFM8 devices

        delu | 08/214/2017 | 02:18 AM

        Question

        I did not see VDD ramp up time requirement for some EFM8 device in the datasheet, do you made some change.

        Could you summarize some changes for these new EFM8 devices?

        Answer

        The VDD ramp up time limitation was removed for EFM8UB1/EFM8LB/EFMBB1/EFMBB2 /EFMBB3/C8051F85x. But the delay time was prolonged. EFM8UB2/EFM8SB1/EFM8SB2 still need VDD ramp up to a specific level within specific time. You could see the detailed requirement in the datasheet.

         

        The watchdog peripheral was also changed. EFM8UB1/EFM8LB/EFMBB1/EFMBB2 /EFMBB3/C8051F85x use a separate watchdog peripheral and the initial timeout period was prolonged. You may not encounter the issue listed in this KB for these devices.

         

        For EFM8SB1/EFM8UB1/EFM8LB/EFMBB1/EFMBB2 /EFMBB3/C8051F85x device, DEVICEID/DERIVID was added as SFR register and firmware could access them. For old 8-bit MCU like EFM8UB2/EFM8SB2 these information could only be accessed by C2 interface.

         

        UUID was also added for EFM8LB1/EFM8BB2/EFM8BB3/EFM8UB1 devices. The UUID resides in the read-only area of flash memory, which cannot be erased or written by the end application. The UUID can be read by firmware or through the debug interface at flash locations 0xFFC0-0xFFCF.

         

         

      • Does Simplicity Commander support EFM8 programming

        delu | 08/214/2017 | 02:17 AM

        Question

        Does Simplicity Commander support EFM8 device programming?

        Answer

        Currently the Simpliicity Commander only support programming 32-bit EFM32/EZR32/EFR32 device with SWD interface. It could not be used to program the 8-bit MCU with C2 interface.

        The standalone Simplicity Commander could be downloaded here.

         

        To program the EFM8 device (with J-Link) you may try the command line tool flashefm8.exe that located in the folder like C:\SiliconLabs\SimplicityStudio\v4\developer\adapter_packs\efm8

        Take the EFM8SB1 STK as example to program the on-board part you could use command:

        flashefm8.exe -sn 000440082481 -tif c2 -part efm8sb10f8g -upload EFM8SB1_Blinky.hex -erasemode page

         

        To program the c8051fxxx device (with UDA) you may try the command line tool flashc8051.exe that was located in the folder like C:\SiliconLabs\SimplicityStudio\v4\developer\adapter_packs\c8051

        Take the C8051F380 DK as example to program the on-board part you could use command:

        flash8051.exe -sn ec3003bb7e8 -tif c2 -part C8051F380 -upload f38x_Blinky.hex -erasemode page

         

         

      • Pin-1 identifier options for EFM8SB1 QFN24 package

        delu | 08/214/2017 | 02:15 AM

        Question

        Based on the datasheet, there are different options for pin-1 identifier, what part number should I order if I want a specific option.

        Answer

        You could get 2 options (irregular corner or irregular edge) in Figure 8.1 on page 50 of the datasheet as below:

         

        Pin-1.png

        The variability of the Pin-1 Identifier is a reality that the manufacturing flow of this product may come from multiple package vendors. Each of these vendors may implement slightly different Pin-1 Identifiers. 

        The part number could not distinguish this options. You may receive part with any option.

      • How to use EFM32 Starter Kit on-board debugger to debug an external EFM8 device

        delu | 08/214/2017 | 02:14 AM

        Question

        I saw an article that state we could use the EFM8 STK on-board debugger to debug an external EFM8 device, I have an EFM32 STK rather than EFM8 STK, could I use this STK to debug/program an external EFM8 device?

        Answer

        Yes, this is possible, basically there is no difference for the on-board J-Link debugger between the EFM8 and EFM32 STK. You could use the EFM32 STK on-board debugger to debug/program the EFM8 device. It was also ok to use the EFM8 STK on-board debugger to debug/program the EFM32 device.

        Please follow the How to use EFM8 Starter Kit on-board debugger to debug an external EFM8 device and Using an EFM32 Starter Kit as an external debugger to use the EFM32/EFM8 on-board J-Link to program/debug and external EFM32/EFM8 device.