Environment Setup on Windows#
This section provides a step-by-step guide to setting up the SDCC compiler on Windows operating systems. It also includes instructions for installing the necessary tools and configuring the environment variables. Additionally, it covers the installation of the pyusb library and updating the driver using Zadig.
Compiler Installation#
Follow these steps to install the necessary tools and files:
Download or Clone the Repository
You can either download the repository as a ZIP file or clone it using Git.
Clone via Git
Install Git for Windows from the official Git website. Then open a command prompt and run:
git clone https://github.com/UNIT-Electronics-MX/unit_ch55x_sdk.git
Download as ZIP
Download the ZIP file from the GitHub repository and extract it to a desired location on your computer.
Install CH372 Driver Download the latest version of the CH372 driver from the CH372 driver website.
Install Python Download and install the latest version of Python from the official Python website.
Install Editor Code Download and install the latest version of your preferred text editor. Some popular choices include Visual Studio Code, Sublime Text, and Notepad++.
Install PlatformIO IDE Download and install the latest version of Platformio IDE from the visual studio code extensions like in the next image:
Fig. 4 Installing PlatformIO IDE#
You can also install PlatformIO IDE from the official Platformio website.
Tip
It is recommended to install the tools in the order listed above.
Caution
Remember to restart your computer after installing the tools.
Alternative Functionality#
WCHISPTool#
The WCHISPTool is an official programming tool provided by WCH. It is a Windows-based tool that allows users to flash firmware onto CH55x microcontrollers. To use the WCHISPTool, follow these steps:
Download the WCHISPTool
Download the WCHISPTool from the official WCH website.
Install the WCHISPTool
Install the WCHISPTool on your Windows computer by following the on-screen instructions.
Connect the Device
Connect your CH55x device to your computer using a USB cable. Ensure that the BOOT button is pressed while connecting the device.
Flash the Program
Open the WCHISPTool and select the appropriate firmware file. Click the “Download” button to flash the program onto the microcontroller.
Note
The WCHISPTool is a Windows-based tool and may not be compatible with other operating systems.
Fig. 5 WCHISPTool interface#
Warning
The WCHISPTool is an official tool provided by WCH and may have limitations compared to other flashing methods.
Note
Requires the ch372 driver to be installed.