1

I have made a custom board based on the Arduino Due but have some problems with the Serial communication with the 16u2 chip.

i have usb connection with the 16u2 chip and was able to load the arduino-due usb serial hex over the usb port. the usb now shows up as arduino com port. now when i try to load a sketch it says No device found on COM12. the SAM chip is erased but it can't load the new sketch.

now when i load a sketch with a simple serial print at 115200 over the native port. the SAM chip is programmed correctly. when i open the serial monitor i receive data but it is garbage! the garbage is always different. the sketch is at 115200 and the monitor also at 115200.

this would explain why it can't upload a sketch with the 16u2.

the same sketch on a original arduino due works fine.

the transmit an receive led are blinking.

What would cause this garbage in the connection where do i start looking?

  • SAM chip not running at the speed you expect it to run at? – Majenko Apr 5 '16 at 10:52
  • Tip: Output a constant stream of "U" through the serial port. Measure the resultant frequency on the TX pin (before it gets to the 16U2). Double the frequency. That is the actual baud rate it's transmitting at. Compare that to what you expect it to be (115200). Any difference can indicate a difference in source clock speed. – Majenko Apr 5 '16 at 10:57
  • You mean the serial speed or the actual chip speed? – Jeroen Vd Veer Apr 5 '16 at 11:04
  • The actual chip speed determines the serial speed. If that is wrong the serial will be wrong. By analysing the serial speed you can back-track that to the chip clock speed. – Majenko Apr 5 '16 at 11:05
  • 1
    Incorrect crystal or incorrect fuse settings. Testing the TX is a good way of measuring the clock speed. You get a ratio of what you want and what you measure, then apply that ratio to the clock speed you want - the result is the actual clock speed. – Majenko Apr 5 '16 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.