Author Topic: Need help with Atmega32U4 project  (Read 2268 times)

0 Members and 1 Guest are viewing this topic.

Offline AlbertoRTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Need help with Atmega32U4 project
« on: March 16, 2021, 10:39:56 pm »
Hello everyone, I am new to the forum and would like some help with a project I am working on.

I'm using an Atmega32U4 to use as an Arduino and a FE1.1S USB hub. I decided to only use one pin of the 32U4(I know, what a waste) to control some LEDs and use the FE1.1S hub so that I can use another board for buttons. It is my first time making a project with the 32U4 but I have used the USB hub in the past with success.

I managed to flash the Arduino Leonardo bootloader to the MCU with an Arduino Uno but my problem is that I can only get it to work sporadically. It then stopped working and I could not upload any code, it would begin to upload but then disconnect. I did noticed that I connected pin 21 to the capacitor instead of pin 26 on the USB hub. I don't know if connecting the wrong pin to the capacitor is what is causing the problem or if I connected something wrong on the PCB.

I will attach the pictures of the schematic and the layers of the board(Please excuse the amateur schematic and routing :D). Any help is greatly appreciated.
 

Offline Electro707

  • Contributor
  • Posts: 26
  • Country: us
Re: Need help with Atmega32U4 project
« Reply #1 on: March 17, 2021, 07:28:51 am »
As for the capacitor, pin21 is connected to pin26 thru a trace anyways.
Is the 32U still programmable thru the ISP header after not being able to upload to it (I'm assuming when you said that you meant thru USB)
A schematic would be nice (isn't included with the post)
 
The following users thanked this post: AlbertoR

Offline AlbertoRTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Need help with Atmega32U4 project
« Reply #2 on: March 17, 2021, 03:01:46 pm »
I knew I forgot something. Sorry about that.

I also forgot to mention that when I first connected the board(no Arduino bootloader) through USB, it kept connecting and disconnecting and saying that the previous device malfunctioned. I don't know if that is normal behavior or if that is also a problem.

Yes, I was trying to upload code through USB. I can burn the bootloader through the ISP header but can't upload code through it, I keep getting an error.
 

Offline Electro707

  • Contributor
  • Posts: 26
  • Country: us
Re: Need help with Atmega32U4 project
« Reply #3 on: March 18, 2021, 06:01:30 am »
Alright I'm going to assume that the USB hub chip is wired all right on the schematic as you've said you've used it beforehand (I'm not personally familiar with that IC).
The only thing that I can see with the ATmega32 is the ground connection to PE2. Just looking at the Arduino Leonardo schematic for reference they use a 10k pulldown, so that might be a possibilty for some trouble (altough I doubt it).
You said before you even uploaded the bootloader you computer was acting strange with the USB device, and I see some WS2812s on the side of your schematic. Perhaps a current draw issue (usb could only support 100-500mA supply nominally)?
 
The following users thanked this post: AlbertoR

Offline AlbertoRTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Need help with Atmega32U4 project
« Reply #4 on: March 18, 2021, 04:09:58 pm »
Hmm, that could be a possibility but can four LEDs really draw that much current? I'm using PL9823 LEDs. From what I've read, it looks like they're just WS2812s but in a different package.
Only thing I can think of now is that the USB hub chip got damaged when I was soldering it on or I just got a bad one. I'm gonna do another board with a new FE1.1S and without LEDs and see if it works. I'll report back. Thank you for the help.
 

Offline djerickson

  • Regular Contributor
  • *
  • Posts: 83
  • Country: us
Re: Need help with Atmega32U4 project
« Reply #5 on: March 21, 2021, 01:49:21 pm »
I too like the MEGA32U4. My LeoLed panel meter project https://djerickson.com/leoled/ uses it. You can view my PCB layout there, but it is in Diptrace.

Your grounding and ground plane look good. But your power routing is not ideal. I suspect that is your problem. I don't like to see 10 thou traces for VCC, because they have high inductance.  And for a digital design, star power (traces run back to a common point) is not necessary. For low current VCC on 2 layer boards,  I generally use a single 20-30 thou trace that meanders around to connect all power loads.  And bypassing should be near the IC, not over an inch of 10 mil traces away. It is a good idea to use one bypass cap per power pin.

Try adding 1 or 2 bypass caps near the IC power pins and with short grounds. 

Hope this helps,
Dave Erickson
 
The following users thanked this post: AlbertoR

Offline AlbertoRTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Need help with Atmega32U4 project
« Reply #6 on: March 21, 2021, 04:49:43 pm »
I tested a new board without any LEDs, just the MCU and USB hub. It was still connecting and disconnecting when connected to USB but I was able to upload the bootloader with the Uno. When it finished uploading the bootloader, the MCU kept connecting and disconnecting as an Arduino Leonardo. I disconnected everything from the ISP header and connected it to USB but Windows says it doesn't recognize the device.

I'm going to bypass the USB hub and see what I get.
 

Offline AlbertoRTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Need help with Atmega32U4 project
« Reply #7 on: March 21, 2021, 05:39:53 pm »
Got an update. No connecting and disconnecting when I first plugged it into the computer and I was able to upload the bootloader just fine. Disconnected everything from the ISP header and connected it again to USB and it popped up as Arduino Leonardo  :D. Soldered the LEDs to the board and uploaded code to it to make sure it works and it does! Everything is working fine now.

It looks like I either connected something wrong on the USB hub or the MCU doesn't like being connected to the FE1.1S. I'm going to try and see why it's not working with USB hub. I'll report back if I find anything. Thank you to everyone for the help. I'm still going to revise the board and make changes to the routing and placement of components.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->