Previously we dealt with the XMega Analog-to-Digital Converter (ADC) block. We know that we can use the ADC to measure voltages and take decisions based on voltage values/levels but sometimes it is enough to detect voltage levels and not to measure the exact voltage values. In such occasions where we just need to check voltage levels relative to a reference or threshold value, we need an Analog Comparator (AC). An analog comparator can be used to compare two voltage levels and based on that it can be used to generate a logic output (0 or 1) to indicate which of the two levels is higher or lower than the other. That’s all and there isn’t much about analog comparators. The XMega family of micros come loaded with high performance dual analog comparator modules. However so far we saw that between the traditional 8-bit micros and the XMega micros, the major difference apart from programming is the overall nifty enhancements in all common hardware blocks. When it comes to the analog comparators of the XMega micros, the same is true. In this issue we will explore the XMega analog comparator block.
Okay firstly the reason I wrote about the clock system instead of I/O ports or something else in this second post of the XMega series is simply because of the fact that without understanding clock configurations you won’t get what you want from your chip. Since XMega’s clock system is software-level configurable and complex at first, it makes itself the first priority module before anything else.
There are several clock sources that XMega micros can use as clock. These are both internal and external clock sources. As stated earlier, clocks are not set by fuse settings unlike traditional Mega AVRs, they are controlled by software and the outputs from these sources can be multiplied using the internal Phase Locked-Loop (PLL). Thus there’s a wide range of clocks available in the XMega and it’ll not be needed to shut down and reprogram the XMega just to change its clock – a great relief from meddling with fuse settings. Some port pins can also output the system clock frequency. Literally there’s no need to depend on external quartz crystals which are not available in all frequencies.
The XMega series is a powerful addition to the existing arsenal of Atmel’s AVR-core micros. As much as I have personally studied about it so far and felt, the XMega series incorporates many features of conventional 32-bit ARM micros like alternate I/O pin mapping functionalities, sophisticated clock options and data buses, multiple communication platforms that have several uses, variety of capture-PWM options, 12-bit ADCs and DACs, DMA controller, USB hardware, etc. with the good old AVR core. Thus you get one hell of an 8/16 bit MCU that can fulfil your wildest micro desires. In terms of unit cost, resources and user flexibilities this family of micro can beat any present day micro in most of the scenarios. Unlike other manufacturers who design chips as to fit specific applications, there’s no limit for XMega series. It is one controller with unlimited possibilities that can fit into any application. Indeed it is a true Atmel slogan now:
“My microcontroller can beat the hell out of your microcontroller.”
There are several things that are should be known. XMega is still a relatively new breed of micro. There’s literally nothing similar to it in the market no matter which manufacturer you can name. As I said Atmel added literally everything that can be imagined. Initial XMega devices had several hardware flaws and were unstable. They had problems related to power and operational stability. However these shortcomings are no longer there as they were. Atmel dramatically improved this new line of devices and are yet doing a lot of R&D on it. The older successful AVR Mega series micros are not as same as XMegas and so what can be applied to Mega AVR can’t be applied for the XMegas. There are significant differences both in terms of hardware and software but still there are similarities.
Ibrahim Kamal from IKALOGIC informed me about his latest article on the use of CMOS camera for sensing applications posted on his website. It’s true that interfacing a CMOS camera with 8-bit microcontrollers has not been very common. There’s a stereotype that much faster and powerful microcontrollers are required to process the output of a CMOS camera, which may not always be true, as illustrated by Ibrahim Kamam. In fact, it all depends on the type of application you choose with a CMOS camera.
CMOS camera can replace an array of photo sensors
The article discusses about the possibility of using a CMOS camera for sensing applications by reducing the image resolution and getting rid of the color information. The downgraded image requires lesser computation, and therefore, is feasible to process using a simple 8-bit microcontroller. With this arrangement one CMOS camera could replace an array of conventional light sensors (made of LEDs and photodiodes) that are used in many embedded applications including robotics. A quick illustration on how to interface the TCM8230MD CMOS camera (available from SparkFun) to an AVR XMEGA processor has also been discussed in the article.