Skip to content

Category Archives: Microcontrollers

Xmega DFU Bootloader – Changing the Sensing Pin

The DFU bootloaders that Atmel supplies, as Intel HEX files, for its Xmegas have pre-determined pins used to sense whether or not to skip the bootloader and start the application, or to register the device to the host PC via USB. These are slightly hidden on the Atmel website and the source code requires IAR […]

AVR Dragon Problem: stopped working, not recognised by USB

OK… so my Dragon just stopped working. Plug it in, the status LED just flashes amber and Windows (XP) does not detect it. Re-install the drivers – no, that isn’t it. (BTW, the instructions in the helpfile that comes with Atmel Studio 6 are wrong). Try another PC or using a motherboard USB socket rather […]

Debugging Arduino using debugWire (+ Atmel Studio and an AVR Dragon)

This post is motivated by the lack of information about using debugWire with an Arduino (or similar) on the web. There are quite a few brief comments on the forums and people asking how to do it but nothing really good, with the possible exception of a post by Steve Cogswell which refers to an […]

Simulating Arduino Code using Atmel Studio 6

The next post will look at on-chip-debugging (OCD) but it is worth using the Atmel Studio Simulator first. Using the simulator isn’t practical unless the input-output is pretty simple because it doesn’t simulate attached devices or real-time events. But even so, you can fiddle with input/output at the bit level and follow the way variables […]

AVR Timer1 Dead Time Generator Example (ATtiny85)

The ATtiny 25/45/85 datasheet has an intriguing section about the “dead time generator” that I found a little confusing. A little practical example helped me to understand it. The code and logic analyser trace (made using the same analyser and client mentioned in previous posts) appear below. This is just an example to understand how […]

AVR ADC #2 – Experiments in Operating the ADC at High/Low Sample Rates (ATtiny85)

This article builds on the previous one. This experiment was stimulated by wanting to have a 128kHz system clock but still be able to use the ADC. Section 17.5 of the datasheet clearly says: … requires an input clock frequency of between 50kHz and 200kHz to get maximum resolution. If a lower resolution than 10 […]

AVR ADC #1 – Basic Examples (ATtiny85)

As a precursor to investigating the precision of the AVR analogue to digital converter (on an ATtiny85 but assumed to be similar across many AVR devices) outside the recommended ranges of conversion frequency and input impedance, I set about to get to know the ADC better with a couple of “elementary” examples: a simple read […]

Using Atmel Studio 6 IDE with Arduino (Uno and Leonardo)

The benefits of the Atmel Studio 6 IDE (if you can get to grips with it) are described in various places so I won’t repeat them here. For my part, I began using it with an AVR Dragon board for programming micrcontrollers directly (i.e. not using the arduino or similar development boards). I have also […]

ScratchBoard Emulator using Arduino Uno

Here is a circuit and arduino code to approximately emulate a ScratchBoard; there is sound, light, a button and four sliders but it isn’t a drop-in replacement. Zip file download (55kB) contains a schematic (as a PNG graphic and as a TinyCAD file) and an Arduino sketch. Various notes: The electret mic used was an […]

TinyCAD Library for Arduino

Here is a small library for TinyCAD for Arduino Uno R2 and R3 owners. Also included is a symbol for the 1602 LCD module. TinyCAD is free to download and use but is Windows-only. I find it very easy to use for schematics (which I prefer to Fritzing FWIW). Download: Arduino Library (zipped). Please let […]