Difference between revisions of "CH55X SDK"

From ElectroDragon
Jump to navigation Jump to search
(Official SDK Examples)
(Git and other Examples)
 
(14 intermediate revisions by the same user not shown)
Line 11: Line 11:
 
=== Limits ===
 
=== Limits ===
 
* The IC only can be flashed up to 200 times, please notice this.
 
* The IC only can be flashed up to 200 times, please notice this.
 
+
=== Details ===
 +
* Default baudrate 57600
 +
* Internal clock, 12M
 
=== CH55x MCU Type Programming Guide ===
 
=== CH55x MCU Type Programming Guide ===
  
Line 25: Line 27:
 
* Short connect PROG (or P3.6/UD_P ) to 3.3V, plug in USB to power up to enter into download mode.
 
* Short connect PROG (or P3.6/UD_P ) to 3.3V, plug in USB to power up to enter into download mode.
  
== Official SDK Examples ==
+
== SDK ==
 +
=== Official SDK Examples ===
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
 
|-
 
|-
Line 62: Line 65:
 
| 16 || Compound_Dev.rar || CH554 ||  || CH554 模拟HID兼容和键盘复合设备,上电自动弹出指定目录下的EXE软件,通过软件可以查看HID兼容设备中断IN端点数据和统计,并且支持TouchKey(触摸按键)检测上传数据。
 
| 16 || Compound_Dev.rar || CH554 ||  || CH554 模拟HID兼容和键盘复合设备,上电自动弹出指定目录下的EXE软件,通过软件可以查看HID兼容设备中断IN端点数据和统计,并且支持TouchKey(触摸按键)检测上传数据。
 
|-
 
|-
| 17 || S_CDC.rar || CH554|| CDC, not working || CH554模拟CDC类,PC免驱,可以实现快速批量上下传。
+
| 17 || S_CDC.rar || CH554|| upload & download, USB <=> Serial Dual way transfer || CH554模拟CDC类,PC免驱,可以实现快速批量上下传。
 
|-
 
|-
 
| 18 || 554_udisk(可以做数据传输用).rar || CH554||  || CH554模拟U盘,无存储介质,需要根据应用添加合适的存储介质。
 
| 18 || 554_udisk(可以做数据传输用).rar || CH554||  || CH554模拟U盘,无存储介质,需要根据应用添加合适的存储介质。
Line 68: Line 71:
 
| 19  || 模拟341.rar || CH554||  || CH554模拟CH340,CH341.
 
| 19  || 模拟341.rar || CH554||  || CH554模拟CH340,CH341.
 
|-
 
|-
| 20  || CH554串口接收数据转USB键值上传.rar || CH554|| || CH554标准单一接口USB键盘,串口接收数据转换成键值上传,如串口发送‘a’,上传至文本显示‘a’,支持多字节同时发送.
+
| 20  || CH554串口接收数据转USB键值上传.rar || CH554|| upload || CH554标准单一接口USB键盘,串口接收数据转换成键值上传,如串口发送‘a’,上传至文本显示‘a’,支持多字节同时发送.
 
|-
 
|-
 
| 21  || CH559操作扫马枪直接字符输出.rar || CH559||  || CH559操作扫码枪,直接字符输出或者源码输出。
 
| 21  || CH559操作扫马枪直接字符输出.rar || CH559||  || CH559操作扫码枪,直接字符输出或者源码输出。
Line 76: Line 79:
 
| 23 || ch554_uart_2_uart.rar || CH554 ||  || CH554操作CH340、CP2102、PL2303实现数据在CH554的串口0到CH340等芯片串口引脚的双向透传,支持波特率配置、参数掉电自动保存等功能。
 
| 23 || ch554_uart_2_uart.rar || CH554 ||  || CH554操作CH340、CP2102、PL2303实现数据在CH554的串口0到CH340等芯片串口引脚的双向透传,支持波特率配置、参数掉电自动保存等功能。
 
|}
 
|}
 +
==== Examples Demo ====
 +
<gallery>
 +
File:Ch554-eg16.1.png | EG16.1
 +
File:Ch554-eg16.2.png | EG16.2
 +
File:Ch554-eg17-CDC_serial_demo.png | EG17 serial <> USB
 +
File:Ch554-eg20.png | EG20 Upload UART input
 +
</gallery>
  
== Demo ==
+
=== EVT Demo ===
CompatibilityHID
+
{| class="wikitable sortable"
* USB Input Device
+
|-
 +
! Header text !! Header text !! Header text
 +
|-
 +
| CompatibilityHID || Example ||
 +
* USB Input Device (HID)
 
* USB\VID_5131&PID_2007&REV_0000
 
* USB\VID_5131&PID_2007&REV_0000
  
 +
|-
 +
| CompositeKM || CH559模拟USB复合设备,键鼠,支持类命令,支持唤醒 || -
 +
|-
 +
| VendorDefinedDev || Example ||
 +
* Simulate USB Module(CH554) CH372
 +
* Can use CH372 debug tool to test
 +
|}
 +
==== Demo Example ====
 +
* 01/CompatibilityHID: HID serial data up to USB
 +
* 02/CompositeKM: "simulate" data in key and mouse via EP1 and EP1 into USB
 +
* 03/VendorDefinedDev
 
<gallery>
 
<gallery>
</gallery>
+
File:Ch554-CompatibilityHID.png | 01 CompatibilityHID 01
CompositeKM
+
File:Ch554-CompatibilityHID-2.png | 01 CompatibilityHID 02, USB hound read
<gallery>
+
File:Ch554-CompatibilityHID-3.png | 01 CompatibilityHID 03, USBbox read
</gallery>
+
File:Ch554-CompositeKM.png | 02 CompositeKM key received
VendorDefinedDev - Simulate USB Module(CH554)
+
File:VendorDefinedDev01.png | 03 VendorDefinedDev recorgnize  
<gallery>
+
File:CH554-VendorDefinedDev.png | 03 VendorDefinedDev test 02
File:VendorDefinedDev01.png | recorgnize  
+
 
 
</gallery>
 
</gallery>
  
 
== Git and other Examples ==
 
== Git and other Examples ==
 
Code
 
Code
* Demo code or from WCH MCU webpage - https://bitbucket.org/e_dragon/wch/src/master/
+
* Demo code git - https://bitbucket.org/e_dragon/wch_ch55x/src/master/
* CN here - http://www.wch.cn/bbs/thread-65023-1.html
+
* CN code example here - http://www.wch.cn/bbs/thread-65023-1.html
* https://bitbucket.org/e_dragon/wch/src
+
 
 
Other Code
 
Other Code
* https://github.com/Blinkinlabs/ch554_sdcc/tree/master/examples
+
* SDCC - https://github.com/Blinkinlabs/ch554_sdcc/tree/master/examples
APP
+
APP  
https://github.com/diodep/ch55x_dualserial
+
* USB to dual serial - https://github.com/diodep/ch55x_dualserial
  
 
[[category: WCH]]
 
[[category: WCH]]

Latest revision as of 01:20, 11 November 2019

Possible functions

  • Please view github demo code page
  • Simulate CH340 USB-TTL
  • Simulate HID keyboard or mouse
  • Read GPIO and send via HID keyboard
  • Read ADC and send via USB endpoint -- > demo see here.
  • Simulate or handle data for USB device, like "barcode scan gun"

etc ...

Program

Limits

  • The IC only can be flashed up to 200 times, please notice this.

Details

  • Default baudrate 57600
  • Internal clock, 12M

CH55x MCU Type Programming Guide

  • Unzip standard demo file.
  • Find header file in example
  • Keil project file in example too
  • Use any standard 8051 IC, such as AT89C51/AT89S51
  • Memory space select according to MCU config, avoid bootloader area, since out factory is already have bootloader.
  • Only download hex or bin into MCU

ISP Programming Mode

  • Use WCHISPTOOL
  • Short connect PROG (or P3.6/UD_P ) to 3.3V, plug in USB to power up to enter into download mode.

SDK

Official SDK Examples

Header text Header text Point Header text
1 559&8模拟U盘.rar CH558/CH559 CH559/CH558模拟U盘,支持文件拷贝,删除,新建,文件读写,格式化等操作,存储介质采用2M的SPI flash.
2 CH5XX芯片加密建议.rar CH55X CH55X系列芯片加密示例和说明文档。
3 CH55X脱机烧录器 CH55X CH55X脱机烧录器PCB和使用说明文档。
4 CH558&9模拟CH9326.rar CH558/CH559 CH559/CH558模拟CH9326,支持CH9326的上位机软件。
5 CH558&9模拟串口CH340.rar CH558/CH559 CH559/CH558模拟CH34X,可以用来扩展并口,SPI,串口,PWM,GPIO等,或者采集以上接口数据发送至主机。
6 IAP54.rar CH554 CH554 IAP演示程序,提供 IAP 下 USB 下载功能
7 CH559操作CH340.rar CH559 CH559操作CH340,支持修改波特率。
8 CH559操作USB键鼠串口输出.rar CH559 CH559操作键鼠,并且将键鼠数据通过串口输出,也可以修改通过SPI,485等发送键鼠数据,可以用于延长或者键鼠组合。
9 CH559操作键鼠支持鼠标报表分析.rar CH559 CHCH559操作键鼠,并且将键鼠数据通过串口输出,也可以修改通过SPI,485等发送键鼠数据,可以用于延长或者键鼠组合。包含HID报表分析,可以获取鼠标 X,Y,滚轮和按键信息。
10 LED控制卡例程.rar CH558/CH559 CH558/CH559LED控制卡示例,支持32*1024点LED屏,支持RTC时钟,支持通过U盘更新显示内容,并且显示内容可以保存支持串行Flash中。
11 USB+UART的IAP实现.rar CH558/CH559 CH558/CH559 USB+串口IAP功能例子,可以在用户程序直接升级用户程序,提供上位机工具和源码。
12 U盘CH559IAP实现.rar CH559 CH559 U盘IAP功能实现,U盘根目录下制定文件名文件用于升级用户程序,也可以改成通过寻找文件进行升级。
13 模拟HID兼容设备上传ADC采样.rar CH558/CH559 CH558/CH559模拟HID兼容设备,上传ADC采集的数据,支持端点中断下传。
14 模拟HID键盘支持软件配置.rar CH558/CH559 CH558/CH559模拟键盘,用于1~3键的特殊键盘,支持软件配置键值。也可通过修改软件支持更多的按键。
15 Compound_Dev_1.4.rar CH558/CH559 CH558/CH559 模拟HID兼容和键盘复合设备,上电自动弹出指定目录下的EXE软件,通过软件可以查看HID兼容设备中断IN端点数据和统计。
16 Compound_Dev.rar CH554 CH554 模拟HID兼容和键盘复合设备,上电自动弹出指定目录下的EXE软件,通过软件可以查看HID兼容设备中断IN端点数据和统计,并且支持TouchKey(触摸按键)检测上传数据。
17 S_CDC.rar CH554 upload & download, USB <=> Serial Dual way transfer CH554模拟CDC类,PC免驱,可以实现快速批量上下传。
18 554_udisk(可以做数据传输用).rar CH554 CH554模拟U盘,无存储介质,需要根据应用添加合适的存储介质。
19 模拟341.rar CH554 CH554模拟CH340,CH341.
20 CH554串口接收数据转USB键值上传.rar CH554 upload CH554标准单一接口USB键盘,串口接收数据转换成键值上传,如串口发送‘a’,上传至文本显示‘a’,支持多字节同时发送.
21 CH559操作扫马枪直接字符输出.rar CH559 CH559操作扫码枪,直接字符输出或者源码输出。
22 554_HOST_MIDI.rar CH554 CH554操作USB MIDI设备,以操作CH345为例子。
23 ch554_uart_2_uart.rar CH554 CH554操作CH340、CP2102、PL2303实现数据在CH554的串口0到CH340等芯片串口引脚的双向透传,支持波特率配置、参数掉电自动保存等功能。

Examples Demo

EVT Demo

Header text Header text Header text
CompatibilityHID Example
  • USB Input Device (HID)
  • USB\VID_5131&PID_2007&REV_0000
CompositeKM CH559模拟USB复合设备,键鼠,支持类命令,支持唤醒 -
VendorDefinedDev Example
  • Simulate USB Module(CH554) CH372
  • Can use CH372 debug tool to test

Demo Example

  • 01/CompatibilityHID: HID serial data up to USB
  • 02/CompositeKM: "simulate" data in key and mouse via EP1 and EP1 into USB
  • 03/VendorDefinedDev

Git and other Examples

Code

Other Code

APP