Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Program running indicator

Status
Not open for further replies.

BeerBelly

Member
When I write a program, I include a flashing LED or something like that in the programming to indicate that the program is running.
I will sometimes include a flashing code output to indicate which flags are set(count the flashes and spaces). This will show me portions of the code which have been entered or contents of a register.

I'm interested in what other folks do.
 
The flashing LED.. oh yes. That is the most useful debug-tool you can have with microcontrollers. I also use oscilloscope to see how long a certain ISR (or any other task) takes to process.. pin up -> process -> pin low. You can look at the pulse with oscilloscope.
 
It depends on what the device is, but yes, an 'alive' LED, or pulsing LED can be very helpful. The methods MisterT stated are also very good. The more indicators, the more information you can convey; e.g. indicators for Tx/rx, packet received, error, etc. can all be useful to tell you the state of the device both during development and when it's deployed.

I also have used debug messages (software enabled) sent out the communications port, interspersed with the real data packets; you can obviously get more information from a serial message than you can from a flashing LED or two.
 
Similar to the flashing LED, I use a Bi-colour LED. and move the commands Call Red_LED or Call Green_LED around in the code to see where things are going wrong, getting lost, stuck etc...
 
gotta love those leds. I incorporate them in every circuit if I can, You can always disable them when not needed. I've been using the rgb leds lately. more colors available. They also add that extra "eye-candy" :)
 
You can't go wrong with a led slow the blink down you can do all kinds of things with it. I work on AC that use Just use one and it tells whats wrong with the board. But I like a serial backdoor done in software. You can use any pin that you have left as long as it can be a output and two resistors and a plain rs323 cable works with out any added parts.
 
I normally do PIC prgrams using a MikroE development board, which has a plug-in 16x2 char LCD.

So for most things I'll use the LCD as a debugging tool to display variables, results of math and timing processes etc.

It doesn't matter if the final project does not use the LCD, I just strip the LCD code out at the end and compile for the smaller PIC. Pin #defines can be helpful there.

Sometimes I'll set a pin HI at the start of a process, and LO again after the process completes, and use a 'scope to see how long the process takes (as said by Mr T), but if working with the LCD then I reset a timer at the start of the process then grab the timer at the end, and display it on the LCD. So I can see the 32bit divided by 32bit math takes 0.6mS to 0.9mS on averate (etc).
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top