Workshops/Minimus

Minimus USB Workshop Notes

 * PDF of various bits from the web (to be uploaded later)
 * Some good images of layout
 * 16mhz clock (crystal on board)
 * 16k of program memory, 512 bytes of RAM


 * Pins all brought out
 * Pins can be used for IO (21 pins in all) digital IO or special functions (timers/USARTS/PWM)
 * No DAC, but there is an ADC
 * Missing A2D and I2C interface (byte orientated interface)
 * Does have SPI

Physical Hardware

 * 2 buttons, hardware boot and generic button (connected to PD7)
 * if both held down on boot goes into bootloader
 * Mounting options
 * Pins for breadboard
 * pins rested on it - Absolutely useless
 * Socket pins
 * Wires

Power

 * Has an onchip 3.3v regulator
 * Typically powered by 5v from USB
 * 5.5v to the middle pad of the three is tracked under the resist.
 * To get a seperate power feed, can just cut the USB pin that supplies 5v (done by someone at LHS)
 * If you ask the HUB for it, the USB hub will supply up to 500mA, otherwise, by default, you only get 100mA
 * Device has no voltage protection to stop you pumping power into the USB

Memory
The Minimus AVR has 16K of Flash memory for program storage. Program is in 16bit instructions. An area of flash memory can be dedicated for a bootloader. As shipped the Minimus AVR has only a 4K byte DFU bootloader preprogrammed in Flash. Since memory size is small on Minimus AVR always try the optimise settings for size in the compiler and the linker. To save RAM and Flash keep text strings short, and consider placing in program memory only.


 * Teensy board has had the bootloader recoded into 0.5k, but otherwise the bootloader is 4k of your available 16k in flash.
 * Bootloader can be recoded
 * If the program switch is held down, it will run the application loaded in the bottom of memory. If not there it will just go back into the bootloader.

Brief Introduction to USB

 * USB Hosts/Device/OTG
 * Host is normally computer/laptop/tablet
 * Device is normally mouse, mass storage, camera
 * OTG is determined by a pin
 * ASYNC
 * no clock
 * 2 pin, balanced differential
 * Half duplex - everything is requested by the host, so no interrupts, all are polled by the host
 * 127 devices on a host using Hubs
 * Hubs are complex devices
 * Involved in enumeration devices
 * Can change speeds on ports
 * More intelligent than a simple broadcast device

USB Connectors

 * A and B connectors
 * A is printer type,
 * B is big fat spade type
 * 4 pins
 * 2 data and power
 * power pins are longer so engage first to stabilise
 * Two types of plug for mini connectors (mini/micro)
 * Micro is same width but slimmer
 * Between an A and B type connector difference is shape
 * Micro is standard for mobile phones
 * Mini is standard for peripherales
 * Mini B is more square
 * Mini A is more rounded
 * Can get AB connectors that will fit both
 * Mini/micro are 5 pin connectors.
 * 5th pin tells host what device is
 * Mini B connector doesn't need 5th pin to tell it what the device is
 * USB 3 is full duplex
 * Connectors are backwards compatible

USB Speeds

 * USB2 has 3 speeds
 * Low speeds is 1.5Mb/s
 * Aimed at keyboards, mice etc
 * Full speed is 12Mb/s
 * High speed is 480Mb/s
 * Has to be "high speed compliant"
 * Aimed at webcams, mass storage etc
 * Minimus will do Full speed, but not high speed

Plug'n'Play

 * Devices are self documenting
 * Descriptors tell the host what the device is
 * Allows the host to load the correct drivers and what not
 * Means you have to write descriptors to tell the host what the device is
 * There are a number of classes of device
 * Hub
 * Mass storage
 * HID - Human Interface Device
 * Can have multiple descriptors
 * Device X, HID Device, Have additional buttons x/y/z
 * Serial ACM
 * Vendor ID's and Product ID's are a pain (Vendor ID's are ~$2.5k and come with a contract dictating what you can do with it)