DIY mechanics and electronics projects

DIY mechanics and electronics projects

Google Search

WebThis site

Buy me a Beer :)

This web page is run by me on my spare time. If you find any of the information useful and worth a couple of bucks, I will be very grateful if you buy me a beer by donating a small amount using the PayPal link below :)

Amount: 

XMEGA, the Perfect Robotics Microcontroller? Print E-mail
User Rating: / 1
PoorBest 

xmegaAtmel recently introduced the XMEGA AVR devices. These devices give a nice addition to the AVR family, introducing several new features ideally suited for robotics. Is this the perfect microcontroller to be used as a robotics brain?

Compared to the renown mega AVR devices the XMEGA devices further increases the performance by allowing lower voltages, lower current consumption, higher frequency and a large amount of high end analog and digital peripherals.

MCU features

  •  32 MIPS @ 32 MHz
  •  36 - 78 General purpose IO pins
  •  Voltage range 1,6-3,3V
  •  Several Internal Calibrated Oscillators, including PLL
  •  16KB - 256KB Flash program memory
  •  Run time clock source selection and prescaling
  •  2KB - 16KB Static RAM (SRAM) data memory
  •  Built in reset circuitry, including brown out detection
  •  1KB-4KB memory mapped page and byte accessible EEPROM memory
  •  Built in independent watch dog
  •  16 bit Timers/Counters
  • 4 Channel DMA
  •  USARTS
  •  Event system
  •  I2C interfaces
  •  Advanced wave form generator
  •  SPI interfaces
  •  12 bit 2Msps Analog to Digital Converter
  •  PWM generators
  •  12 bit 1Msps Digital to Analog converter
  •  Real Time Clock counter
  •  Hardware cryptography (AES and DES)

The XMEGA devices is built on the same high performing RISC CPU as the tiny and mega AVR devices, and use the same development tools.

 

Lets take a closer look into the XMEGA features making it particularly suitable for Robotics.

Advanced Waveform Generator (AWG)

The XMEGA AWG has been designed specifically to enable advanced waveform generation (hence the name), especially suitable for motor control and power control applications. This means that in addition to being a very high performing robotics brain the XMEGA can incorporate hardware motor control, capable of controlling anything from stepper motors and brushless DC motors to standard low voltage low current DC motors. In addition to giving your system a higher degree of integration saving board space, the XMEGA AWeX also save you the cost of external expensive motor controllers or alternative advanced software development and debugging.

For simple low cost robots, DC motors driven by a full H-bridge is one of the more common configurations. But driving a simple H-Bridge directly is not always a simple software task. Driving the H-bridge directly from a standard PWM output usually means that during switching, both the high side and the low side of the H-bridge will conduct simultaneously for a small amount of time. This can both damage the battery and also possibly burn out the H-bridge drivers FETs. In XMEGA you can configure the AWeX to automatically insert a dead time during switching, ensuring that the high side of the bridge is completely turned off before turning on the low side. The picture below shows a PWM output with dead time (Dt) inserted.

Dead time insertion

Event system

“Like a reflex in the human body, the innovative XMEGA Event System enables inter-peripheral communication without CPU or DMA usage”. This is the way Atmel presented the new event system featured in the XMEGA devices. This event system is a set of signal routing channels, enabling peripheral modules to directly signal each other.

Event system

One example: The ADC has finished a conversion and signals to the DMA that data is ready, triggering a DMA transfer of measurement data into the SRAM.

Another: The analog comparator detects an over-current in the motor driver and sends an event to the AWeX that immediately and safely turns of the motor driver.

Yet another: The 16 bit timer/counter 1 generates an overflow event to the 16 bit timer/counter 2, leading to an increment of the latter. Thus by using the event system you can cascade several timers together to create larger timer/counters (32 bit in this example)

All event handling is completely CPU independent, and have a guaranteed maximum latency of two system clock cycles. This means you do not have to spend valuable processing power and execution cycles for handling software interrupt routines.

Each event channel have a built in digital filter. This can be used for instance as input filtering of digital input pins, an excellent function to de-bounce mechanical bumper switches.

The event system can even be set in a quadrature decoder mode, directly decoding quadrature data into the timer registers. This enables hardware motor positioning, a task previously undertaken by software functions. More details about the quadrature decoder will be given in an announced upcoming application note from Atmel, AVR1600.

quadrature


DMA

One of the great new features in XMEGA is the Direct Memory Access (DMA) controller. This one transfers data between memories and peripherals without CPU intervention other than the setup and triggering of a transfer. Data transfer can even be triggered by events from the event system.

In a robot using digital servos (e.g. the excellent open servo from www.openservo.org) you can have large servo movement data placed in flash, and driven by a timer you can trig timed transfers of movement data to the I2C bus, controlling the servos. All without CPU intervention.

The amount of peripherals available on the new XMEGA devices are impressing, and really inspires to creativity in robot construction. I will later this year make a small robot controller based upon the new XMEGA, and all construction details will be posted on this site.



Comments

avatar Gabriel
0
 
 
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar admin
0
 
 
Hi Gabriel.
Nice job with your kit. Looked interresting. I also liked your COMA design.
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
It really looks very interesting.
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar Gabriel
0
 
 
Thanks!
I think I will have the XMultiKit ready in a couple of weeks. The COMA is a work in progress...
I am also taking a look at the dsPIC from Microchip to design other development kits.
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar Fridolin
0
 
 
You mentioned open servo - is there a scematic for levelshifter or sourcecode available?
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar Admin
0
 
 
Hi Fridolin,
I dont have any software (at least not yet) for this.

A simple I2C level converter for interfacing the XMEGA to a 5V I2C (e.g. the open servo) can be found in the I2C spec from philips. www.semiconductors.philips.com/acrobat/literature/9398/39340011.pdf Figure 45.

Also searching around the web you will find many different solutions, including dedicated level converters for I2C bus.
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar emii
0
 
 
A friend of mine let me borrow his Intel Play Microscope. I wasn't sure about the resolution but the pictures show either dust or solder bridges. In any event, the board requires cleaning. Do I heat up the traces again? Should I use some alcohol? Any ideas on how to clean this up?
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar Gibson Les Paul
0
 
 
Great project. Thank you for sharing. Cheers!
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
Thanks buddy....
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
 
 
Joomla 1.5 Templates by Joomlashack