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)
1Mbd sustains 499,573*2 100% with 10 x 100k blocks. < 0.1% BW loss
2Mbd sustains 999,062*2 100% with 10 x 100k blocks.
4Mbd sustains 1.8941M*2 100% with 10 x 100k blocks. -5.15% bandwidth
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 ?
Checking target MCU ...
MCU type: STC8H8K64U
F/W version: 7.4.6U
Current H/W Option:
. ISP-IRC frequency: 24.000MHz
. IRC frequency: 24.000MHz
. Wakeup Timer frequency: 35.325KHz
. Oscillator gain is HIGH
. User EEPROM size is 0.5 K
. Do not detect the level of P3.2 and P3.3 next download
. Power-on reset, use the extra power-on delay
. RESET pin behaves as reset pin
. Interrupt while detect a Low-Voltage
. Thresh voltage level of the built-in LVD : 2.00 V
. Hardware do not enable Watch-Dog-Timer
. Watch-Dog-Timer pre-scalar : 256
. Watch-Dog-Timer stop count in idle mode
. Erase user EEPROM area at next download
. Do not control 485 at next download
. Do not check user password next download
. ICE function is disabled
. Reference voltage: 1189 mV (Range: 1100~1300mV)
. Testing time: 2022-11-1
MCU type: STC8H8K64U
F/W version: 7.4.6U
Erasing MCU flash ... OK ! [1.437"]
Programming user code ... OK ! [0.532"]
Programming OPTIONS ... OK ! [0.000"]
H/W Option upgrade to:
. ISP-IRC frequency: 24.000MHz
. IRC frequency: 11.059MHz
. Wakeup Timer frequency: 35.325KHz
. Oscillator gain is HIGH
. User EEPROM size is 0.5 K
. Do not detect the level of P3.2 and P3.3 next download
. Power-on reset, use the extra power-on delay
. RESET pin behaves as reset pin
. Interrupt while detect a Low-Voltage
. Thresh voltage level of the built-in LVD : 2.00 V
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 ?
Loopback test, from highest baud down
Baud 0x00 Sustained average Bandwidth Results
10Mbd 0.9us 736.975k*2 = 1.473950MBd = 14.739% no failures on 100k blocks (40MHz sysclk /4 ?)
9Mbd 1.0us 658.905k*2 = 1.317810Mbd = 14.642% no failures on 100k blocks (36MHz sysclk /4 ?)
8MBd 1.1/1.2us 581.299k*2 = 1.162598Mbd = 14.532% no failures on 100k blocks (32MHz sysclk /4 ?)
7.5Mbd 1.2us 542.266k*2 = 1.084532Mbd = 14.460% no failures on 100k blocks (30MHz sysclk /4 ?)
6MBd 1.5us 425.092k*2 = 850184 = 14.169% no failures on 100k blocks (24MHz sysclk /4 ?)
5MBd 1.8us 605.371k*2 = 1.210742Mbd = 24.214% no failures on 100k blocks (40MHz sysclk /8 bumps % BW ?)
3MBd 3.0us 493.187k*2 = 986374 = 32.879% no failures on 100k blocks (36MHz sysclk /12 ?)
2.5Mbd 3.6us 515.070k*2 = 1.030140Mbd = 41.205% no failures on 100k blocks (40MHz sysclk /16 ?)
2Mbd 4.5us 453.835k*2 = 907670 = 45.383% no failures on 100k blocks (40MHz sysclk /20 ?)
500k 169.974k*2 = 339948 = 67.989% no failures on 100k blocks (40MHz sysclk /80 ?)