Hello guys. I'm currently designing a standalone board based on the ATMega2560 and would like to be able to programm it via USB just like an arduino and also to be able to use Serial Monitor functions normally.
Doing some research i found out that i would need a USB-Serial converter and one of the most common is the CH340, but i'm finding its datasheet a bit confusing and i have a few questions on how to use it.
First is, will i be able to programm the board and use serial monitor? From my undestanding the RESET pin gets driven low by the CH340's DTR pin to enable programming, but how do you control the DTR pin to keep it high when using serial monitor?
Second question i have is, do i need to use a 12 MHz crystal for the CH340? Aparently depending on the model you don't need it but i'm afraid it is not going to perform as good as the one with the crystal.
Third question is about the V3 pin. I'm planning on using 5V exclusively on my board, so can i just leave de V3 pin floating?
The DTR pin is controlled by the PC (by the USB bus protocol), so this should work. It's the same as in some Arduinos (p.e. Nano) that use the FTDI chip as USB2serial solution. I don't know the CH340 well enough to tell you how to do it, but as many Chinese clones use that chip, it should work.
No clue about this, I never used that chip.
Does the CH340 have such a pin? Or do you mean the 3V3 pin of the Arduino layout?
Thank you for your answer! It wasn't clear to me that the DTR pin was controlled via usb protocol. Just connected the DTR to atmega's reset pin with a series capacitor in between so it should work.
For the second and third question: i decided to use the 12 MHz crystal and realized that i should pull the 3v3 pin to GND trough a decoupling capacitor.