8-bit Knowledge Base

      • TestPanel example in USBXpress SDK does not work?

        Jiehui | 11/321/2017 | 05:06 AM


        While running the TestPanel example which included in the USBXpress 4 SDK v4.0.3 on C8051F340 MCU, the device can be enumerated as a USBXpress Device viewing from the Windows Device Manager, however, it failed to start the Host application TestPanel.exe, what would cause the issue as below?



        This is caused by incorrect USBXpress driver version installed on your machine if you are not using the USBXpress driver that is included in the same SDK version.

        To solve the issue, uninstall the existing driver of the USBXpress Device, and then re-install the corresponding driver included in the USBXpress SDK where you are running the USBXpress example.

        For the USBXpress SDK v4.0.3 mentioned above, the driver version is with driver date of 4/8/2013.


      • How to use EFM8 UART Bootloader on Linux

        Jiehui | 10/296/2017 | 02:17 AM

        EFM8 Factory Bootloader AN945SW contains all EFM8 bootloader images with UART, USB or SMBus interface. The source of the efm8load tool, a python script efm8load.py is also included under /Tools/Source folder. Since Python is a cross-platform language, and therefore the script can run on a Linux system.


        However, if run the efm8load.py on Linux directly, it will throw some errors because the current program in hidport.py or smbport.py does not support Linux. It is necessary to make slight modification by loading associated libraries for Linux as below on both scripts


        In hidport.py:


        # Load HID shared library using ctypes
        if sys.platform == 'win32':
            _DLL = ct.windll.LoadLibrary('SLABHIDDevice.dll')
        elif sys.platform == 'darwin':
            _DLL = ct.cdll.LoadLibrary('libSLABHIDDevice.dylib')
        elif sys.platform.startswith('linux'):
            _DLL = ct.cdll.LoadLibrary('./libslabhiddevice.so.1.0')
            raise RuntimeError('HidPort: Unsupported OS')



        In smbport.py:


        # Load HID shared library using ctypes
        if sys.platform == 'win32':
            _DLL = ct.windll.LoadLibrary("SLABHIDtoSMBus.dll")
        elif sys.platform == 'darwin':
            _DLL = ct.cdll.LoadLibrary("libSLABHIDtoSMBus.dylib")
        elif sys.platform.startswith('linux'):
            _DLL_prev = ct.CDLL("./libslabhiddevice.so.1.0", mode=ct.RTLD_GLOBAL)
            _DLL = ct.cdll.LoadLibrary('./libslabhidtosmbus.so.1.0')
            raise RuntimeError("HidSmbus: Unsupported OS")



        These Linux libraries .so.1.0 files can be found in USBXpressHostSDK for Linux, if you have download and installed it, then you can copy-and-paste them into the same folder of the python scripts in AN945SW.


        I have also updated the scripts and provided the Linux libraries in the attachment at the end of this article. With the modification above, you can run the efm8load.py on Linux successfully now. Here take EFM8LB1 STK UART bootloader as an example, the STK JLink CDC serial port appears as /dev/ttyACM0 on Linux. If using with CP210x USB-to-UART bridges, the serial port shows as /dev/ttyUSB0 instead.


        To load the application image into the MCU, firstly let the EFM8 device enter UART bootloader mode, then try the following command with specified serial port:


        sudo python efm8load.py -p /dev/ttyACM0 filename.efm8



      • Cx51 Variable-length Argument List Size

        Jiehui | 10/282/2017 | 04:31 AM


        How to can I change the number of bytes reserved for function with a variable-length argument list when using 8-bit MCUs with Cx51?


        By default, the C51 compiler reserves 15 bytes for passing arguments to functions with variable-length argument list for SMALL and COMPACT memory model, and 40 bytes for LARGER memory model.


        User can use the MAXARGS(n) compiler directive to change the number of bytes reserved.


        To do this in Simplicity IDE, here as an example, if 24 bytes is required for the variable-length argument list, you can use the MAXARGS(24) for the Keil 8051 Compiler setting as the picture below showing, and then re-build the project again.




        For more information on Cx51 Variable Length Argument Routines, please click here.


      • 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.



      • SMBus/I2C Slave Spikes Suppression

        Jiehui | 07/208/2017 | 10:41 PM


        What is the maximum value of the pulse width of spikes for Silicon Labs 8051 MCU SMBus/I2C slave?


        For SMBus interface, our 8051 devices have a 2-SYSCLK glitch filter for all digital inputs. The pin needs to be at the new level for at least 2 SYSCLKs before it’s seen internally. Therefore, if there are 50 ns spikes on the SMBus SCL or SDA line, the system clock would need to be no greater than 40 MHz.


        Unlike SMBus, the I2C Slave (I2CSLAVE0) interface input filter does not depend on system clock, it can suppress noise spikes up to 50 ns in Standard (up to 100 kbps), Fast (400 kbps) or Fast Plus (1 Mbps) mode.

      • Thermal Resistance Theta JA for C8051F930

        Jiehui | 07/187/2017 | 03:29 AM
        Part Number Package Theta JA
        C8051F930-GM QFN-32 24 °C/W
        C8051F930-GQ LQFP-32 52 °C/W


        More data on Theta JA for different device packages:

        Thermal Performance Data

      • Macro Stringize Operator (#)

        Jiehui | 02/37/2017 | 01:17 AM

        The '#' may be used within a macro (#define) definition, this will convert the macro parameter into a string constant that is stored in Code space. Note that this operator may be used only in a macro that has a specified argument or parameter list.


        Here is an example for Keil C51. User should get similar result on ARM Cortex M devices with GNU ARM toolchain.


      • How to use the JLink CDC UART Port on EFM32/EFM8 STK?

        Jiehui | 12/343/2016 | 12:40 AM


        How to use the JLink CDC UART Port on EFM32/EFM8 STK?


        EFM32 or EFM8 STK board provides a virtual COM port which is implemented by the Board Controller (BC) via the USB Mini-B connector on the Starter kit.


        The JLink CDC UART Port TX/RX pins can be connected to the on-board EFM32 or EFM8 MCU UART pins depending on the EFM_BC_EN signal which is controlled by the target MCU. 



        The BC enable signal connects the EFM32/8 MCU to the board controller:
        • 0: EFM32/8 UART pins are isolated from the Board Controller.
        • 1: EFM832/8 UART pins are connected to the Board Controller (default upon reset).


        Please refer to target starter kit User Manual for more information on the pins connection.


        Note: If need to use the MCU UART to connect to other serial port device instead of the JLink CDC port, ensure the BC enable signal is set to proper value.


        Therefore, user can use the target MCU UART interface to communicate directly with USB host through the CDC UART Port. The default serial port setting is 115200 baud rate and 8-N-1.


        Here is the device viewing from Windows Device Manager when connecting the STK board to PC using a USB cable.



      • What happened if the RX FIFO of EFM8LB1 I2C Slave overruns?

        Jiehui | 10/304/2016 | 11:24 PM


         What happened if the RX FIFO of EFM8LB1 I2C Slave overruns?


        EFM8LB1 I2C Slave peripheral includes two separate 2-byte FIFOs on transmit and receive. When the RX FIFO is full during I2C write transfer, only the first two bytes will be stored in the RX FIFO. The first two bytes can be (Slave Address + Data Byte 0) if ADDRCHK bit is set to 1, or (Data Byte 0 + Data Byte 1) when ADDRCHK bit is 0. The reset of the bytes are thrown away. Therefore, it is responsibility of software to clear the FIFO before it overruns.

      • EFM8LB1 I2C Slave TX/RX FIFOs

        Jiehui | 10/304/2016 | 11:19 PM


        Are the EFM8LB1 I2C slave TX/RX FIFO and Shift register shared or separate?


        There are 2 separate two-byte FIFOs for RX and TX paths.

        The shift register for I2C Write and Read transfer is also separate.