宋元浩

CH340 contact signal (RTS DTR) development board can drive OLED

 
Overview
  • When it comes to CH340, everyone must be familiar with it, especially those who play microcontrollers. It is a USB to serial port chip launched by Qinheng Microelectronics.
    Today we are not going to play with serial communication, but use ch340 to do something.
  • In addition to RXD TXD for serial communication, CH340 also has two special pins, RTS and DTR.
     image.png
  • Does it look familiar? Yes, the cold-start downloader of the 51 microcontroller and the automatic download of the esp8266 both use these two pins. In addition to the automatic download software, some serial port software also has the function of controlling these two pins. key, such as XCOM
    image.png
  • So can we control these two pins with code? Yes, I found this API on Microsoft's website:
    image.png
  • It has two parameters,
    Parameter 1 is the file pointer of the serial port.
    Parameter 2 is the function to be executed. Parameter 2 supports the following values
    CLRDTR clears DTR. Since these two pins are high level by default, clearing them means clearing them to high level.
    CLRRTS Clear RTS
    SETDTR sets DTR low
    STERTS sets RTS low.
  • Let’s take a look at the specific effects

The code can be found in the attachment
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2024-11-24 21:08:40

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

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号