Ihk2ID

Composite_CDC_HID

 
Overview
Hello everyone, this is a USB composite HID CDC device I created. In this project, the STM32 is configured as HID (keyboard, mouse, multimedia) and CDC (serial port), so serial communication with the keyboard can be achieved via USB.
This is the function I wanted to achieve.
The USB circuit
is configured as a full-speed device. A 1.5k pull-up resistor is needed on the D+ port (3.3V).
The reason for configuring it as a full-speed USB device is
that one full-speed device is sufficient;
also, the STM32F103C8T6 seems to only support full-speed devices.
Please refer to the manual for a more detailed explanation. The
PCB design
is not very complex; it could be done with a two-layer board. I used a four-layer board mainly for impedance matching calculations, hoping to achieve more stable operation. A simplified flowchart of the program: First, configure the USB device, modify the device descriptor, configure the descriptor, and report the descriptor. Then you can start writing the functions. I also configured several LEDs as Caps Lock and Num Lock indicators, which are written in the HID callback. (Three LEDs were left in total; feel free to modify them as needed.) For the SWD flashing interface, you might need to prepare something like this. This socket doesn't need to be soldered (I didn't either). Important evidence of successful configuration: STM32 USB HID CDC composite device_Bilibili_bilibili https://github.com/cnxft/composite_hid_cdc.git









 

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2026-03-24 09:43:52

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号