We recently released the first simulator for our ARM-based SAM microcontrollers – allowing users to observe a cycle accurate simulation of Atmel’s new ARM Cortex-M0+ based SAM D20 MCU.
Essentially, it offers a cycle-accurate simulation of the entire MCU, not just the core but the peripherals as well (the digital ones, not the analog ones). The simulator – which includes all processor and I/O registers – is available as debug target just like a real MCU in the Atmel Studio development environment.
Yes, running code while watching the I/O registers certainly sounds sweet indeed. But how useful is it when nothing is connected to the pins of the MCU? Well, the simulator actually supports external file stimulus, meaning every pin of the MCU model can be read and written to based on a simple text file with full cycle accuracy. Perhaps most importantly, the stimuli is non-intrusive, allowing users to debug a system in “slow motion” – as the MCU and stimuli stop and start completely in synch.
Don’t feel like writing your own stimuli file or want to collaborate on using file stimuli? We’ve set up a project on Atmel Spaces – the collaborative workspace – with example stimuli files here.
Still, one can get the real SAM D20 on an Xplained Pro eval kit for $39 – so why bother with a virtual model?
For starters, a full-featured (time limited) trial version of the SAM D20 simulator is available for instant download in the Atmel Gallery. To try out the SAM D20, you don’t need to wait for hardware to be shipped.
The Xplained Pro board is populated with the largest device – the SAMD20J18 in a 64-pin package – whereas the simulator supports all SAM D20 device variants.
In addition, there are a few things you can’t – or don’t want – to do with the real device. With cycle accurate, non-intrusive file stimuli, you can run and debug the entire system in “slow motion.” On real hardware, when you hit a breakpoint, the MCU stops. However, any external component on your system continues to run. On the simulator with file stimuli, the entire system stops – and resumes – in synch. This gives you new debugging capabilities in application that can be destructive to the hardware, such as motor control or high current power switching.
Other key benefits of the simulator over real hardware include precise measuring of execution times (based on clock cycles), use in regression testing as well as easy and early custom board availability.
As noted above, the SAM D20 simulator is the first ARM simulator to be released by Atmel, but it certainly won’t be the last. To be sure, we plan on providing fully accurate simulator models of new chips even before physical engineering samples go live.
In an industry where everyone is angling for an advantage by bringing their products to market faster, being able to kick off development with a new MCU weeks or months before its physically available can be invaluable. So try it out – the SAM D20 simulator is available here in the Atmel Gallery.