![]() I have tested the code on an Arduino UNO and can see that when the 16U2 receives comms on pin 8, then the LED connected to pin 11 should light up. I even uploaded some code that transmits data to the ATMEGA16U2 constantly, when this occurs the ATMEGA16U2 should light up the Tx LED which is connected to it, but nothing happened. I pulled the USB cable (only partly for some reason) as that sometimes unfreezes the IDE environment (not this time).Īnyway, after I sorted the IDE crash I re-opened the software and reconnected the board.nothing! No "Windows detected hardware" sound! I have checked and I can still communicate and program the ATMEGA16U2 via the ICSP headers, everything works except for USB. I uploaded some code from Arduino IDE, and while checking stuff on serial monitor and attempting to make changes to the code the Arduino IDE locked up and wouldn't respond. Had a look and the only difference between LFuse being 0xFF vs 0圎F is that when set to 0xFF the bootloader runs for 61ms longer than when set to the stock 0圎F, so neither here nor there for my application.īack with another ATMEGA16U2 issue.basically the IC appears to not be working again for no obvious reason. Seems that once the IC is in full application mode (for lack of a better term) it's not possible to program the IC, so either a power cycle is needed or an ability for avrdude to perform a reset and get into the bootloader for programming (which the jumper provides provision for).įull board is working exactly as expected now.įor reference the fuses on a stock Arduino Mega ATMEGA16U2 is LFuse: 0圎F, Hfuse: 0xD9, Efuse: 0xF4 I noticed I could upload larger code if I powered the board on part way through the compiling so it was still in the bootloader once it tried to upload. Without it, it was only possible to program shortly after powering on and while the bootloader was running. ![]() Thanks for the info, but I figured it out, just needed to ensure the jumper for the reset enable was connected so that avrdude was able to send the reset command and start the bootloader prior to programming. What next? Mega2560r3 ATmega16U2 DFU Win8 USB - Installation & Troubleshooting - Arduino Forumįinally send: avrdude.exe -c arduino -P COM1 -b 19200 -p m16u2 -F -U flash:w:Arduino-usbserial-atmega16u2-Mega2560-Rev3:i, this will program the firmware with the one which comes with Arduino IDE.Īll steps work fine, no errors at all, but when I connect the USB cable I get nothing at all, PC just does not recognise it. Next send: avrdude -c arduino -P COM1 -b 19200 -p m16u2 -F -U efuse:w:0xF4:m -U hfuse:w0xD9:m -U lfuse:w:0圎F:m -U lock:w:0xCF:m, this should set the fuses, values taken from this thread here. The commands I am sending are as follows.įirst send: avrdude -c arduino -P COM1 -b 19200 -p m16u2 -t -e, this should remove any lock bits AVRDude sees the IC fine, communicates fine and can adjust fuses, etc over ICSP with no issues, but I am obviously doing something wrong. I just cannot for the life of me get the USB functionality with the ATMega16U2! I am able to communicate via ICSP and AVRDude. The "L" LED binks, and when you hold the reset button it stops blinking until released. However I have managed to use my Arduino UNO as an ISP to load the bootloader onto the ATMega2560, and it appears to work fine. However, I am having an absolute nightmare trying to configure the ATMega16U2! When I connect the USB cable I get nothing at all in device manager, as if it's dead. All supported components (clock crystals, capacitors, etc) are the same values used on the Arduino Mega. The PCB uses an ATMega16U2 and ATMega2560 just like the proper Arduino Mega does. I have just finished designing and assembling the first custom PCB. But as with so many of the 'official' drawings, pictures, and written material in the arduino web site, getting anything corrected or updated seems to be an impossible task.Hi all, I am working on a project based around the Arduino Mega2560. As such the pin mapping document that the OP first posted is most definitely in error, and in conflict with both AVR datasheet and the Arduino mega2560 schematic drawing and should be corrected. The 'official' Arduino schematic drawing for the Mega2560 does correctly call out these two pins as MOSI and SCK signals. The signals names SCL and SDA are not associated with those two pins in any AVR documentation. As MOSI and SCK are 'official' AVR names for two of the ICSP signals, there is no way they should be called out as SDA and SCL signals. Arduino pins 51 and 52 correspond to AVR mega2560 package pinĢ1 = PB2 (MOSI/PCINT2) and pin 20 = PB1 (SCK/PCINT1) respectively. They reffers to Serial Clock Line and Serial DAta, there is nothing in the convention that says these have to be I2C. Because the terms SCL and SDA are not used exclusively to describe I2C pins.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |