Can you post a picture of your device? So that the staffs can determine what device are you using (seems that they are not sure about this).
========
FYI. I tested this (text "STC-USB-TO-2 UART-TINY, 2022-10-27" on its back), and found that text can be missing while sending long documents (40 kiB plain txt file) on baud 115200.
assistant /USB-CDC is a serial port, it will add 10M/6M/5M/4M/3M/2.5M/2M/1.5M/1M bps serial port communication speed for everyone to choose
We can add new items to the program, like this:
switch (baud)
{
case 14400:
case 19200:
case 28800:
case 38400:
case 57600:
case 115200:
case 230400:
case 460800:
case 921600: //divisible by 22.1184M
SetMCLK(0); //clock 22.1184MHz
break;
case 1500000:
case 3000000:
case 6000000: //divisible by 30M
SetMCLK(2); //clock 30MHz
break;
default:
if(baud < 1000000)
SetMCLK(1); //clock 24MHz
else
SetMCLK(3); //clock 40MHz
break;
}
复制代码
The video demonstrates the process of sending and receiving 1024 bytes of data
乘风*** 发表于 2023-5-8 16:58
assistant /USB-CDC is a serial port, it will add 10M/6M/5M/4M/3M/2.5M/2M/1.5M/1M bps serial port com ...
Yes, I tested the code as-shipped in the device.
Notice the BAUD is set by MAIN_Fosc / 4, so 6M from 30M is not possible, in your comments.
6M and 3M are possible from 24M MAIN_Fosc
Notice I do not test using STC UART helper, I use a proper Terminal program, that is proven to work on FT232H at 12MBd on large files continually. (1 stop bit)
On USB-UARTS like CP2102N, FT231X, PL2303GC, CH9102 there are no problems with no dropped characters and sustained speeds to ~ 3MBd have 1 STOP bit as expected.
Those parts can send continually streamed bytes, with no pauses.
At 2MBd with only 1 channel TX only, on the STC8H8K64U Board, I measure byte times of 14 or 15 bit times, ie an extra 4 or 5 stop bits.
If I test using the CDC helper, I see it is very slow, with long pauses between packets. Below is 2MBd with 100,000 file
That slow send masks the transmit loss effect.
Addit: When I zoom into those 2MBd bursts, it shows as 4 bytes then a 72.4us pause, then the other 252 bytes, and all bytes look to be sent with 14 bits total framing (ie 5 stop bits)
The 252 bytes times as 252*14/2M = 1764us
The very long pause between 256 byte payloads, looks to be deliberate in CDC helper, likely to avoid showing this bug ! Other terminal pgms without this patched delay expose the TX character drop bug.
To be used as a useful USB-UART, it really needs to
a) not drop characters in continual TX (serious bug)
b) have no gaps
c) send 1 stop bit, when asked, at least at modest BAUD rates like 2MBd
As a comparison, here is a newish USB-UART, CH9102 sending at 6M 8N1 with average sustained speed of 5.562Mbd
Comments
a) There is exactly 1 stop bit when asked
b) smallest packet grouping is 64 bytes, with occasional gaps for groupings
c) No bytes are lost and at this high baud rate, it sustains an average of 5.562Mbd
This CH9102 is appx state of art at FS-USB, based on their 8051 MCUs, whilst HS-USB parts like FT2232H can sustain 12Mbd averages.