Author Topic: 20 cent USB MCU in MSOP10 package  (Read 1250 times)

0 Members and 1 Guest are viewing this topic.

Online blueskull

  • Supporter
  • ****
  • Posts: 12406
  • Country: cn
  • Power Electronics Guy
20 cent USB MCU in MSOP10 package
« on: October 05, 2019, 11:27:47 pm »
So, today's hero is this little guy: https://hackaday.com/tag/ch552/

I'm working on my FPGA board, and part of the cost optimization is to get rid of any expensive parts (such as FT2232H), plus to get rid of parts that need pre-programming (implies DFU).

It looks like CH552E is a good option -- small package, $0.21, with HW UART/SPI, DFU bootloader, and up to 24MHz 1T 8051 core and 14kB of RAM (16kB if you nuke the bootloader).

Since it's stupidly cheap and LCSC doesn't carry it (LCSC has its TSSOP20 version, CH552T, which I don't have the PCB space for), I have to buy some from Taobao.

Due to the again, stupidly HIGH shipping cost to US (if the seller doesn't have an export license and a contract with China Post ePacket) and my bad patience, I decide to go with DHL or SF-Express.

Therefore, I'm looking at $30 on shipping for $0.21 parts, which brings the question: Is there anyone interested in this little chip? We can make a group buy. I need 100pcs.

Some English resources of this chip:
https://www.electrodragon.com/w/WCH#MCU_.2B_USB_CH55x_Series
https://github.com/Blinkinlabs/ch554_sdcc

Some Japanese resources of this chip:
https://github.com/hakura040/CH552_SampleCode
https://hakura03.hatenablog.com/entry/2019/03/30/115430

USB DFU downloader:
https://github.com/rgwan/librech551

*: CH551 is stripped down version of CH552 (no analog, less ROM/RAM, SOP16 only), which is stripped down from CH554 (removed USB host).
*: Blinkinlabs GitHub repo has a translated English document.
*: I will upload my journey with this thing on YouTube, so there will be plenty more English resource on this chip.
*: I will NOT have time to translate the whole DS to English unless WCH pays me to do so.

There was not an SDCC-version of CH552-specific header in the wild (though you can use CH554.h, just don't use registers that are not on chip), so I made my own.
Comments are stripped for the sake of formatting, I will add them back and translate them to proper English once I have spare time. Attached below.
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 1865
  • Country: 00
Re: 20 cent USB MCU in MSOP10 package
« Reply #1 on: October 06, 2019, 12:42:22 am »
This may help you in the development stage

https://www.google.com/search?q=eletrodragon&rlz=1C1CHBD_pt-BRBR863BR863&oq=eletro&aqs=chrome.2.69i57j0j69i59j69i61l2j69i60.3356j0j7&sourceid=chrome&ie=UTF-8

You can use Keil for that very easy ( if you have any Silabs board can be free )

https://www.silabs.com/products/development-tools/software/8-bit-8051-microcontroller-software



A single header file with some specific register on WCH and you are done.

Sdcc also works  in Windows, Linux, and WLS

If time  inst' an issue you can have very cheap freight using the epacket, My last WCH chip order +- 100 Pcs, paid only 3 USD freight to the farthest possible country with China Origin

By the way, The EFM8 can be a better option in some circumstances, I would suggest taking a look is a little more expensive but have some advantages on speed and the product itself is more flexible.

https://www.silabs.com/products/mcu/8-bit/efm8-universal-bee

On the WCH site also have a lot of useful information  ( you can read  chinese I guess ? )

http://www.wch.cn/products/CH551.html

« Last Edit: October 06, 2019, 12:49:00 am by ebclr »
 

Online blueskull

  • Supporter
  • ****
  • Posts: 12406
  • Country: cn
  • Power Electronics Guy
Re: 20 cent USB MCU in MSOP10 package
« Reply #2 on: October 06, 2019, 02:09:24 am »
This may help you in the development stage

Yup. I saw actually some similar boards from Taobao, and since I will buy parts from there, I don't want to spend double postage.

You can use Keil for that very easy ( if you have any Silabs board can be free )
A single header file with some specific register on WCH and you are done.
Sdcc also works  in Windows, Linux, and WLS

One of my policy is NOT TO TOUCH commercial software that I don't feel comfortable to buy.
Sooner or later I will have to pay. I've learned enough lesson from Altium.

If time  inst' an issue you can have very cheap freight using the epacket, My last WCH chip order +- 100 Pcs, paid only 3 USD freight to the farthest possible country with China Origin
By the way, The EFM8 can be a better option in some circumstances, I would suggest taking a look is a little more expensive but have some advantages on speed and the product itself is more flexible.

I'm one of the first forum users that posted about EFM8 years ago. Yes, it's a great chip, but it has its own limitations.
Cost aside, it is still not the best choice, rest of having a smaller package.

On the WCH site also have a lot of useful information  ( you can read  chinese I guess ? )

Yes. I just went through its DS a few times.
 

Offline oPossum

  • Frequent Contributor
  • **
  • Posts: 829
  • Country: us
  • The other white meat
Re: 20 cent USB MCU in MSOP10 package
« Reply #3 on: October 06, 2019, 05:38:40 am »
I have been using the CH55x family for a few months now. See the other thread for some projects I have done. I recently got a few CH552T from aliexpress because I wasn't ready for another LCSC order (got the 551G and 552G from them). Cheap shipping and got them in about 2 weeks.

Would definitely be interested in a group by of the CH552E.

https://www.aliexpress.com/item/32907096404.html?spm=a2g0s.9042311.0.0.6d8d4c4dWkLHpj

https://www.eevblog.com/forum/microcontrollers/lt30-cent-mcu-with-usb-controllers-capactive-touch-more-wchs-ch55x-series/msg2409603/#msg2409603

EAGLE files for BOB attached.
« Last Edit: October 06, 2019, 05:42:41 am by oPossum »
 
The following users thanked this post: blueskull

Online blueskull

  • Supporter
  • ****
  • Posts: 12406
  • Country: cn
  • Power Electronics Guy
Re: 20 cent USB MCU in MSOP10 package
« Reply #4 on: October 06, 2019, 05:54:00 am »
Would definitely be interested in a group by of the CH552E.

The current price on Taobao is between $0.2 to $0.3. The bigger brother CH554E on LCSC is $0.8, but with very limited availability.

If you want some and can live with up to $0.3 price, please leave a number how many would you like to have. I'll add them to my order.
 

Offline oPossum

  • Frequent Contributor
  • **
  • Posts: 829
  • Country: us
  • The other white meat
Re: 20 cent USB MCU in MSOP10 package
« Reply #5 on: October 06, 2019, 05:59:53 am »
I'll take 32 of the CH552E.
 

Online blueskull

  • Supporter
  • ****
  • Posts: 12406
  • Country: cn
  • Power Electronics Guy
Re: 20 cent USB MCU in MSOP10 package
« Reply #6 on: October 06, 2019, 07:12:03 am »
@OwO will be handling shipping to US, and I will be handling distribution within US.

At this moment, the price we got is $0.21 (1.5 CNY). If anyone wants to jump in, please do.

Order will be placed when the seller starts to ship after Chinese National Day, so this thread will still accept orders for a day or two.
 

Offline PCB.Wiz

  • Frequent Contributor
  • **
  • Posts: 378
  • Country: au
Re: 20 cent USB MCU in MSOP10 package
« Reply #7 on: October 06, 2019, 10:13:26 am »
Would definitely be interested in a group by of the CH552E.

The current price on Taobao is between $0.2 to $0.3. The bigger brother CH554E on LCSC is $0.8, but with very limited availability.

If you want some and can live with up to $0.3 price, please leave a number how many would you like to have. I'll add them to my order.

LCSC has stock of the MSOP10 CH552E CH554E, but shows at  100+  $0.5242
The CH55x series is older, and the newer CH54x has  a faster core, but I think not in MSOP10.
EFM8UB3 may be worth looking at, that has a 48MHz Core, and has 3mm packages - depends what speed of MCU you need ?.
« Last Edit: October 06, 2019, 07:08:18 pm by PCB.Wiz »
 

Offline hugatry

  • Contributor
  • Posts: 17
  • Country: 00
Re: 20 cent USB MCU in MSOP10 package
« Reply #8 on: October 06, 2019, 10:26:33 am »

The current price on Taobao is between $0.2 to $0.3. The bigger brother CH554E on LCSC is $0.8, but with very limited availability.

If you want some and can live with up to $0.3 price, please leave a number how many would you like to have. I'll add them to my order.

LCSC has stock of the MSOP10 CH552E, but shows at  100+  $0.5242
That's the CH554E with limited stock, not CH552E.

Offline PCB.Wiz

  • Frequent Contributor
  • **
  • Posts: 378
  • Country: au
Re: 20 cent USB MCU in MSOP10 package
« Reply #9 on: October 06, 2019, 07:08:53 pm »
That's the CH554E with limited stock, not CH552E.
Oops, corrected.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 3047
  • Country: us
Re: 20 cent USB MCU in MSOP10 package
« Reply #10 on: October 06, 2019, 09:02:33 pm »
So... do you think that these are the same silicon that makes of the ubiquitous CH340x USB/Serial controllers? (the CH340E is an MSOP10 version.)If so, does that mean that the CH340 might be re-programmable?  hackable with BADUSB-like malware?
 

Offline oPossum

  • Frequent Contributor
  • **
  • Posts: 829
  • Country: us
  • The other white meat
Re: 20 cent USB MCU in MSOP10 package
« Reply #11 on: October 06, 2019, 09:13:24 pm »
Definitely not the same. There are a few significant differences in electrical characteristics.
 

Online blueskull

  • Supporter
  • ****
  • Posts: 12406
  • Country: cn
  • Power Electronics Guy
Re: 20 cent USB MCU in MSOP10 package
« Reply #12 on: October 07, 2019, 12:28:20 am »
The CH55x series is older, and the newer CH54x has  a faster core, but I think not in MSOP10.

CH54x, the only part that is in stock and fits my size requirement is CH549, which is $0.8+.

EFM8UB3 may be worth looking at, that has a 48MHz Core, and has 3mm packages - depends what speed of MCU you need ?.

It blew the budget. Also, this is supposed to be a design challenge of a larger system (FPGA module w/ USB) using only Chinese parts rest of absolutely necessary imported parts.
So far, I was able to strip all but a Dialog Semi part, which can only be replaced by an ASIC, so I'll leave it there.
Also there is a Hirose connector, which is very cheap, so cheap that it would cost more to replace with Chinese parts.
 

Offline PCB.Wiz

  • Frequent Contributor
  • **
  • Posts: 378
  • Country: au
Re: 20 cent USB MCU in MSOP10 package
« Reply #13 on: October 07, 2019, 02:33:57 am »
... Also, this is supposed to be a design challenge of a larger system (FPGA module w/ USB) using only Chinese parts rest of absolutely necessary imported parts.
..
Interesting brief.
Does that mean you need a SPI programmer, for the FPGA Flash / FPGA directly ?  I'd have thought a MSOP10 was too pin-limited for useful SPI ?
Using one of these little parts to do a Byte-Blaster type FPGA bridge could be interesting.
Maybe SO16 is better choice, as I see the CH54x series will come in SO16, and those have 12b ADCs
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 1865
  • Country: 00
Re: 20 cent USB MCU in MSOP10 package
« Reply #14 on: October 07, 2019, 02:42:57 am »
This is the Taobao WCH store, have many things for people interested in this line

For your application on FPGA, development board I guess CH551T will fit better, check this one

https://item.taobao.com/item.htm?id=531909755701

I'm teased by that usb analyser  very cheap

https://item.taobao.com/item.htm?spm=a1z10.1-c.w5003-13505955048.5.5907215da3XLDx&id=4244192817&scene=taobao_shop
« Last Edit: October 07, 2019, 02:46:13 am by ebclr »
 

Online blueskull

  • Supporter
  • ****
  • Posts: 12406
  • Country: cn
  • Power Electronics Guy
Re: 20 cent USB MCU in MSOP10 package
« Reply #15 on: October 07, 2019, 02:58:18 am »
Does that mean you need a SPI programmer, for the FPGA Flash / FPGA directly ?  I'd have thought a MSOP10 was too pin-limited for useful SPI ?

The MSOP10 package comes with 4 IO pins (3 power pins, 2 USB pins, 1 reset pin used as pushbutton interrupt input), and the 4 IOs are carefully assigned.
Two will be used as bit bang I2C to talk to SLG46580, which is a programmable PMIC with 9 IO pins besides power inputs, LDO output and I2C pins.
The rest two pins will be used as SPI MISO/MOSI 2-in-1 and SCK.

SPI is put in write only mode, so the MOSI/MISO combo serves only as MOSI while occupying MISO pin, because MISO is also UART RXD pin (SCK being TXD), this allows the MCU to be doubled as UART bridge when not in download mode.
SCK and effective MOSI goes to flash ROM, and the NCK of flash ROM is expanded from SLG46580. SLG46580 also reads MISO, which allows polling of WIP bit (using software SPI with stretched SCK on MCU side to synchronous SPI command write and I2C read).

During download, MCU holds FPGA reset low through SLG46580 to tri-state SPI pins of FPGA, therefore there won't be SPI conflict on flash ROM.
After download, the FPGA can enable UART mode by signaling a pin on SLG46580, and the MCU will enter UART mode accordingly.
SCK becomes TXD of MCU, effective MOSI mapped on MISO pin becomes RXD of MCU, and flash ROM MISO (expanded from SLG46580) becomes CMD/DAT. This also allows the MCU to address USB UART and MCU itself separately using minimum IO.

Since there's no extra pins on MCU, VBUS sensing (necessary, since design can be powered externally) is done with another pin from SLG46580, and it is compared with a threshold using one of the four comparators (with internal Vref DAC on negative input) integrated in SLG46580.

In addition, since CH552 runs on 5V in DFU mode (its flash required 5V to write), and FPGA is 3.3V, plus I don't want to bother level shifting 5V to 3.3V at 8MHz speed, I opted to feed CH552 with selectable voltage using two PNP transistors. 5V is fed into emitter of PNP 1, and its base it pulled down with a resistor. If the PMIC pulls it high to 5V, it cuts off, while on default it is on to guarantee normal-on behavior.

Another PNP is connected to 3.3V (at emitter), and its base is only pulled down when 3.3V is stable and CH552 wants to be fed with 3.3V (to enable IO buffer to talk to FPGA/flash). The collectors of the two PNP are connected together to MCU's VCC pin.

The MCU has an internal regulator which generates 3.3V from 5V, but it doesn't have low drop out bypassing capability, so another PNP is used to turn it on when CH552 is put into 3.3V mode. This low active signal is shared with the VCC 3.3V enable pin.

Since the FPGA can support bit-bang USB, there must be a selector to choose which device goes to external USB port, so there is a BL1530 USB MUX (second source of FSUSB42) on board, and that needs one IO to control.

Among 4 LDO channels of SLG46580, one is configured as P-ch load switch, and it was characterized to have pretty fast switching speed from a previous project, and I'm using it to create a hysteresis-based buck converter for 1.0V Vcore of FPGA. It needs a feedback pin that goes to its comparator. That's another IO from SLG46580.

Therefore, overall, MOSI (CMD/DAT), NCS, UART_ENA, FPGA_RST, VBUS_SNS, 5V_DIS, 3V_ENA, USB_SEL and 1V_SNS are expanded from SLG46580 for CH552. That's all 9 IOs of SLG46580.

Using one of these little parts to do a Byte-Blaster type FPGA bridge could be interesting.

High speed (MCU direct) pin count is not enough to implement JTAG, plus I got a confirm from Gowin that they are NOT going to supply me with JTAG sequence for programming/downloading their chips.

Maybe SO16 is better choice, as I see the CH54x series will come in SO16, and those have 12b ADCs

SO16 is way too large. My size constraint prohibits even TSSOP20. I'm squeezing 24 DIP pins, an 10mm*10mm FPGA and a 30P FFC connector among others on a 17mm*35mm PCB with only one side loading. That's more than challenging!
 
The following users thanked this post: nano

Offline PCB.Wiz

  • Frequent Contributor
  • **
  • Posts: 378
  • Country: au
Re: 20 cent USB MCU in MSOP10 package
« Reply #16 on: October 07, 2019, 07:35:35 pm »
SO16 is way too large. My size constraint prohibits even TSSOP20. I'm squeezing 24 DIP pins, an 10mm*10mm FPGA and a 30P FFC connector among others on a 17mm*35mm PCB with only one side loading. That's more than challenging!
There is a lot offloaded from your 10 pin MCU choice, into the 20 pin SLG46580, maybe using a single 4x4 QFN28 part like CH547F (25IO) can give a smaller PCB ?
 

Online blueskull

  • Supporter
  • ****
  • Posts: 12406
  • Country: cn
  • Power Electronics Guy
Re: 20 cent USB MCU in MSOP10 package
« Reply #17 on: October 07, 2019, 07:47:08 pm »
There is a lot offloaded from your 10 pin MCU choice, into the 20 pin SLG46580, maybe using a single 4x4 QFN28 part like CH547F (25IO) can give a smaller PCB ?

And how am I supposed to generate 1.0V , 3.3V, and most difficult, two programming rails from 1.2V~3.3V for IOs banks if I get rid of the SLG46580?
 

Offline krho

  • Regular Contributor
  • *
  • Posts: 213
  • Country: si
Re: 20 cent USB MCU in MSOP10 package
« Reply #18 on: October 07, 2019, 08:02:42 pm »
Also there is a Hirose connector, which is very cheap, so cheap that it would cost more to replace with Chinese parts.
Can you tell the part number :)
 

Online blueskull

  • Supporter
  • ****
  • Posts: 12406
  • Country: cn
  • Power Electronics Guy
Re: 20 cent USB MCU in MSOP10 package
« Reply #19 on: October 07, 2019, 08:26:30 pm »
Also there is a Hirose connector, which is very cheap, so cheap that it would cost more to replace with Chinese parts.
Can you tell the part number :)

FH34SRJ-30S-0-5SH
 

Offline krho

  • Regular Contributor
  • *
  • Posts: 213
  • Country: si
Re: 20 cent USB MCU in MSOP10 package
« Reply #20 on: October 08, 2019, 05:48:45 am »
Also there is a Hirose connector, which is very cheap, so cheap that it would cost more to replace with Chinese parts.
Can you tell the part number :)

FH34SRJ-30S-0-5SH
Thanks.. I don't find 1,13€/1000 cheap.. especialy if you need a 3-4 of them on each board. So that's 6-8 of them then. Not for price sensitive product :(
 

Online blueskull

  • Supporter
  • ****
  • Posts: 12406
  • Country: cn
  • Power Electronics Guy
Re: 20 cent USB MCU in MSOP10 package
« Reply #21 on: October 08, 2019, 06:12:16 am »
Also there is a Hirose connector, which is very cheap, so cheap that it would cost more to replace with Chinese parts.
Can you tell the part number :)

FH34SRJ-30S-0-5SH
Thanks.. I don't find 1,13€/1000 cheap.. especialy if you need a 3-4 of them on each board. So that's 6-8 of them then. Not for price sensitive product :(

https://lcsc.com/product-detail/FFC-FPC-Connectors_Hirose_FH34SRJ-30S-0-5SH-50_Hirose-HRS-FH34SRJ-30S-0-5SH-50_C324727.html
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 1865
  • Country: 00
Re: 20 cent USB MCU in MSOP10 package
« Reply #22 on: October 08, 2019, 07:07:12 am »
I'm crazy enough, and I want to program WCH52 in Pascal, The blink and GPIO /timers things are already done, USB will take more time and effort


CH55Xt is a 20 Pin version

width   Pin spacing
4.40mm   173mil   0.65mm   25mil

QFN-16   3*3mm      0.50mm   19.7mil   Square leadless 16   CH552P
MSOP-10   3.0mm   118mil   0.50mm   19.7mil   Micro Small Outline 10   CH552E

« Last Edit: October 08, 2019, 07:16:46 am by ebclr »
 

Online blueskull

  • Supporter
  • ****
  • Posts: 12406
  • Country: cn
  • Power Electronics Guy
Re: 20 cent USB MCU in MSOP10 package
« Reply #23 on: October 08, 2019, 08:40:52 am »
QFN-16   3*3mm      0.50mm   19.7mil   Square leadless 16   CH552P

If you can source it, I'd like to have a few. I think it's a unicorn part as of now.
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 1865
  • Country: 00
Re: 20 cent USB MCU in MSOP10 package
« Reply #24 on: October 08, 2019, 09:09:01 am »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf