Quantcast
Channel: Arduino Forum - Latest topics
Viewing all articles
Browse latest Browse all 15544

Resetting microcontroller using MCP2221's GPIO pin

$
0
0

Back story: Thunkit Electronics once made a 100% through-hole version of Arduino UNO called Makit THT. They use MCP2221 as it's the only USB - UART converter chip that comes in a DIP package. These boards sold out long time ago. Since it's open source hardware, I want to make a batch for myself with one improvement.

As you know, some cheap Arduino UNO clones typically use the CH340G USB - UART chip. On those boards the DTR pin on the CH340G is connected to the RESET pin on the ATMEGA microcontroller by a 100nF capacitor. As I understand this triggers a reset before serial transmission so bootloader can do the flashing.

Unfortunately MCP2221 does not have the DTR pin (or any of the RS232 control signals). As such, to flash the Makit THT you'll have do the "press RESET button at the right time" trick every time. MCP2221 does have 4 GPIO pins interface-able through USB, maybe I can use one of them to generate the reset signal?

In terms of hardware, this is the modification I made to the original Makit THT:

The diode is there to turn GP3's push-pull output to open-drain (because RESET has external pull-up). Is this the right way to do it?

On the software side, I need a way to automatically pulse GP3 when I click the "upload sketch" button in Arduino IDE. There is this Python library for the MCP2221 chip so I have some rough ideas of how to interface with it. But how do I modify the upload behavior of the IDE?

Thanks!

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 15544