找回密码
 立即注册
楼主: 国学芯用

USB-超强演示程序包全家福发布,RMB0.99 !一箭双雕之USB转双串口 全新升级

 火.. [复制链接]
  • 打卡等级:以坛为家I
  • 打卡总天数:397
  • 最近打卡:2025-05-01 00:27:10

0

主题

15

回帖

311

积分

中级会员

积分
311
发表于 2024-1-15 21:21:42 | 显示全部楼层
我的win8系统 为了这个usb-cdc功能 驱动一直不成功 折腾了好几个小时,最后失败了告终,不甘心又买了一块固态硬盘装了win10 可以了
回复 支持 反对

使用道具 举报 送花

  • 打卡等级:以坛为家I
  • 打卡总天数:397
  • 最近打卡:2025-05-01 00:27:10

0

主题

15

回帖

311

积分

中级会员

积分
311
发表于 2024-1-15 21:26:28 | 显示全部楼层
硬盘白买了,今天下载了v6.92k版本,安装一下cdc驱动 win8 也可以识别了,我确定操作步骤和之前一样 之前版本真的没成功
回复 支持 反对

使用道具 举报 送花

  • 打卡等级:偶尔看看III
  • 打卡总天数:54
  • 最近打卡:2025-05-01 09:07:55

717

主题

1万

回帖

1万

积分

管理员

积分
15609
发表于 2024-1-15 23:13:30 | 显示全部楼层
感谢为经济发展买了个 硬盘
回复 支持 反对

使用道具 举报 送花

  • 打卡等级:以坛为家I
  • 打卡总天数:356
  • 最近打卡:2025-04-30 07:56:26

2

主题

87

回帖

886

积分

高级会员

积分
886
发表于 2024-1-18 12:19:44 | 显示全部楼层
神*** 发表于 2024-1-15 23:13
感谢为经济发展买了个 硬盘

回复 支持 反对

使用道具 举报 送花

  • 打卡等级:偶尔看看III
  • 打卡总天数:54
  • 最近打卡:2025-05-01 09:07:55

717

主题

1万

回帖

1万

积分

管理员

积分
15609
发表于 2024-1-20 16:01:47 | 显示全部楼层
STC 的 USB 是用的 内部 USB时钟,12Mbps;
如要转串口,串口的速度是 CPU时钟/4/(65536-重装数),
如 CPU时钟 40MHz, 转串口的波特率可以 10Mbps

回复 支持 反对

使用道具 举报 送花

  • 打卡等级:初来乍到
  • 打卡总天数:4
  • 最近打卡:2025-05-01 06:58:22

5

主题

184

回帖

1331

积分

金牌会员

积分
1331
发表于 2024-1-24 13:49:47 | 显示全部楼层
本帖最后由 jmg 于 2024-1-25 03:01 编辑

I downloaded v6.92k version, and Win11 is OK.
Connected to STC-USB-TO-2 and cycled buttons and asked "make target MCU USB-2UART controller'
Message window cycles and reports as below, and 2 UARTS appear in Device manager.

Q: How do I know which HEX version was used for  STC8H8K64U ?  Nothing appears to show HEX version ?  Where is the HEX file ?
I can see F/W version: 7.4.6U, but I suspect that is USB HID bootloader version number, not the UART HEX version  ?

Q: which serial port has the best performance ? or are they both identical ?

I jumper S-TXD to S-RXD and start a terminal and connect a counter/timer.
UARTS work, echoes appear on terminal, and I can change BAUD rate to any of 22.1184M/4/N  (Baud timing shows crystal error is about -60ppm)

So far. so good. I start stress testing.
115200 Baud drops streamed characters unless I drop the block size to 256 bytes. Even a modest 384 byte block sometimes fails. 10,000 always drops roughly 25 bytes.
Next, I look for what BAUD speed can sustain 10,000 sized block echoes
Results:
22.1184M/4/120 = 46080 9/ans = 195.31us measure 195.3u        =>    8.n.1 is no dropped chars 10 x 10k blocks << fastest OK speed
22.1184M/4/119 = 46467.22689 9/ans  193.684us measure 193.7   =>    Drops 4 chars in 10 x 10k blocks 40% fail
22.1184M/4/118 = 46861.01695 9/ans  192.057us measure 192.0us  =>   100% fail Magic threshold, drops chars every time
  
Compared with other USB-UARTS, that is a quite low echo-block failure speed.
Q: Is this 'working as expected' ?  
Q: Is there better, faster code somewhere ?

Addit: Same test using WCH CH9102 (no handshake lines)
  1. WCH CH9102 checks - Simple TX-RX Loopback Echo Block sends
  2. 1Mbd   sustains 499,573*2  100% with 10 x 100k blocks.  < 0.1% BW loss
  3. 2Mbd   sustains 999,062*2  100% with 10 x 100k blocks.
  4. 4Mbd   sustains 1.8941M*2  100% with 10 x 100k blocks.  -5.15% bandwidth
  5. 6Mbd   sustains 2.7736M*2  100% with 10 x 100k blocks.  -7.546% bandwidth
复制代码
Conclusion: WCH never drops bytes, but does have a slight bandwidth droop at 4MBd and 6MBd.
The STC8H core is faster than the WCH 8051 core, so STC should be in the same ballpark, instead it fails at much lower speeds ?

Just curious - the report says ".Testing time: 2022-11-1" is that the factory time of calibrate of VREF  etc ?

  1. Checking target MCU ...
  2.   MCU type: STC8H8K64U
  3.   F/W version: 7.4.6U
  4. Current H/W Option:
  5.   . ISP-IRC frequency: 24.000MHz
  6.   . IRC frequency: 24.000MHz
  7.   . Wakeup Timer frequency: 35.325KHz
  8.   . Oscillator gain is HIGH
  9.   . User EEPROM size is 0.5 K
  10.   . Do not detect the level of P3.2 and P3.3 next download
  11.   . Power-on reset, use the extra power-on delay
  12.   . RESET pin behaves as reset pin
  13.   . Interrupt while detect a Low-Voltage
  14.   . Thresh voltage level of the built-in LVD : 2.00 V
  15.   . Hardware do not enable Watch-Dog-Timer
  16.   . Watch-Dog-Timer pre-scalar : 256
  17.   . Watch-Dog-Timer stop count in idle mode
  18.   . Erase user EEPROM area at next download
  19.   . Do not control 485 at next download
  20.   . Do not check user password next download
  21.   . ICE function is disabled
  22.   . Reference voltage: 1189 mV (Range: 1100~1300mV)
  23.   . Testing time: 2022-11-1
  24.   MCU type: STC8H8K64U
  25.   F/W version: 7.4.6U
  26. Erasing MCU flash ...  OK !                [1.437"]
  27. Programming user code ... OK !                [0.532"]
  28. Programming OPTIONS ... OK !                [0.000"]
  29. H/W Option upgrade to:
  30.   . ISP-IRC frequency: 24.000MHz
  31.   . IRC frequency: 11.059MHz
  32.   . Wakeup Timer frequency: 35.325KHz
  33.   . Oscillator gain is HIGH
  34.   . User EEPROM size is 0.5 K
  35.   . Do not detect the level of P3.2 and P3.3 next download
  36.   . Power-on reset, use the extra power-on delay
  37.   . RESET pin behaves as reset pin
  38.   . Interrupt while detect a Low-Voltage
  39.   . Thresh voltage level of the built-in LVD : 2.00 V
  40.   . Hardware do not enable Watch-Dog-Timer
  41.   . Watch-Dog-Timer pre-scalar : 256
  42.   . Watch-Dog-Timer stop count in idle mode
  43.   . Erase user EEPROM area at next download
  44.   . Do not control 485 at next download
  45.   . Do not check user password next download
  46.   . ICE function is disabled
  47.   . Reference voltage: 1189 mV (Range: 1100~1300mV)
  48.   . Testing time: 2022-11-1
  49. MCU ID : F784C921007F04
  50.   MCU type: STC8H8K64U
  51.   F/W version: 7.4.6U
  52.   . Set frequency: 11.059MHz
  53.   . Adjusted frequency: 11.059MHz ( clock divider = 2; )
  54.   . Trim error: 0.000%
  55.   Complete !(2024-01-24 16:52:38)
复制代码



回复 支持 反对

使用道具 举报 送花

  • 打卡等级:以坛为家II
  • 打卡总天数:522
  • 最近打卡:2025-05-01 06:03:55
已绑定手机

34

主题

459

回帖

2215

积分

金牌会员

积分
2215
发表于 2024-1-24 17:22:50 | 显示全部楼层
gentl*** 发表于 2023-11-23 12:21
当然可以  这是个双串口工具,用串口的地方都可以

支持STC全系列
回复 支持 反对

使用道具 举报 送花

  • 打卡等级:初来乍到
  • 打卡总天数:4
  • 最近打卡:2025-05-01 06:58:22

5

主题

184

回帖

1331

积分

金牌会员

积分
1331
发表于 2024-1-25 10:39:13 | 显示全部楼层
Further to #136, I noticed this in another thread.
model: [STC USB-2UART ] , package TSSOP20; Support: any mainstream baud rate and new popular :
1Mbps/ 1.5Mbps/ 2Mbps/2.5Mbps/3Mbps/4Mbps /5Mbps, 6Mbps/7.5Mbps/8Mbps/9Mbps/10Mbps
The factory comes with a USB to dual serial port program , the complete silk screen name : STC USB-2UART-45I-TSSOP20


So I tested from the other end, with interesting results.
The software related slow-downs are significant, and they interact to mean the dropped bytes effect goes away at high BAUD rates., at least for loopback  (?!)

It means between baud rates of 22.1184M/4/42 and 22.1184M/4/120, USB-2UART code fails by dropping character in loopback test.

The bandwidth erosion/overhead is large at high speeds, with many stop bits added as SW delays impact.
It only reaches 50% at around 1Mbd - contrast with WCH CH9102 which only drops -5.15% at 4MBd and -7.546% at 6MBd duplex, and is < 0.1% BW loss at 1Mbd


one strange detail, is 22.1184M/8 or /20 is invalid, whilst 22.1184M/4 /12 /16 /24 /28 etc are fine ?


  1. Loopback test, from highest baud down
  2. Baud   0x00       Sustained average           Bandwidth  Results  
  3. 10Mbd  0.9us      736.975k*2 = 1.473950MBd  = 14.739%  no failures on 100k blocks  (40MHz sysclk /4 ?)
  4. 9Mbd   1.0us      658.905k*2 = 1.317810Mbd  = 14.642%  no failures on 100k blocks  (36MHz sysclk /4 ?)
  5. 8MBd   1.1/1.2us  581.299k*2 = 1.162598Mbd  = 14.532%  no failures on 100k blocks  (32MHz sysclk /4 ?)
  6. 7.5Mbd 1.2us      542.266k*2 = 1.084532Mbd  = 14.460%  no failures on 100k blocks  (30MHz sysclk /4 ?)
  7. 6MBd   1.5us      425.092k*2 = 850184       = 14.169%  no failures on 100k blocks  (24MHz sysclk /4 ?)
  8. 5MBd   1.8us      605.371k*2 = 1.210742Mbd  = 24.214%  no failures on 100k blocks  (40MHz sysclk /8 bumps % BW ?)
  9. 3MBd   3.0us      493.187k*2 = 986374       = 32.879%  no failures on 100k blocks  (36MHz sysclk /12  ?)
  10. 2.5Mbd 3.6us      515.070k*2 = 1.030140Mbd  = 41.205%  no failures on 100k blocks  (40MHz sysclk /16  ?)
  11. 2Mbd   4.5us      453.835k*2 = 907670       = 45.383%  no failures on 100k blocks  (40MHz sysclk /20  ?)
  12. 500k              169.974k*2 = 339948       = 67.989%  no failures on 100k blocks  (40MHz sysclk /80  ?)
  13. 22.1184M/4  = 5529600 = 1.627us measure 1.6/1.7us  388.223k*2 = 776446 = 14.041%  OK
  14. 22.1184M/8  = 2764800 => reports invalid baudrate                                 
  15. 22.1184M/12 = 1843200 = 4.882us measure 4.8/4.9us  410.528k*2 = 821056 = 44.545%  OK
  16. 22.1184M/16 = 1382400 = 6.510us measure 6.5us      392.003k*2 = 784006 = 56.713%  OK
  17. 22.1184M/20 = 1105920 => reports invalid baudrate                                 
  18. 22.1184M/24 = 921600  = 9.765us measure 9.6/9.7    235.302k*2 = 470604 = 51.063%  OK
  19. 22.1184M/28 valid                                                                 
  20. 22.1184M/32 valid                                                                 
  21. 22.1184M/36 = 614400  = 14.648us measure 14.6us    181.057k*2 = 362114 = 58.937%  OK
  22. 22.1184M/48 = 460800                               156.778k*2 = 313556 = 68.046%  OK
  23. 22.1184M/96 = 230400                                96.866k*2 = 193732 = 84.085%  OK
  24. 22.1184M/144 = 153600                               69.083k*2 = 138166 = 89.951%  OK
  25. 22.1184M/156 = 141785                               67.703k*2 = 135406 = 95.500%  OK
  26. 22.1184M/160 = 138240 65.10us  measure 65us         66.520k*2 = 133040 = 96.238%  OK
  27. 22.1184M/164 = 134868 66.73us  measure 66.7us       65.115k*2 = 130230 = 96.560%  OK, rare failures.
  28. 22.1184M/168 = 131657  drops chars !!
  29. 22.1184M/192 = 115200  drops chars !!
  30. all the way down to the
  31. 22.1184M/4/120 below which it starts working ok again.
复制代码
回复 支持 反对

使用道具 举报 送花

  • 打卡等级:以坛为家II
  • 打卡总天数:452
  • 最近打卡:2025-05-01 06:20:50
已绑定手机

13

主题

1257

回帖

2971

积分

金牌会员

积分
2971
发表于 2024-1-26 08:45:50 | 显示全部楼层
王子*** 发表于 2024-1-15 21:26
硬盘白买了,今天下载了v6.92k版本,安装一下cdc驱动 win8 也可以识别了,我确定操作步骤和之前一样 之前版 ...

可能之前的STC-ISP版本太低了,附带的CDC驱动不兼容win8
回复 支持 反对

使用道具 举报 送花

  • 打卡等级:常住居民III
  • 打卡总天数:187
  • 最近打卡:2025-04-25 06:08:27

20

主题

121

回帖

767

积分

高级会员

积分
767
发表于 2024-1-27 07:56:04 | 显示全部楼层

关于一箭双雕,有个不情之请:

本帖最后由 Mr_LG 于 2024-1-27 08:26 编辑

我不懂USB,只是要用USB转串口的工具。故非常喜欢“一箭双雕”这款板子!
提个建议:能否利用STC8H2K08U具备串口接收硬件奇偶校验功能,实现:
串口通信之Win32 API 接口中的奇偶校验错捕获。


说明:本人有一应用,需要在PC端捕获串口数据的奇偶校验错(Win32 API接口支持!)。
经测试试,CH340系列芯片转出来的串口,在Win32 API接口中,对奇偶校验错“无感觉”!
而FTDI的芯片(如FT232)就能“感知”到串口上的奇偶校验错。
当然,我还没来得及试一箭双雕是否解决了这个问题。

点评

一箭双雕 奇偶校验 可用 , 前段时间看过原码,九位数据校验位四种模式四选一: 奇校验, 偶校验, 1验位 ,0校验  发表于 2024-1-31 17:43
回复 支持 反对

使用道具 举报 送花

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|深圳国芯人工智能有限公司 ( 粤ICP备2022108929号-2 )

GMT+8, 2025-5-1 20:23 , Processed in 0.205319 second(s), 115 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表