Download Print this page

Guide To Debugging - Intel Galileo Hardware Manual

Biobots
Hide thumbs Also See for Galileo:

Advertisement

Hardware

Guide to Debugging

with the Intel Galileo
What is debugging?
Debugging is the process of removing and fixing problems in computer programming. It is often the longest
and most difficult part of creating a computer program, and requires skill, experience, and patience. A lot of
patience.
Legend has it, the word came from working on old computers. Back in the 50's computers were the size of
rooms, and problems could occur if moths got stuck in the wiring. The debugger was a person who went
into the room and cleaned out all the moths. Nowadays, you will just have to check your code and also look
carefully at your hardware to make sure things are connected properly. Most likely, you won't find any moths!
Types of Errors
There are three general types of problems you can face working with your microcontroller.
Hardware Errors
Hopefully this is limited to your microcontroller not being plugged in. Hardware errors
are problems arising from the physical wiring and connections between the microcontroller, your computer,
and other external components.
Syntax Errors
Errors that cause the computer to not understand your code. A missing semicolon, or a
wrong number of parentheses or brackets are common syntax errors. Usually these will be caught by the
compiler when you press verify.
Logical Errors
These are not only the most common type of errors, they are the hardest to fix! Yay. A
logical error is not something the computer or microcontroller will notice, but will cause your program to not
behave correctly. Examples include writing formulas wrong, or writing things out of order.
Dealing with Hardware Errors
Prevention
Catastrophic hardware errors are when your microcontroller breaks completely. This could
occur if the microcontroller short-circuits, or if it is overcharged. Prevent short circuiting by keeping your
microcontroller away from exposed metal, and storing it in the anti-static bag, or surrounded by insulators,
such as wood. Don't place directly on plastic, or things that might give you a static shock, don't wrap your
desk in shiny wrapping paper, even if it is festive.
Overcharging occurs when you have external components that aren't interacting correctly with the micro-
controller. Make sure you understand what your external components are doing, and how they do it. Double-
check your wiring, make sure wires aren't touching eaching or move around, and ask someone to look at it,
consult your instructor. You can plug an lLED into where your microcontroller would be connected. If the LED
breaks, or is very bright, something's wrong.
The most common hardware problems are caused by something not being plugged in correctly. If you have
trouble remembering everything, write a checklist, checklists are extremely useful, pilots use them, which
reduces accidents incredibly.
Hardware 31

Advertisement

loading