Close

USB Bootloader and Serial

A project log for SubPos Ranger

The SubPos Ranger allows you to accurately measure distance or obtain your position indoors for all hobbyist robotics applications.

BleckyBlecky 05/30/2016 at 13:390 Comments

Not a huge update, but I've just been getting the USB bootloader and serial interface working with the ATXMEGA1284U on the ranging board, so the firmware can be updated once released and you don't need a USB->UART adapter to configure it:

If anyone is doing any XMEGA work with USB and wants to know the different clock options, this post with ASCII art helped immensely - http://www.avrfreaks.net/comment/829504#comment-829504


In case it gets removed, here is a copy of it for posterity:

The best way to do this is to:

a) Enable the 32MHz RC oscillator, using the 48MHz 
calibration values in the signature row. b) Enable the DFLL on the 32MHz RC oscillator, using
the USB Start Of Frame as the reference. c) Enable the PLL and connect it to the internal 2MHz
RC oscillator to upscale it to your desired system frequency. This will give you a rock-solid, always synched to the
USB bus 48MHz clock with no external crystal required,
as well as a less accurate PLL scaled system clock for
the CPU (which you can choose to also DFLL calibrate
from a clock source). ASCII art! _______USB SOF Reference_______ / \ [DFLL]==[32MHz RC Osc @ 48MHz]-->[USB]<-->(PC) [2MHz RC Osc]-->[PLL]-->[CPU] Or for better accuracy with a fast XTAL: _______USB SOF Reference_______ / \ [DFLL]==[32MHz RC Osc @ 48MHz]-->[USB]<-->(PC) [XOSC]-->[PLL]-->[CPU] Or better accuracy without crystal: _______USB SOF Reference_______ / \ [DFLL]==[32MHz RC Osc @ 48MHz]-->[USB]<-->(PC) [Int 32KHz RC Osc] | | [DFLL]==[2MHz RC Osc]-->[PLL]-->[CPU] Or better accuracy with a 32KHz crystal: _______USB SOF Reference_______ / \ [DFLL]==[32MHz RC Osc @ 48MHz]-->[USB]<-->(PC) [TOSC] | | [DFLL]==[2MHz RC Osc]-->[PLL]-->[CPU] Good accuracy with low power consumption, but slow system
clock (24MHz): _______USB SOF Reference_______ / \ [DFLL]==[32MHz RC Osc @ 48MHz]-->[USB]<-->(PC) | [DIV /2]-->[CPU] Low power consumption with a fast enough (up to 16MHz)
external crystal: _______USB SOF Reference_______ / \ [DFLL]==[32MHz RC Osc @ 48MHz]-->[USB]<-->(PC) [XOSC]-->[CPU]

Discussions