Atmel Start example : USB CDC Echo

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everybody. I am currently trying to implement an USB stack on my SAML21J18B MCU, which is why I am trying to make the USB CDC Echo example work (adapted to my MCU architecture). I would like to know if there is any drivers I have to install on Windows in order to make it work, or if the Atmel Start example is simply broken.

On the other hand, I tried the ASF example of the sam-ba bootloader (which also implements the USB stack), and it works perfectly.

The reason I want to use the Atmel Start example project and not the ASF example project is because I want to implement the stack with the Atmel Start functions, because my whole project (already coded) is using those functions and not the ASF libraries.

 

Thanks for your support, and have a good one.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Luc-- wrote:

I would like to know if there is any drivers I have to install on Windows in order to make it work,

I'm not sure.  I have a Windows 10 installation here that communicates with my Xmega using CDC.  I don't think I've ever installed anything from Atmel on this Win10 installation.

 

When you plug in your CDC device, you should see an entry under Ports in Device Manager.  You can then connect a terminal emulator on the indicated port.  I happen to be using port 16.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi steve17, thanks for your quick answer. Well the problem is that if I go to the device manager, I see my peripheral but Windows prints the following :

 

It could come from the project, but it also could come from my hardware (clocks etc.) I guess...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's an interesting display.  I never looked in control panel - devices for error messages.

 

The Device Descriptor Request Failed seems to indicate the problem is in the device.

 

I agree with your analysis.  Either the USB driver did not try to send the device descriptor, or the USB hardware clock is too inaccurate.

 

My USB experience is only with the Xmega. The Xmega USB hardware requires a 48 MHz clock.  I did a quick test and found that the USB would work with a clock frequency error of up to 4%, although I wouldn't recommend that much error.

 

The Xmega can generate a proper clock 2 ways.  It can generate a clock internally with an error of less than 0.5% at room temperature and an error less than 1.5% at temperature extremes.  So this is what I use.

 

It can also produce an accurate clock by synchronizing it with the SOF (Start Of Frame) USB packets sent by the host.  This apparently works but I haven't played around with it much. 

Last Edited: Thu. Jan 12, 2017 - 01:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok. I will look into that clock's concern.

 

I tried the project using the SAML21J Xplained evaluation board, and this is the same problem. So... A bug with the example project, with the evaluation board... To me, it looks a lot like an error in the example's code, or a missing driver.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Possibly the same problem as http://www.avrfreaks.net/forum/a...​ in which case I have posted solution. 

 

David

 

<edit> probably -> possibly

 

Last Edited: Thu. Jan 12, 2017 - 05:25 PM