Self-made Atmega328 board can't connect to arduino IDE

I designed a custom PCB using Atmega328, CH340G, and USB type B. The goal is to make custom MIDI controller type devices using the Atmega328 MCU with the USB to easily upload new code as I continue to work on developing these MIDI things. I ordered a sort of "test board" to make sure the USB uploading and connection works so I could work out any potential issues there (this is new and scary to me) before adding all the fancy MIDI stuff.

So I got the board yesterday, soldered it up, and it won't show up in the arduino IDE under ports. Going to Device Manager, it shows this message for the device. I have the CH340G driver installed. Pointing windows to the driver is also hopeless, windows tells me "the best driver is already installed".


USB Device Failed2

I'm wondering if there's something wrong with the board design or something dumb I overlooked? What's preventing me from connecting this to my PC and having it recognized in the arduino IDE?

Here's the board design and schematic in case I messed up there somewhere.



For a start the Capacitors on the crystal should be around 10pF, You also have no pull-up on the 328 RESET pin (But this is unrelated to your error).

Have you double checked your soldering? We had a member who had over 25 replaies before they saw a solder bridge!

What is the default state of the TX on your MIDI module? If it is fighting with the TXD line on the processor that could be a problem.

Yes, as mentioned, add a pull-up to the reset pin.

Edit

Your power LED has a series current limiting resistor ?

You should avoid running traces between crystal pins.

I could be wrong here, but looking at USB breakout boards, and from my memory of a recent home brew breakout, I think you may have the D+ and D- signals the wrong way round on the USB connector.

You are wrong, they are correct.

Perhaps I should clarify that i'm referring to the PCB rather than the schematic. Looking at a Molex drawing for that type of USB connector, pin 3 (D+) is the top left pad when looking at the PCB footprint on the board layout posted by @bionicleboy101 . The track from that pad looks to be routed to pin 6 of the CH340G - which is D-. That would suggest that the footprint for the USB connector is wrong.

Or maybe my caffeine levels have dropped below optimal level. :grinning:

This is it, omg.
USB type b pcb outline

Pin 2 of USB type B should connect to Pin 6 of the CH340g, and 3 goes to 5. However, on EasyEDA, the ratlines when I exported the schematic were wrong.

Glad I at least know what it is now. Time to order a new board! I'll be adding some other changes recommended here as well

Yes, I forgot the resister for the LED. I held a basic blue LED (can handle up to 6 volts) to the pads to confirm power when debugging this. I didn't realize SMD LEDs are all kind of 3.3v range until too late lol. Idk if traces between the crystal pins will really hurt anything, but honestly some padded vias would be neater anyway. Thanks for the advice :slight_smile:

Oh, I totally forgot about this, but now looking back at Dronebot Workshop's video on atmega328s, this is mentioned. So this isn't causing the issue, but ultimately would cause other problems uploading to the atmega328, right?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.