I am working on a project where I am spinning my own controller using the ATMEGA328-PU chip. This is just a challenge project, I'm not intending to sell another flavor of Arduino.
I am having a problem with the USB interface. I’m using a Atmel MEGA8U2. So far, the best I’ve been able to do is get the Device Manager to see the MEGA8U2 chip.
Then using Flip 3.4.7 I load Arduino-usbserial-atmega16u2-Uno-Rev3 and the Device Manager recognizes “Arduino Uno on COM4” as does Sketch. This is similar to what my standard Arduino looks like. However, unlike with the Arduino, I am unable to upload my Sketch code. When I look at pins 2 and 3 on the ATMEGA328-PU chip with an oscilloscope, I don’t see any data activity. The LEDs attached to the MEGA8U2 chip only occasionally show activity, unlike the Arduino where I do see data activity on pins 2 and 3 and the LEDs are active.
Apparently I am making a mistake in programming the ATmega8U2 chip, not sure what. Does anybody sell the ATmega8U2 chip that could be plug-n-play? Adafruit cannot sell one to me, I've already asked. Digi-Key will load software onto an ATmega8U2 that I buy from them but I am not clear as to what software I need to supply them.
Or am I using the wrong chip, should it be the ATmega16U2? I'm using the ATMega8U2 because it is on an Arduino schematic.
UpLate:
should it be the ATmega16U2? I'm using the ATMega8U2 because it is on an Arduino schematic.
Paul, the copy of the UNO R3 schematic that I have here shows a 16U2 chip, not an 8U2.
I've attached it. I originally got it here:- Arduino UNO R3 schematic
Edit: This is possibly another clue:-
Then using Flip 3.4.7 I load Arduino-usbserial-atmega16u2-Uno-Rev3
Edit2: A bit more searching tells me that the earlier versions used an 8U2, but since the firmware you're loading is intended for a 16U2, that's probably the trouble.
Or use the same FTDI chip as on those modules. If you do that, get the chip from a reputable supplier such as Digikey or Mouser, because there are counterfeits out there for cheap and cause problems for Windows users.
Then using Flip 3.4.7 I load Arduino-usbserial-atmega16u2-Uno-Rev3
I used the atmega16u2 file as that was the only one that would load. Why that is the case I don't know. At any rate I've purchased at ATMega16U2 chip and will be trying that soon.
dmjlambert: The FTDI may work but the PCB has been spun with ATMega in mind.
Thanks for the replies and the help, I'll post the results.
UpLate:
I am working on a project where I am spinning my own controller using the ATMEGA328-PU chip. This is just a challenge project, I'm not intending to sell another flavor of Arduino.
I am having a problem with the USB interface. I’m using a Atmel MEGA8U2. So far, the best I’ve been able to do is get the Device Manager to see the MEGA8U2 chip.
Then using Flip 3.4.7 I load Arduino-usbserial-atmega16u2-Uno-Rev3 and the Device Manager recognizes “Arduino Uno on COM4” as does Sketch. This is similar to what my standard Arduino looks like. However, unlike with the Arduino, I am unable to upload my Sketch code. When I look at pins 2 and 3 on the ATMEGA328-PU chip with an oscilloscope, I don’t see any data activity. The LEDs attached to the MEGA8U2 chip only occasionally show activity, unlike the Arduino where I do see data activity on pins 2 and 3 and the LEDs are active.
Apparently I am making a mistake in programming the ATmega8U2 chip, not sure what. Does anybody sell the ATmega8U2 chip that could be plug-n-play? Adafruit cannot sell one to me, I've already asked. Digi-Key will load software onto an ATmega8U2 that I buy from them but I am not clear as to what software I need to supply them.
Or am I using the wrong chip, should it be the ATmega16U2? I'm using the ATMega8U2 because it is on an Arduino schematic.
Thanks for any comments, help, etc.
~paul
Did you program Optiboot into your 328P?
It sounds like you programmed your USB bridge fine, but you can't load a sketch because your 328P is still blank.
BigBobby:
Did you program Optiboot into your 328P?
It sounds like you programmed your USB bridge fine, but you can't load a sketch because your 328P is still blank.
I did work that angle. I put the chip I had purchased into my Arduino and it did not work. A little research and I learned I probably had a 328P without a bootloader. I purchased a 328P chip with bootloader which works in my Arduino. But it still does not work in my home spun PCB.
Also, I don't see any data activity (using an oscilloscope) when I monitor pins 2 and 3 of the 328P, but I do on the Arduino. I figured that means I am not getting data past the Mega8U2 USB chip?
UpLate:
Also, I don't see any data activity (using an oscilloscope) when I monitor pins 2 and 3 of the 328P, but I do on the Arduino. I figured that means I am not getting data past the Mega8U2 USB chip?
Probably means that. We don't have your whole story. Do you have a schematic for your board, and what is your confidence level that the PCB matches the schematic? Did you program both the ATmega16U2 firmware and using the same pins as on the Uno scheme? Any RX-TX LED activity?
U5 is not in place, I have the D+ from the USB connector (green wire) going to R7 and the D- (white wire) to R8. R7 and R8 are 22 ohms, not 1.00k on the schematic. R4 goes to pin 2 and R6 to pin 3 on the 328 chip which is not installed.
I have not seen data activity on DS2 or DS3 but then I wouldn't expect it if I am trying to program the Mega16U2.
I can confirm +5v on pins 4, 31 and 32. A Mega16U2 is installed, not a Mega8U2 per the schematic.
I do see 16 MHz on pins 1 and 2.
To reiterate, my current challenge is to promote the chip from (as identified by my computer) as Unknown Device with Driver Version 6.1.7601.18251. All attempts at Update Driver tell me "The best driver software for your device is already installed".
When I ground pin 24 (RESET) it causes the "Unknown Device" to disappear from the Device Manager listing and then it reappears.
Flip 3.4.7, with ATmega16U2, ATmega8U2 and various others selected could not open the USB device. That is where I am stuck.
I am using Windows 7 computer but it is my company machine which has various security enhancements installed, not sure if that is getting in my way. I do have a Macintosh laptop (mine, no security enhancements) handy and am wondering if using it would be a better approach?
I think the most graceful way to upload the program to the ATmega16U2 is to use ISP. The entire chip contents including the DFU bootloader get blown away from these chips seemingly at the drop of a hat; if you notice there are a fair number of posts from users in the Installation and Troubleshooting forum where this has happened. The Uno includes an ICSP header for programming the 16U2.
Yeah, I am beginning to see ISP as the way to go. Thing is, I'm quite surprised that setting up the ATmega16U2 via USB is turning out to be this sort of challenge. An ICSP header will require a re-spin of the PCB but it is what it is.
dmjlambert:
I think the most graceful way to upload the program to the ATmega16U2 is to use ISP. The entire chip contents including the DFU bootloader get blown away from these chips seemingly at the drop of a hat; if you notice there are a fair number of posts from users in the Installation and Troubleshooting forum where this has happened. The Uno includes an ICSP header for programming the 16U2.
I ended up using the FTDI chip. The folks at Sparkfun told me the Mouser part number they use for their product. I bought it, prototyped it up and it worked nicely, no programming needed.
That is great news. Would you like to post schematic and photos of the completed board to show it off? But be aware you could get comments like "you should have done this, or should have done that..."