Silicon ChipNew Microcontrollers: Feature-Laden, Fast & Furious - June 2012 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: What's next on the automotive wish list?
  4. New Microcontrollers: Feature-Laden, Fast & Furious by Nicholas Vinen
  5. Review: WiNRADiO Excalibur WR-G31DDC HF Receiver by Maurie Findlay
  6. Project: Crazy Cricket Or Freaky Frog by John Clarke
  7. Project: Wideband Oxygen Sensor Controller Mk.2, Pt.1 by John Clarke
  8. Project: Mix-It: An Easy-To Build 4-Channel Mixer by Nicholas Vinen
  9. Project: PIC/AVR Programming Adaptor Board; Pt.2 by Nicholas Vinen
  10. Review: Agilent’s 35670A Dynamic Signal Analyser by Allan Linton-Smith
  11. Vintage Radio: John de Hass & his Philips vintage radio collection by Rodney Champness
  12. PartShop
  13. Order Form
  14. Market Centre
  15. Advertising Index
  16. Outer Back Cover

This is only a preview of the June 2012 issue of Silicon Chip.

You can view 28 of the 104 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Items relevant to "Crazy Cricket Or Freaky Frog":
  • Crazy Cricket/Freaky Frog PCB [08109121] (AUD $10.00)
  • PIC12F675-I/P programmed for the Crazy Cricket/Freaky Frog [0810912A.HEX] (Programmed Microcontroller, AUD $10.00)
  • Firmware (ASM and HEX) files for the Crazy Cricket/Freaky Frog project [0810912A] (Software, Free)
  • Crazy Cricket/Freaky Frog PCB pattern (PDF download) [08109121] (Free)
Items relevant to "Wideband Oxygen Sensor Controller Mk.2, Pt.1":
  • Wideband Oxygen Controller Mk.2 Display PCB [05106122] (AUD $7.50)
  • Wideband Oxygen Controller Mk.2 PCB [05106121] (AUD $15.00)
  • PIC16F1507-I/P programmed for the Wideband Oxygen Sensor Controller Mk2 [0510612A.HEX] (Programmed Microcontroller, AUD $10.00)
  • PIC16F88-E/P programmed for the Wideband Oxygen Sensor Controller Mk2 Display [0510612B.HEX] (Programmed Microcontroller, AUD $15.00)
  • Firmware (ASM and HEX) files for the Wideband Oxygen Sensor Controller Mk2 [0510612A/B] (Software, Free)
  • Wideband Oxygen Controller Mk.2 Display PCB pattern (PDF download) [05106122] (Free)
  • Wideband Oxygen Controller Mk.2 PCB pattern (PDF download) [05106121] (Free)
  • Wideband Oxygen Controller Mk.2 panel artwork (PDF download) (Free)
Articles in this series:
  • Wideband Oxygen Sensor Controller Mk.2, Pt.1 (June 2012)
  • Wideband Oxygen Sensor Controller Mk.2, Pt.1 (June 2012)
  • Wideband Oxygen Sensor Controller Mk.2, Pt.2 (July 2012)
  • Wideband Oxygen Sensor Controller Mk.2, Pt.2 (July 2012)
  • Wideband Oxygen Sensor Controller Mk.2, Pt.3 (August 2012)
  • Wideband Oxygen Sensor Controller Mk.2, Pt.3 (August 2012)
Items relevant to "Mix-It: An Easy-To Build 4-Channel Mixer":
  • Mix-It! 4 Channel Mixer PCB [01106121] (AUD $15.00)
  • Mix-It! 4 Channel Mixer PCB pattern (PDF download) [01106121] (Free)
Items relevant to "PIC/AVR Programming Adaptor Board; Pt.2":
  • PIC/AVR Programming Adaptor Board PCB [24105121] (AUD $20.00)
  • PIC/AVR Programming Adaptor Board PCB pattern (PDF download) [24105121] (Free)
Articles in this series:
  • PIC/AVR Programming Adaptor Board; Pt.1 (May 2012)
  • PIC/AVR Programming Adaptor Board; Pt.1 (May 2012)
  • PIC/AVR Programming Adaptor Board; Pt.2 (June 2012)
  • PIC/AVR Programming Adaptor Board; Pt.2 (June 2012)

Purchase a printed copy of this issue for $10.00.

Microcontrollers: feature-laden, fast and furious The microcontroller scene is certainly on the boil, with a host of new products competing for the lowest power consumption, best performance and best value. Here is a brief look at what’s new in the microcontroller world, some already available and some soon to be released... E lsewhere in this issue we present the second and few analog input pins (or in some cases, none) and maybe final instalment of our PIC/AVR Microcontroller two or three basic PWM outputs. Newer chips can have a dozen or more analog inputs, Programming Adaptor board, which allows the user to program over 450 different types of microcontroller from some with built-in programmable gain amplifiers, six or more PWM outputs with advanced modes designed to drive Microchip and Atmel. That seems like a lot – how many more microcontrollers brushless motors and Mosfet bridges, configurable serial buses capable of high speed operation and so on. can there be than that? One good example is the dsPIC33E/PIC24E series. These Actually, 450 is only a drop in the bucket. At one major supplier, we counted over 20,000 different micro types are more or less compatible with dsPIC33Fs/PIC24Fs, which we have occasionally used in the past. presently available! But they are substantially more powerful, running at two Some of these are the same chip in a different package (DIP, SMD etc) but even when you take that into account, or three times the speed and with more advanced peripherthere are still thousands of different microcontrollers from als as standard. We’ll take a look at these later in this article. scores of suppliers. Even among the types that our readers will be familiar Benefits Having said all that, even a bog- standard micro lets us do with, such as PICs, there has been very significant progress things that would be much harder with discrete logic chips. over the last few years. Prices have dropped, processing power has increased Virtually any digital circuit can be built using discrete logic and the integrated peripherals have been substantially but the cost and complexity can quickly become prohibitive for all but the most simple tasks. enhanced. by NICHOLAS VINEN Consider what you get when you buy Until recently, most micros had just a 12  Silicon Chip siliconchip.com.au Microcontrollers vs Microprocessors the cheapest microcontrollers, which may be just a couple of dollars: you get thousands of logic gates whose function can be reconfigured virtually at will. You also get dozens of digital input buffers and output transistors and usually a 10-bit or 12-bit ADC with input multiplexer, several configurable PWM generators plus some serial interfaces and other goodies. Not only is the resulting hardware a lot easier to design but fixing a bug in software can be a lot easier than fixing hardware errors; much easier to fix a few lines of code than do a re-design of a PCB, get a new prototype, assemble and test – and hope like crazy it behaves as it’s supposed to! One example of a recent project which would have been prohibitive without a microcontroller is the 1.5kW Induction Motor Speed Controller (SILICON CHIP, April-May 2012). This uses a dsPIC33 chip designed for motor control. It can generate three in-phase centre-aligned PWM signals with glitch-free updates. The micro also manages the motor speed so that it varies smoothly, synthesises the sinewaves with which to drive the motor windings, monitors the circuit for faults and so on. Another example is the Maximite microcomputer, which demonstrates how much the line between microcontrollers and microprocessors has become blurred (see panel). This small computer connects to a keyboard and VGA monitor, uses a memory card for storage and can be programmed using BASIC. It’s based on a PIC32 microcontroller which has surprisingly good performance for a relatively cheap chip, at around 125MIPS (million instructions per second). Also in this issue is the first part of our new Wideband Oxygen Sensor Controller. One of the many changes compared to the last incarnation is that we are now using the PIC16F1507, a new part from a long-running series. While its CPU core is much the same as other PIC16s, it has more ADC channels (12), a built-in voltage reference with three selectable levels, four PWM modules, two Configurable Logic Cell modules (which can replace external digital logic ICs), a Numerically Controlled Oscillator (NCO) and a Complementary Waveform Generator (CWG). All these features make the new Wideband Oxygen Controller simpler but more capable. Of course, we tend to stick with tried-and-true chips when they suit the task at hand. One of the main benefits of commonly used chips is their wide availability. But in some cases, the application calls for a newer, more advanced IC. Overleaf, we examine some of the newer and more interesting microcontrollers on the market. siliconchip.com.au So just what is the difference between a microprocessor (as found in a computer) and a microcontroller? These days, not much. The main difference is that microcontrollers generally require less support circuitry, making them more convenient for use in embedded designs. By contrast, a microprocessor usually needs to be connected to RAM (random access memory) and ROM (read-only memory) chips. The RAM is used as working space storage while the ROM provides the initial instructions for the processor. Microprocessors also tend to have fairly strict supply voltage requirements to work reliably at their rated speed and they are usually designed to interface with other complex ICs which handle their input/output needs and provide for connection to a keyboard, mouse, monitor, network and so on. By comparison, the majority of microcontrollers these days have internal RAM and flash memory for instructions. This reduces cost and also dramatically reduces the number of pins required and hence the size and cost of the IC package. It saves on PCB space and avoids the need to route dozens or even hundreds of memory bus tracks. Microcontrollers usually can run from a wide range of supply voltages, eg, 2.7-5.5V so they can run direct from a battery or a variety of different power supplies. Some will run from 1.8V or less while a few are designed to run off 12V or more, so that they can powered from multi-cell batteries without the need for a regulator. Unlike most microprocessors, a microcontroller has a fair bit of on-board “peripheral” circuitry such as analogto-digital converters, PWM (pulse width modulation) outputs, USB and in some cases Ethernet, allowing it to interface to other circuitry without the need for many additional ICs. Microprocessor peripherals are usually limited to serial/parallel data communication with other digital ICs. Having said all that, there is increasing convergence between microcontrollers and microprocessors. The most powerful microcontrollers, such as those used in MP3/MP4 players, smart phones and so on, can run at 1GHz or more, access large amounts of RAM, have graphics acceleration features and so on. In fact, they are more capable than the microprocessors that were available not much more than ten years ago. On the other hand, computer microprocessors have started to branch out into the same space. For example, there is the Intel Atom and the AMD G-series of microprocessors. Both are derived from mainstream CPUs (central processing units) and both offer low power consumption and a high level of system integration. For instance, they have on-board graphics controllers and memory controllers. They also come in smaller, thinner packages than traditional CPUs, for use in portable electronic devices. With the popularity of smart phones and portable media players, expect to see more improvements in microcontroller performance and features over the next few years. June 2012  13 ARM Cortex-M0 ARM Cortex-M4 This is latest addition to the 32-bit ARM line-up of microcontroller cores. It is notable for especially low power consution figures combined with good performance. Core power consumption is just 32µW per MHz for chips built on a 90nm silicon process, with a 1.2V core supply (peripherals consume additional power). The Cortex-M0 has an optional single-cycle 32-bit multiplier and runs up to 50MHz, with a performance of 42 Dhrystone MIPS at full speed. The Cortex-M0 was introduced following the more powerful M3 series and at around the same time as the M4 series. These all use the “THUMB-2” instruction set which mixes 16-bit and 32-bit instructions for improved code density, compared to the original ARM instruction set which is 32-bit only. The M0 supports a subset of THUMB/THUMB-2 to keep the core small and minimise power usage. ARM do not manufacture the chips; they license the design to manufacturers. Chips based on the Cortex-M0 are currently available from NXP (LPC11xx and LPC12xx), ST Microelectronics (STM32M0 and upcoming STM32F0 series), Energy Micro (EFM32 ZG-series) and Nuvoton Tech (NuMicro series). These are all SMDs (surface mount devices). The Cortex-M0+ is the same as Cortex-M0 but its pipeline has two stages rather than three, which reduces branch penalties. Chips based on this core will be made by NXP and Freescale Semiconductor (Kinetis L series). Since these chips use the same instruction set as a large number of existing 32-bit microcontrollers, there are already many suitable compilers, debuggers and development environments. In fact, code written for Cortex-M0 processors will run on Cortex-M3 and CortexM4 processors without modification. Readers interested in getting into Cortex-M0 programming might want to try the NXP LPC11U24 Cortex-M0 “mbed” embedded development board from RS components (see photo). This has an on-board power supply and USB programming port. It breaks the SMD chip’s pins out to pin headers, suitable for use with breadboards and protoboards. Another option is the LPC1114 Cortex M0 Stamp board. Available for around 18 Euros, this small breakout board has an NXP chip with 32KB flash, 8KB RAM, an 8-channel 10-bit ADC and a USB serial port. Its I/Os are broken out to a pair of pin headers and it also has a USB bootloader and on-board power supply. The Cortex M4 is at the other end of the spectrum from the M0 and includes everything but the kitchen sink. The M4s include a single-precision floating point unit (FPU) with some DSP instructions, including 8-bit and 16-bit SIMD (single instruction, multiple data), multiply-accumulate instructions and a hardware divide unit. They also include a memory protection unit (MPU). The result is around 1.25DMIPS/MHz and with speeds up to about 160MHz, M4s are capable of 200MIPS+ and can typically handle supply voltages anywhere between 1.8V and 3.3V. In keeping with the core, Cortex M4s also typically have a rich set of peripherals. One of the best examples is the STMicro STM32F4 series. These are available in 64-176 pin SMD packages and include 12 timers with around 40 PWM channels, up to 1MB of flash memory and 192KB of RAM, up to 24 analog-to-digital converter inputs, two digital-to-analog converter (DAC) outputs, hi-speed USB On The Go (OTG), 100Mbit Ethernet, multiple serial controllers and so on. These are among the most powerful microcontrollers available which do not require external flash or RAM. In fact they only need a handful of bypass capacitors and little else. Other useful features include a built-in random number generator, hardware checksum calculation unit and a digital camera interface which can handle data rates up to 54Mbites/s. The STM32F4 Discovery evaluation board is available at a surprisingly modest price – around $20-25.00 This has a 100-pin microcontroller (1MB flash), USB programmer, power supply, 3-axis digital accelerometer, microphone, audio DAC, class D amplifier and USB OTG connector plus some pushbuttons and LEDs. All the spare I/O pins are broken out to one of two 50-pin headers along with the power supply pins. Cortex M4 microcontrollers are also available from NXP (LPC43xx-series), Texas Instruments (LX4-series), Freescale Semiconductor (Kinetis M and P-series) and Energy Micro (EFM32 L-series). Of these, the Freescale Semiconductor parts are notable for their high-precision 16bit ADCs. 14  Silicon Chip siliconchip.com.au Microchip dsPIC33E & PIC24E Microchip recently added two new, related series of 16-bit processors to their microcontroller line-up: the dsPIC33E and PIC24E series. In the past, while the PIC24 and dsPIC33 lines were both 16-bit micros, there were many differences between them. With these new lines, the features have been all but merged, giving us the best of both worlds. The biggest difference from those earlier micros (dsPIC33F, PIC24F/H) is the much higher performance of the E-series. These can achieve up to 70MIPS at 70MHz (60MIPS/60MHz for the extended temperature range). By comparison, the dsPIC33F-series goes up to 40MIPS/40MHz while the PIC24F-series only manages 16MIPS/32MHz. As well as having two or three internal comparators, these chips also feature the same number of internal op-amps which can either be used to give true differential ADC (analog-to-digital converter) inputs or as general purpose devices connected to an output pin. Some PIC24E and dsPIC33E chips also have a USB On-the-Go interface, which was not available for the dsPIC33F series. These chips retain many of the useful features of the earlier series chips including a fast and flexible ADC, with 4-channel 10-bit resolution mode at up to 1.1MSPS (megasamples per second) and single-channel 12-bit resolution mode up to 500kSPS. They also add some new features such as configurable pull-down resistors on each I/O pin (in addition to the configurable pull-ups). Both new series have the 40-bit accumulators with single-cycle multiply/accumulate instructions and hardware divide unit, as for the dsPIC33F series. In fact the only difference between the dsPIC33Eand PIC24E- series processors is that the dsPIC33Es have ECAN (Extended Controller Area Network) support. The Motor Control (xxxMCxxx) chips in this series feature highspeed PWM modules with ~7ns output pulse resolution and a number of different modes to suit different motor types. These devices also have a Quadrature Encoder interface. The dsPIC33Es and PIC24E are available in DIP and surface mount packages. Microchip also sell a dsPIC33E USB Starter Kit which features a sur face mount dsPIC33e chip, an onboard USB programmer and separate USB connection for direct communication with the micro. It also has an I/O expansion header. 16  Silicon Chip Atmel SAM3U SAM3U is a series of microcontrollers based on the ARM Cortex M3. The main difference between the M3 core and the aforementioned M4 is that the M3 does not have a floating point unit (FPU). What makes the SAM3U series unusual is on-chip hi-speed USB. This allows much higher data transfer rates than full-speed USB; 480Mbits/s compared to just 12Mbits/s. While some other ARM-based microcontrollers have hi-speed USB controllers (eg, the STM32F4), they usually require an external hi-speed USB PHY (physical layer) chip. This increases the total cost and takes up more board space. By contrast, the SAM3U has an integrated hi-speed PHY and its cost is comparable to other Cortex M3 based parts. SAM3U series microcontrollers operate at up to 96MHz/120MIPS. They are available with 64-256KB flash memory, 16-48KB RAM and in 100/144 pin SMD packages. Extra features include a memory protection unit, dual-bank flash for safe self-programming, multiple low-power modes, an 8-channel 12-bit 1megasample/s ADC with differential inputs and programmable gain plus an 8-channel 10-bit ADC and up to nine serial controllers. siliconchip.com.au Texas Instruments MSP430 Microcontroller Glossary ADC (Analog-to-Digital Converter): a circuit where the input is a voltage level and the output is a binary number. Allows digital circuits such as microcontrollers to sense voltage levels and measure analog signals. The resolution is specified in bits (eg, 12 bits); with more bits, it measures the voltage in smaller steps, for greater accuracy. ADCs also have a maximum sampling rate, often specified in kilosamples per second (kSPS) or megasamples per second (MSPS). This indicates how often the ADC’s binary output can be updated to reflect changes in the input voltage. ADCs are often fitted with input multiplexer and sample-and-hold buffers. See also: multiplexer, sample-and-hold buffer, DAC. ARM (Advanced RISC Machine): one of the most common types of 32-bit microprocessor/microcontroller, ARM is a processor architecture which was introduced in 1987 and has been upgraded many times since. Most ARM microcontrollers are based on the ARM7, ARM9 or Cortex designs. ARM Holdings designs the ARM core design cores and licenses them to manufacturers who then add peripherals, memory and other support circuitry. TI is lifting its profile in the microcontroller world with the MSP430G2 “Value Line” series of low power, low cost 16-bit microcontrollers. These are available in speed grades from 8MHz to 25MHz and with 1-256KB of flash memory. They have an array of optional features such as ADCs, DACs (digital-to-analog converters), hardware multiply unit, UARTs, LCD controllers, PWM outputs and so on. MSP430-series chips are available in DIP and surface mount packages. The MSP430 series features an innovative DCO (digitally controlled oscillator) for clock generation which allows the chips to run over a large range of speeds from a low-power internal oscillator. This can wake up fast from low power “sleep” modes (around 1µs). As one example, the MSP430G2553 has 16KB of flash and 512B RAM, runs at up to 16MHz from a 1.8 to 3.6V supply and consumes around 230µA/MHz. It has two 16-bit timers with three PWM outputs each, serial ports (UART, SPI and I2C), JTAG, an 8-channel, 10-bit 200kSPS ADC, a real-time clock type function and up to 24 GPI/O pins (in 28-pin SMD package; 16 for the 20-pin DIP package). The MSP430 Launchpad is a small pack with a USB programmer/ debugger, 20-pin IC socket and pin headers which, in combination with a free Windows development environment, allows for easy programming and experimentation with MSP430 series processors. Two 20-pin DIP micros are included with each Launchpad. It is a very low-cost way to get into MSP430 programming. Also available is an MSP430-based Wireless Development Tool (eZ430-RF2500) to make the development of projects with 2.4GHz digital wireless links easy. Then there is the MSP430 USB Stick Development Tool (eZ430-F2013) which has a USB programmer/ debugger, MSP430 chip and I/O pads all in a USB stick form factor. AVR: A line of 8-bit and 32-bit microcontrollers from Atmel; the first microcontrollers to feature internal flash memory for program storage. CAN (Controller Area Network): a serial bus standard, designed for use in vehicles, developed by Bosch. ECAN (Enhanced CAN): a CAN peripheral which performs much of the work to implement the CAN protocol, so that the processor doesn’t have to. Centre-aligned PWM, dual-ramp PWM: a form of pulse width modulation which, unlike traditional edge-aligned PWM, does not place the rising edge at the same point in each cycle for different duty cycles. Can result in less electro-magnetic interference than edge-aligned PWM. Clock rate: the frequency of the clock signal used to drive the CPU core. This determines the rate at which instructions are executed. See: MIPS. Code, Instruction code: the set of instructions which tell a microprocessor or microcontroller what to do. The code therefore defines its function. Code density: this is a measure of how much memory the instructions take up for any given task. An instruction set with high code density takes less space to store the instructions required for a given task than one with a low code density. Core: the part of a microprocessor which loads instructions from memory and then acts on them. This is the most fundamental part of a microprocessor or microcontroller. Other parts include RAM, ROM, flash and peripherals. Also known as an execution unit. CPU (Central Processing Unit): the main microprocessor in a computer. DAC (Digital-to-Analog Converter): a circuit where the input is a binary number and the output is a voltage level. Allows digital circuits such as microcontrollers to control a voltage level or generate an analog signal. Resolution is specified in bits (eg, 12 bits); with more bits, its output voltage changes in smaller steps. DACs also have a maximum sampling rate, often specified in kilosamples per second or megasamples per second. This indicates how frequently the DAC’s analog output can be updated. See also: ADC. siliconchip.com.au JJune une 2012  17 Microcontroller Glossary. . . continued DCO/NCO (Digitally-Controlled Oscillator or NumericallyControlled Oscillator): an oscillator where the frequency can be changed by the software. Typically used to generate the instruction clock, so that the software can switch between high-speed and lowpower modes. DIP (Dual In-line Package): the package used by virtually all through-hole microcontrollers. The chip is encapsulated in a rectangular body made from ceramic or more commonly plastic, with a row of right-angle leads projecting from the two long edges. DMA (Direct Memory Access): a method where peripherals share access to RAM and are able to read/write data in the RAM without the core being involved. This improves performance since it allows the core to perform other tasks simultaneously with the peripherals without constant interruption. See also: peripheral. DMIPS (Dhrystone MIPS): a standard (though not infallible) method for measuring processor performance. Superficially this resembles MIPS but it is calculated by performing a task which is expected to take a certain number of instructions and measuring how long it took. This reveals not only the processor’s clock rate but also its processing efficiency. For example, a 1MHz processor may achieve 0.9DMIPS, 1.25DMIPS or some other value. The processor with 1.25DMIPS can on average do more work per clock pulse than the one which only achieves 0.9DMIPS. 1DMIPS is defined as the processing power of an (ancient!) VAX 11/780 running at 1MHz. However,processors can be designed to look good in such benchmarks. dsPIC: a line of signal controllers from Microchip. These are effectively powerful 16-bit microcontrollers with built-in DSP instructions. See also: DSP, PIC. DSP (Digital Signal Processor): a specialised variant of a microprocessor with powerful mathematical functions such as fast multiply-accumulate, floating point, SIMD and so on. Used for tasks such as spectrum analysis, filtering and signal analysis. EEPROM (Electrically Erasable Programmable Read-Only Memory): a type of non-volatile memory which can be erased and re-written. EEPROM usually withstands more re-write cycles than flash memory but is otherwise very similar. See also: flash memory. Ethernet: a series of network standards which allow data to be transmitted over twisted-pair cable at speeds of 10Mbit, 100Mbit, 1Gbit or 10Gbit. Flash, flash memory: a type of non-volatile memory where data can be stored for many years. While flash memory can be re-written many times, it has a finite life-span and so is normally used for storing data that changes seldom, eg, program code. Also, the read speed of flash is much higher than the write speed. Flash must be erased before it can be re-written and for this reason it is typically arranged in blocks, which can be erased one at a time or simultaneously. See also: EEPROM. FPU (Floating Point Unit): the section of a processor which performs mathematical operations on floating point numbers. This makes it much easier and often faster to manipulate fractional numbers, especially those which can have a wide range of values. GPI/O (General Purpose Input/Output): refers to a processor pin which is capable of being a digital output, which the software can set to either a low or high voltage level, or a digital input, in which case the pin has a high impedance and the software can sense whether the voltage level at that pin is low or high. 18  Silicon Chip I2C (Inter-Integrated Circuit): a two-wire serial bus consisting of two lines (SDA for data and SCL for clock) plus ground. Uses opencollector signalling to allow up to 1024 slaves to share a single I2C bus with speeds up to 5MHz. Instruction: a single command which instructs a microprocessor core to perform a mathematical operation. A series of instructions defines the program code which determines what the processor does. A typical instruction might store a number to a particular location in memory, add two numbers, send a control message to a peripheral and so on. Instruction set: the variety of different instructions which a CPU core is able to handle. This affects the efficiency of a processor as well as how easy it is to program. Interrupt: a way for an external event or peripheral to trigger a particular set of instructions in the processor core. When an interrupt is triggered, the instruction flow of the core is interrupted and diverted to a specific set of instructions which are to be triggered on that event (the interrupt handler). When the interrupt handler’s task is completed, the processor returns to executing the instruction that it was about to process before the interrupt occurred. JTAG (Joint Test Action Group): a five-wire daisy-chain serial protocol designed for testing, debugging and programming hardware. Used by many of the more powerful microcontrollers to allow in-circuit debugging and re-programming. Logic gate: a small circuit which performs a basic digital function. All digital ICs, including microprocessors are built from logic gates. A large processor could contain millions. These days, logic gates are typically designed using Mosfets. MPU (Memory Protection Unit): digital logic circuitry which interfaces the processor core to memory. Used primarily with multitasking operating systems, the MPU is programmed with information regarding which process “owns” which sections of memory by the operating system and then prevents any process from accessing the memory of other processes unless explicitly permitted. Detects and prevents both accidental memory corruption due to software bugs as well as preventing malicious software from interfering with other processes or stealing sensitive data from their memory. Micro, microcontroller: a small, low-power computer chip. They usually have memory and interface circuitry within the chip. Microcontrollers are built into vehicles, appliances and so on. As the name suggests, are used to control the functions of those devices. Microprocessor, processor: a computer chip, consisting of an instruction core and support circuitry. The heart of all computers, often referred to as a CPU or Central Processing Unit. See also: microcontroller. MIPS (millions of instuctions per second): a measure of processor speed, the number of instructions that a processor can execute in a second. This is related to the clock rate; for most modern processors, the clock rate and MIPS figure are identical since they can dispatch one instruction for each core clock pulse. Useful for comparing performance between different chips of a similar design, but not necessarily between different designs due to differing instruction set efficiency. See also: DMIPS. Multiplexer: a circuit which feeds one signal (analog or digital) to one of several inputs or outputs of another circuit. These can be used to expand the number of effective inputs of an ADC, by connecting different signal sources to the ADC’s input at different times. They siliconchip.com.au can also be used to allow a microcontroller pin to have several different functions, with the software instructing the multiplexer to select which function should be connected to that pin. Multiplier: the part of a CPU core which can calculate the result of multiplying two numbers. Multiply is a very common operation in some pieces of software and the multiplier performance can determine the overall performance of the software. A 32bit multiplier is one which can multiply two 32-bit numbers. Faster multipliers take up more space on the chip; a single-cycle multiplier is fastest but also large. Multiply-accumulate: an instruction which multiplies two numbers and then adds the result to a third number before storing it. A common instruction found in DSPs, sometimes with an option to “saturate” the result (ie, prevent it from rolling over if it gets too large). Used, for example, in Fast Fourier Transform algorithms for spectrum analysis. NXP (NXP Semiconductors): semiconductor design and manufacture company, previously owned by Philips. Peripheral: circuitry within a microcontroller which is controlled by, but acts independently of the micro itself. Peripherals perform tasks which are difficult to do with software or that would take up disproportionate amounts of the micro’s processing power to perform. They also allow the micro to do several things simultaneously. Examples include ADCs, DACs, PWM outputs (timers) and serial peripherals (SPI, I2C, etc). PIC: A line of 8-bit, 16-bit and 32-bit microcontrollers and signal controllers from Microchip. See also: dsPIC. PICAXE: a range of budget microcontrollers from Revolution Education (UK), based on PICs but pre-programmed with an interpreter using internal EEPROM. Programmed in BASIC language. PHY (Physical layer): the part of a digital communication device which provides the electrical interface, as opposed to the controller which deals with the protocol itself. This term is typically used in reference to USB or Ethernet interfaces. PWM (Pulse Width Modulation): a scheme where a fixedfrequency square wave is generated with a variable ratio of ontime to off-time. This affects the average level of the PWM signal and this can be used to vary the power delivered to a load (eg, a heater element or motor). Quadrature Encoding: a method for signalling rotation using two digital signals. Consists of two square waves, one of which is phase-shifted by 90°. Commonly used with rotary encoders, for motor or wheel rotation feedback or as part of a user interface (eg, a jog wheel). RAM (Random Access Memory): circuitry where an array of numbers are stored that can easily be changed. RAM is volatile so its contents are lost when power is removed, so it is only used for storing temporary data. RAM is fast to read and write. See also: register. Register: A type of very fast RAM embedded in a processor. Used for storing numbers which are being worked on. There are usually a limited number of registers (eg, 16); when working on larger sets of numbers, their contents are shuffled into and out of RAM. RISC (Reduced Instruction Set Count): a type of processor instruction set which is designed to have few instructions, to allow siliconchip.com.au the processor to be smaller, cheaper and run at higher speeds. ROM (Read Only Memory): memory which can be read but never changed. ROM is used to store things like a processor’s type, unique identification number and fixed sets of instructions for performing specialised tasks. RS-232: a two-wire serial interface with a typical speed of up to 115.2kbps. Works over longer cables than SPI or I2C. RTC (Real-Time Clock): a circuit comprising a low-power oscillator (usually crystal locked) and a timer which keeps track of the number of seconds that pass. RTCs often have battery-backup so that even if the processor loses power, it can still keep track of time. Sample-and-hold: a circuit which freezes an analog voltage at a particular level and holds it there for a certain period. Used in an ADC so that the voltage being converted to a digital format represents the input voltage at a specific point in time, ie, the voltage being converted does not change during the conversion, which could produce an incorrect result. Serial bus: a method of data communication between two or more ICs that only requires a few wires. Data is sent on a serial bus one bit at a time. Some serial buses are unidirectional and some are bidirectional. The number of wires required varies between one and five or so; with more wires, higher speed communication is possible and data overhead is lower. See also SPI, I2C, RS-232. SIMD, Single Instruction Multiple Data: a method to speed up mathematical operations on large amounts of numerical data by processing more than one number at a time. A SIMD instruction typically performs the same operation on two, four or eight numbers at once. SMD (Surface Mount Device): electronic components which are designed to be mounted on the surface of a PCB rather than with leads passing through holes. SMDs are typically much smaller than through-hole parts and because they don’t require holes, can be fitted on both sides of the PCB. SMD microcontrollers come in a large variety of packages, including both leaded and leadless types (eg, BGA or ball grid array). SPI (Serial Peripheral Interface): a simple, high-speed serial communication bus consisting of three wires (clock and bidirectional data) plus ground and a chip select line for each slave. Data rates in excess of 10Mbit are possible, over short distances. Timer: an on-chip counter which can be configured to count in a variety of ways. These can be used to keep track of time, generate PWM outputs, generate periodic interrupts and so on. See also: PWM, RTC, Interrupt. UART (Universal Asynchronous Receiver-Transmitter): a serial peripheral which can be programmed to communicate on a variety of serial buses such as SPI, I2C, RS-232 and so on. USB (Universal Serial Bus): a serial bus designed for connecting accessories to a computer. USB carries bidirectional serial data and a 5V power supply over four pins. The original USB had low-speed (1.5Mbps) and full-speed (12Mbps) modes. USB 2 added a hi-speed mode (480Mbps) and USB 3 adds a 5Gbps mode. USB OTG (USB On-The-Go): a variation on USB which allows a single chip to act as either a host or a device. In other words, you can either plug a device into it (such as USB flash drive) or you can plug it into a computer. This requires a special plug that can take either type of cable. SC JJune une 2012  19