CHUSBIE552

Showing posts with label UART. Show all posts
Showing posts with label UART. Show all posts

Monday, 25 May 2020

CHUSBIE552 The CH552 Development board

For a few years I have been looking at different MCUs with USB capabilities in most cases there are not many sub $1 parts that fit the bill.

If you want something small and discreet that does a few USB functions there isn't much around, normally the barrier to entry on these types of MCUs 8 bit and 32 bit included is over the $2 mark. The issue start to become when costing the bill of materials $2 on the BOM becomes $8 by the time you get to retail price.

There are a few low cost MCUs out there like the range from STC or Nuvoton once you add a USB transceiver the cost seems to double.

I know it sees to be very focused cost but with companies form overseas being able to produce USB devices with the low retail price there must be some solution out there.

My over all goal is to demystify USB and develop a platform that gives developers confidence to develop USB devices without large overheads or in some cases complicated stacks that are beyond comprehension.

I have spoken about my admiration of the CH55x range from WCH that are a series of ultra low cost micro controllers with USB in some of the range is down in the $0.25 category in volume. Which is unbelievable a full capable MCU for the same as a discreet logic IC.

As well as the USB2.0 transceiver and the E8051 processing core itself they come with a resonable array of peripherals as well 2 x UART port, SPI  , 4 channel 8 bit ADC and 10k to 64k flash space in the case of the CH559.

There are a few dev boards out there for the CH55x range mainly from electrodragon with their CH55x range of boards. They are a nice range but I feel they have a couple of  points that I would love to see improved on. 

This is why I decided to start the CHUSBIE range starting with the CHUSBIE552 based on the CH552T or CH552G a lower cost less IO version.


With the CHUSBIE552 I have added onboard functions that I think will be the most useful to a developer like: 
  • onboard reset and bootloader buttons
  • RX and TX indicator LEDs
  • sensible pin-outs with pins and ports in order
  • optional landing for external XTAL crystal for precision timing applications 
  • Power indicator LED

I would like to see a general adoption of the CH55x range chips in a similar way to the ESP8266 and ESP32 (notably neither of which have native USB which in my humble option would be a killer addition).

I want to work on the software stacks to make them more friendly for a start making sure the Chinese comments are translated to English for the examples especially the USB ones. My point is that USB doesn't need to be this mystical black box that can't be easily accessed by most hobbyists and makers.

So far in my research I found firmware for USB CDC device, USB HID device and USB JTAG device all of which i am trying out to incorporate into a master repository.

Updates to this project can be found here:

https://hackaday.io/project/171543-chusbie552-ch552-development-board

I hope to have the completed board available on my Tindie store here:
https://www.tindie.com/stores/rabidselectronicsemporium/




Monday, 6 July 2015

Hacking the RyanTecK Debug Clip

I recently Acquired a RyanTeck Debug clip and in a previous blog post I assembled and set it up.

It work brilliantly with the Raspberry Pi but I would like to use it in some of my other projects and put it through its paces or at least the USB bridge IC the MCP2221 by Microchip.

The first thing I want to do is hit the data sheet and see what other functions the MCP2221 is capable of.

OK, Ryan Tech I have to admit this chip is really cool I hadn't noticed that it has an onboard ADC as well. This is all on top of the standard GPIO, UART and I2C capabilities. 

Hack #1 


Soldering a header into the the debug clip. This is mainly so I am able to use jumper wires to hook it up to other devices. 

For me I find female socket most useful for the stuff I like to mess with. This just allows to make the connections  mainly the first one being connecting the power so the debug clip can run without being attached to the raspberry pi.

Hack #2 


Powering The debug clip without a raspberry pi. The Debug clip has a voltage fail safe mainly for the Raspberry  Pi. The MCP2221 runs from the 3v3 voltage rail of the RasPi but this also means it will not run on its own. 



This is fixed by using a a jumper wire between the 5v connection and the 3v3 .

WARNING: This will mean the debug will be running at 5v do not connect to the RasPi's or other 3v3 devices GPIO It could damage it. This is why I use the socket and jumper wire without soldering at the moment. 

Hack #3



This is a bit of a dirty hack to get the 3v3 power onboard. I have a few  AP1117 LDO 3v3 voltage regulators. I'm going to hack one onto the underside of the board this will give me a selectable  3.3volt supply.


  

A few flying decoupling caps as recommended in the application notes. A bit of jump leading on the to and all is well.


Now the UART is running at 3v3 again without a raspberry pi. and now running with a Ublox Neo-6M GPS module.



With some nice tangible data returning to putty. I'm doing this indoors so I don't have a GPS fix but the data connection  work very well.

Further hacks


There will be more hack coming with the debug clip like changing its function and using the I2C interface, and this little device is sure to make an appearance as useful tool in future posts.

Happy Hacking  :)









Thursday, 18 June 2015

Ryan Tech Debug Clip (Assembly)

I was passed a Ryan Tech Debug Clip, a little board that allows you to connect to a Raspberry Pi via USB and the UART connections on it's GPIO this was due a good friend of mine Gadgetoid  had 2  from backing the Kickstarter.

I got interested in this watching Gadgetiod solder up the realising that it wasn't just another FTDI FT232R (being honest no happy with them after the hole bricking your device scandal, long story) or a Prolific PL-2303. It was using something unexpected Microchip MCP2221.

This little chip is not only a basic USB to UART bridge it can also bridge to GPIO, I2C and a tonne of other functionality. This really peaked my interest but that will be for a later blog post. This post i'm looking the assembly and what comes in the kit.

The Debug Clip clip comes in kit form requiring soldering together don't be too put off by this as all the joints are well spaced and it has plenty of guidance on the PCB's silkscreen.


In the kit is:

  • PCB 
  • A USB Type B socket 
  • A two pin header with jumper 
  • A green and a red LED
  • A diode 
  • Two Resistors of the same value 
  • A fuse
  • And the MCP2221 IC itself

One thing to note there was ESD foam protection on the legs of the IC. The foam would offer some electrical protection but the main reason would be to prevent the legs from being damaged in shipping.


The kit feels well thought through, the silkscreen on the PCB makes assembly even easier. There is a clear assembly guide provided by Ryan Tech but the Silk was so clear I didn't even need to look at it.

Assembling 


There are only a few things to make sure the orientation is correct the IC, the diode and the two LEDs.


I started assembling mine with the diode and resistors the have the lowest height to the board and folded the legs outwards before soldering. Then solder and trim with some side cutters.


The IC itself was next in height order it always worth making sure that the notch on the IC matches the pattern on the silkscreen.


Next I decided the the USB socket would be the best as it would create a flat surface to rest on this help with supporting the header when soldering that in, making sure to solder one contact on the header first and then reheat the join and push the part flush with the PCB (Mind you fingers it could get hot) 

Then it was onto the LEDs I chose the green one for RX and the red for TX. The positions are well marked with a little + for the positive side, which is the longer of the two LED leads.


The last component I assembled was the fuse then all was done for the moment.


All ready to plug into your Raspberry Pi and PC's USB port.

Installing drivers 

The Debug Clip's driver are not available in windows update at the moment but can be easily downloaded from the Microchip MCP2221 Product page.


If the device is working correctly it will appear in your device manager as other devices -> MCP2221 USB-I2C/UART Combo. Please note that the Clip will not work unless placed on a the Raspberry Pi's GPIO header, as it uses the Pi's 3.3v regulator to make sure the UART output is 3.3v so it doesn't damage the Pi. Also make sure that the Pi is on. 

So now go ahead and download the appropriate driver for you. I'm running a Windows 8.1 laptop so mine is the Windows Driver & Installer. 

Once downloaded open the archive and extract the files.



Navigate through the Driver Installation Tool and relevant 32 or 64 bit version and right click on the .inf file and select install from the menu. ( for me the installation tool didn't work )



 Then the device should appear in your device manager. This would be a really good point to  take note of which COM port the Clip appears on. (In my case it is assigned to COM10).

Using the Debug Clip

You are going to need a remote terminal program if you don't have one already, I use Putty and would recommend it for most users. I can be downloaded form here.

Once you have Putty running click on the Serial radio button and enter your COM number that you noted earlier and set the speed to 115200.

  

After clicking open a terminal window should appear and you will be asked to login with the normal user name a password.


Then you can just use it as though you are on the Raspberry Pi's command line.

I like the Debug Clip and it is nice to have the blinking green and red LEDs as the data is going back and fourth. It makes a good alternative to the FTDI or Prolific based boards that are out there. the assembly we very straight forward with no real issues. I give it 4 sparks, 3 for the device and and bonus for hack-ability. 



Then next Post do will be about modding and hacking the Debug Clip.