ChipCenter Questlink
SEARCH CHIPCENTER
Search Type:
Search for:




Knowledge Centers
Product Reviews
Data Sheets
Guides & Experts
News
International
Ask Us
Circuit Cellar Online
App Notes
NetSeminars
Careers
Resources
FAQ
EE Times Network
Electronics Group Sites

EMBEDDED MULTITASKING


Circuit Cellar Online
THE MAGAZINE FOR COMPUTER APPLICATIONS
Circuit Cellar Online offers articles illustrating creative solutions
and unique applications through complete projects, practical
tutorials, and useful design techniques.

EMBEDDED MULTITASKING

The Easy Way
by Charles Kosina

Start ý An Example ý State Machine Control ý Keyboard Scanning ý Receive Serial Data ý LCD Module ý Transmit Data ý Debugging Techniques ý Other Options ý Sources and PDF

DEBUGGING TECHNIQUES

The built-in JTAG programming and emulation support on the ýF000 make debugging a dream rather than the nightmare it can be with other chips. But, you donýt always get this luxury. Debugging techniques have been covered in previous Circuit Cellar articles, so I wonýt go into too much detail here. [1, 2]

One technique that works well is to send out a character to a serial port representing the current state of a state machine. Listing 6 shows how this is done. It is similar to Listing 3 with added debug instructions. By comparing the current state with the previous state, you send out the debug character only once. State 0 will send out the ASCII character A and so on. This way, you can trace the program flow within a state machine. The penalties are a reduction of the program execution speed and having to use a serial port that may be required for other tasks. Nevertheless, this is one technique that has served me well numerous times.

If you donýt have a UART available, there are other options. A spare I/O port bit can be used with bit-banger software to emulate a serial port. An LCD module can also be used to show the current state. In any case, use the highest bits per second possible to reduce the speed penalty.

PREVIOUSNEXT


Circuit Cellar provides up-to-date information for engineers. Visit www.circuitcellar.com for more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com or subscribe online. ýCircuit Cellar, the Magazine for Computer Applications. Posted with permission.
Click here to get your listing up.

Copyright © 2003 ChipCenter-QuestLink
About ChipCenter-Questlink  Contact Us  Privacy Statement   Advertising Information  FAQ