So, I've just had a new project programming a NRF52 and with almost all embedded projects it is great to have a way to easily debug some problems without setting up the whole debugging environment. Using the serial connection is usually how I do it, sometimes a LED is enough. Because of that I have a lot of USB to serial adapters. All of the ones I had had a USB A connector on it which made it hard to connect it to the development board, I had to have a extension cable or have the dongle hanging out directly on the laptop. Anyways it was a bit of a pain in the ass so I decided to buy a few adapters that had a micro USB connectors on the board so I could use the standard mobile phone cables. I decided to order CP2102 modules from ebay because they were really cheap (~1 - 2USD) and were not a FTDI part so I did not need to worry about FTDI bricking them with a driver update if someone deceived me and sold me fake functioning part.
The adapters came without the headers soldered on, so I did, connected the adapter to the development board and went on my merry way. The things I printed with the microcontroller were displayed on my terminal. But as you might assume if the story ended here I would not be writing this blog post.
A few days later I was checking something on the board with the multimeter and to my astonishment I saw that the USB to serial adapter had a 4.2V output. I disconnected the adapter really quickly from the development board :-). It was really weird, The output of the board was supposed to be 3.3V. Everything was functioning as expected because the NRF52 inputs had input protection that was doing its job, but really I was lucky that something did not burn up.
So what is the problem? I found the CP2102 datasheet and figured out that there are a few possible ways of powering the chip ( with an internal regulator, outside regulated voltage etc). I thought there was the problem and I started looking at the pcb and tracing part of the schematic. But it seemed that everything was laid out ok. Back to the drawing board...
So after some more time with a pen and paper and the board I saw another discrepancy. The reset pin was connected directly to the input VBUS (ie. USB 5V). It made sense that that could be the problem. If we have a voltage of 5V on the reset pin and that pin has input protection diodes to the internal VDD (which is supposed to be 3.3V ie. lower than the /RST pin voltage) current is going to flow from the /RST pin to to VDD through the protection diode which is now forward polarized. The voltage on the VDD is going to be the /RST pin voltage minus the diode forward voltage (~5V - ~.7V = ~4.2V).
What to do next, how to fix the mistake. The datasheet calls for the /RST pin to be connect through a pullup resistor to VDD (3.3V). It is also specified that the /RST pin is a open drain ("Device Reset. Open-drain output of internal POR or VDD monitor. An external source can initiate a system reset by driving this pin low for at least 15 μs"), so I thought the POR circuit would not work if the pin was left floating. But later in the datasheet, in the typical connection diagram, the pullup is listed as a option that will increase noise immunity, but that seemed that is not really required. Maybe it had enough internal resistance to function, but there was only one way to find out. I've cut the pcb trace connecting the /RST pin to the input capacitor. Connected the board to my laptop and measured the output voltage. BINGO! There was 3.3V on the pins. It seemed to fix things. I've connected to the development board and communication was functioning. So it seems one cut is the only thing needed.
What did I learn this situation. Don't expect anything from an ebay board and test everything! Actually I was really lucky that I did not burn up the NRF52 development board when I connected the faulty adapter. So beware of the CP2102 boards from ebay. It is really fascinating that they made so many of them and are selling them on ebay with this grave of a mistake.