Arduino DFU bootloader serial output speed wrong?

An advanced Arduino-compatible board with ATmega1284P and ATmega32u2 MCUs for experienced users. More RAM than a Mega, but in a convenient Uno-style form factor. [Product page]
Post Reply
kasperskaarhoj
Posts: 1
Joined: Wed Aug 19, 2015 9:48 am

Arduino DFU bootloader serial output speed wrong?

Post by kasperskaarhoj » Wed Aug 19, 2015 10:02 am

Hi there, hope this is not an unfitting question in this context, but since I have looked to the Goldilock design for this work, this is where I'm coming back to... :-)

I have developed an Arduino clone (1284P based) and using a typical ATmega16U2 based design (like used on the EtherTen) for the USB-2-Serial part in the schematic. I can successfully DFU-program this with a .hex file (using one of the standard files for Arduino Mega or Uno rev 3), but when I reset everything and try to open the serial monitor I get garbage and when I try to send information from the Serial monitor, it gets passed on to the MCU after the ATmega16U2 at 1/8 of the selected serial speed (checked with Oscilloscope).
For instance: I open the serial monitor, set it to 115200 (the speed which I know the MCU is communicating at), I put my oscilloscope on RX and TX between the MCU and the ATmega16U2 and verify that I see 115200 baud communicate from the MCU. On the serial monitor I see only garbage though and when I send a few letters back to the MCU I see them on the RX line as roughly 14600 baud, 8 times less than then 115200 baud I was expecting.
Does anyone know what could cause this behaviour?

Hope someone can point me into the right direction. Thanks!

- kasper

andrew
Freetronics Staff
Freetronics Staff
Posts: 978
Joined: Sun Jul 14, 2013 7:06 am
Location: Melbourne, Australia
Contact:

Re: Arduino DFU bootloader serial output speed wrong?

Post by andrew » Fri Aug 21, 2015 6:00 am

To be honest if you're just using the ATmega16U2 for USB to serial, it would be easier to go back to an FT232 or other USB-serial chip.
The original Goldilocks designer has done this with his later revisions:
http://feilipu.me/2015/06/29/goldilocks ... ue-part-7/

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: Arduino DFU bootloader serial output speed wrong?

Post by angusgr » Fri Aug 21, 2015 6:47 am

Hi kasper,

In addition to John's advice, you might want to check the AVR fuses are set correctly on the ATmega16u2. There is a fuse which divides the clock by 8. I actually would have thought that this would break the USB support but it's possible it doesn't, that clock may run independently. Worth looking into at least.

I don't think you can get/set fuses from DFU mode, you'll need an AVR ISP programmer like our USBASP to check them.

Angus

Post Reply