Loading

Methods For Debugging Microcontroller Hardware

Submitted by: Dyanna Eada

Most of these debugging strategies can be utilized to any microcontroller given that they do not use any certain instruments.Basic debugging methodsThere are a lot of ways to debug hardware:

ICE.

ICD.

Simulation.

Serial RS232.

LCD.

LED.

Hardware pins.

[youtube]http://www.youtube.com/watch?v=j0S-eHfs2p8[/youtube]

Logic Analyzer.

ICEThe In Circuit Emulator is the most costly way to debug your hardware. You purchase a unique processor that physically can take the spot of the normal processor. This particular processor allows computer software entry to the inner operation of the processor (you can set breakpoints on hardware modules).ICD (PIC microcontroller)The subsequent greatest thing to ICE is ICD (In Circuit Debug) Sometimes recognized as (BDM – History Debug Mode – for non PIC microcontrollers) let you single step via code really working in the target processor.For ICD the processor has a tiny sum of created in hardware that can halt the processor when the plan reaches a particular deal with. The software can then read back again all the registers and processor state.SimulationWith a resource code simulator you can phase by way of the large level language code and see its impact on memory and variables devoid of acquiring to appear at the assembler code right. This lets you concentrate on the substantial stage language operation and lets you concentrate on the dilemma you are making an attempt to remedy.A single great advantage of the simulator is that you do not have to wait to download and program the target processor (you do have to re-compile the code soon after modifying its supply code though). So you can reduce out the time consuming programming process just by employing the simulator.Note: Simulators are no excellent for debugging interrupts. Debugging makinguse of hardwareSerial RS232Newer microcontrollers have a constructed in UART supplying you a almost no cost debug tool that uses minimal sources and wants quite small software coding.For debug output you need to link the UART output pin (TX) to a ideal degree translator circuit e.g. a MAX232 chip. You may even get absent with direct connection (by means of a resistor) to the input of your Computer serial port (but this is dependent on the specifics of your Pc hardware) – making use of a translator chip will often operate.Advantages

Minimum coding.

Basic to use.

Minimal further hardware.

Drawbacks

Can take a lengthy time to output a character (~1ms).

Takes even extended for blocks of characters (~10s of ms).

Requirements extra hardware.

Even by means of it can take time to output a character it is a helpful debug device as you can output the worth of a variable to see what the microcontroller is actually performing.LCDAn LCD (Liquid Crystal Display) presents a handy way of displaying debugging information. It is also helpful for many various programs that want a text display output.It is a module that displays text characters and a frequent screen dimensions is two rows of sixteen characters.Most LCD modules use the HD44780 controller chip which is why LCD routines constructed into substantial degree languages always work.Benefits

Quite quick update (40us 4 bit data bus).

Useful in several jobs as the main show interface.

Basic to interface to an eight bit port (only needs six of the 8 bits).

Disadvantages

Utilizes up an eight bit port.

Hardware is more expensive (e.g. in comparison to a serial port chip).

LEDEmploying an LED as a microcontroller ‘alive’indicator.Even even though it is these kinds of a easy factor to blink an LED on and off it is really beneficial as a debugging device as you can notify at a glance whether the code you just downloaded is doing work.Occasionally you can will incorrectly set parameters on the programming application or compiler which will end the code dead.The LED indicator gives a speedy wellbeing examine for your microcontroller which is effortless to see.Pin DebuggingThis is the simplest and crudest debugging method utilizing any available port pin. Merely set or reset this pin at any level in the code that you want to check.It has minimal effect on the code pace or dimension and can give you the adhering to details:

You can tell if the code is lively.

It gives you the repetition rate.

It offers you the routine time length (if you set the pin at the start and reset it at the stop).

Note: Todo testing you require an oscilloscope or a frequency counter and time interval measuring instrument. Logic AnalyzerThis tool attaches to the pins you want to observe and captures the waveforms exhibiting multiple traces on a single exhibit. It uses a set off module that can be set to activate on combinations of the input signals or on their length. So you can set off on specific designs or on glitches or equally.For non-microcontroller based mostly techniques (e.g. 80486 primarily based) in which the info and deal with bus are subjected a logic analyzer can present the deal with and data organized into hex words i.e. readable. Some can disassemble the recommendations exhibiting what the processor was carrying out at the trigger position.For a microcontroller based method the logic analyzer can be helpful in examining peripheral operation e.g. for debugging the SPI or I2C busses some logic analyzers also have created in support for theseprotocols.An additional use for the logic analyzer is to capture output above a lengthy interval of time relying on the memory capability of the logic analyzer.SummaryIn small there are many tactics to debug your hardware ranging from easy (an output pin) to complicated (a logic analyzer). All of them can be useful depending on the dilemma you want to resolve.You can find far more information here and how to build a web site like it right here.

About the Author: picaxe

christianesro.multiply.com/journal/item/365/Techniques_for_Debugging_Microcontroller_Hardware

Source:

isnare.com

Permanent Link:

isnare.com/?aid=878629&ca=Internet