{"id":157,"date":"2024-09-11T22:29:26","date_gmt":"2024-09-11T14:29:26","guid":{"rendered":"https:\/\/chaixiangyu.cn\/?p=157"},"modified":"2024-09-22T22:02:01","modified_gmt":"2024-09-22T14:02:01","slug":"serial-ports-hub","status":"publish","type":"post","link":"https:\/\/chaixiangyu.cn\/?p=157","title":{"rendered":"Serial Ports Hub (USB-TTL)"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">1. <strong>Project Background and Overview<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Project Goals<\/strong>: This project is to realize serial communication between one-to-many devices for data communication between PC and several lower computer systems.<\/li>\n\n\n\n<li><strong>Project Context<\/strong>: Since the hardware resources of the lower device have been fixed, no RS485 or RS422 function module is provided, and only two pins (RXD and TXD) of the usart are opened as test points. Since it is necessary to connect multiple lower computer devices to PC for cooperative work, Serial Ports Hub (USB-TTL) is developed to realize one-to-many USB-TTL communication with PC to accomplish cooperative work of multiple lower computer devices.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2. <strong>Hardware and Software Platform<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Hardware Selection<\/strong>: STM32F103c8t6, <\/li>\n\n\n\n<li><strong>Development Environment<\/strong>: STM32CubeMX, Keil, VS Code. STM32CubeMX was used to configure the STM32 chip&#8217;s clock and peripherals and other resources, Keil was used to compile and debug the code, and VS Code was used to write the code because it provides the function of code auto-completion and auto-formatting.<\/li>\n\n\n\n<li><strong>Communication Protocol<\/strong>: UART.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">3. <strong>Design and Development Process<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>System Architecture<\/strong>:\n<ul class=\"wp-block-list\">\n<li><img decoding=\"async\" src=\"https:\/\/chaixiangyu.cn\/wp-content\/uploads\/2024\/09\/serial-ports-hub-usb2ttl-1-1024x351.jpg\" alt=\"\"><\/li>\n\n\n\n<li>Serial Ports Hub (USB-TTL) circuit board<br><img decoding=\"async\" src=\"https:\/\/chaixiangyu.cn\/wp-content\/uploads\/2024\/09\/image-11.png\" alt=\"\"><br>top view<br><img decoding=\"async\" src=\"https:\/\/chaixiangyu.cn\/wp-content\/uploads\/2024\/09\/image-12.png\" alt=\"\"><br>bottom view<br><br>Serial Ports Hub (USB-TTL) interface board (connector version)<br><img decoding=\"async\" src=\"https:\/\/chaixiangyu.cn\/wp-content\/uploads\/2024\/09\/image-13.png\" alt=\"\"><br>top view<br><img decoding=\"async\" src=\"https:\/\/chaixiangyu.cn\/wp-content\/uploads\/2024\/09\/image-14.png\" alt=\"\"><br>bottom view<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Module Breakdown and Functionality<\/strong>: <\/li>\n\n\n\n<li><strong>Code Implementation<\/strong>:<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">4. <strong>Testing and Debugging<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Testing Methods<\/strong>: Using tools like logic analyzers, Serial Port Monitoring Assistant and Serial Port Assistant.<\/li>\n\n\n\n<li><strong>Test Results<\/strong>: <\/li>\n\n\n\n<li><strong>Issues and Resolutions<\/strong>: <\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">5. <strong>Project Optimization and Improvements<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Optimization Strategies<\/strong>: <\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">6. <strong>What I Learned<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Technical Skills Development<\/strong>: Ability to reverse circuits, write stm32 programs using the HAL library, and configure resources such as clocks and peripherals using STM32CubeMX.<\/li>\n\n\n\n<li><strong>Potential Applications<\/strong>: Application scenarios requiring one-to-many serial communications (USB-TTL).<\/li>\n\n\n\n<li><strong>Non-technical growth or realization:<\/strong> In the design process, the way to separate the core function module and the interface module is conducive to the on-demand change of the interface module, and the adaptability of the interface will be stronger.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">7. <strong>Future Prospects<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Improvement Plans<\/strong>: \n<ul class=\"wp-block-list\">\n<li>The communication module with the computer end adopts the domestic CH340 chip which is produced by NanjingQinheng to reduce the cost and circuit complexity. <\/li>\n\n\n\n<li>Adding a 3D printed enclosure.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Develop PC communication command control human-computer interaction software to realize on-line modification and on-demand modification of Serial Ports Hub (USB-TTL) serial port communication command set<strong>Potential Applications<\/strong>: Serial communication between multiple devices and PC<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Project Background and Overview 2. Hardware and Soft [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":159,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-157","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nano-project"],"_links":{"self":[{"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/posts\/157","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=157"}],"version-history":[{"count":16,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/posts\/157\/revisions"}],"predecessor-version":[{"id":277,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/posts\/157\/revisions\/277"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/media\/159"}],"wp:attachment":[{"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}