Tuesday 28 April 2020

The CH552 MCU

There is a collection of super low cost very capable MCU's on the market but I find myself fascinated with a manufacturer based In china called Jiangsu Heng Qin Ltd. (WCH)

WCH offers a range of hardware including the CH340 USB to UART converter IC the CH438 which is a parallel interface to 8 UART ports and an extensive range of 8 and 32 bit MCU's.

The one I want to look at currently is the CH552 MCU this chip is an 8 bit MCU based on the 8051 instruction set with an E8051 core but the most interesting point is that it has an extensive peripheral set including a USB controller.

These are the onboard peripherals
  • Built-in 16KB Code Flash, 1KB XRAM, 256B iRAM, 128B DataFlash, support byte read and write;
  • Built-in BootLoader, support USB and UART ISP, provide ISP download library;
  • Built-in USB controller and USB transceiver, support USB-Device mode, support USB type-C master and slave detection, support USB 2.0 full speed 12Mbps or low speed 1.5Mbps. Support up to 64 bytes of data packets, built-in FIFO, support DMA;
  • 3 timer / counter, support 2-channel capture and 2 PWM;
  • Provide two full-duplex UART, all support high baud rate communication, UART0 is a standard MCS51 serial port;
  • Provides SPI communication interface, built-in FIFO, support Master / Slave mode;
  • Provides 4-channel 8-bit A / D converters;
  • Supports 6-channel capacitance detection;
  • Supports four reset signal sources, built-in power-on reset, support software and watchdog time-out reset, selectable pin external reset;
  • Built-in 24MHz clock source and PLL;
  • Built-in unique ID number;
  • Package: TSSOP-20, SOP-16, MSOP-10.
There is one downside to how the CH552 operates the 'Code Flash' as they call it is only writable about 200 times. This section of the flash is read only once your program is uploaded. To account for this there is a section of the flash memory called 'Data Flash' this is able to be written over 1 million times which makes it great for storing variables that you wish to keep after the power goes off.

There are many other little surprises as you dig into this component once you start looking into the clock selection register you find out that this little MCU is quite capable of running up to 32Mhz from the internal oscillator.
The device also has a built-in USB and UART bootloader which can be accessed by pulling P3.6 of P1.5 High when the device resets (depending on your configuration).

This chip comes in a variety of packages with different numbers of pins exposed. These include a SOIC16 package the CH552G, a  tiny MSOP10 package the CH552E, and a TSSOP20 package which has all the available IO and functions exposed the CH552T.



There is a header file and examples available from WCH which help to get started including examples of how the USB device works. I would like to in time make this far more user friendly and much more generic.
There are a couple of software stacks fro the device: (for C51 in keil) (for SDCC )

As well as the Official ISP tool there is also an open source programming tool:

The Store

I personally have a lot of love for this little USB hero and want to give it the exposure and credit it deserves. So to that fact, I have decided to stock it on my Tindie Store Rabid's Electronics Emporium.

I also have a Development board range on the horizon called CHUSBIE the I hope that you all grow to like this chip range as much as I do and I will do my best to make it available in many forms and a reasonable cost.
The overlaid packages look a little odd this is so the same PCB can be used for either the CH552T or G. I will keep you up to date on how that goes.

No comments:

Post a Comment