Page 1 of 1

Salvo as a board bringup debugger

PostPosted: Wed Jun 18, 2008 4:00 am
by kenward1000
One technique that has worked well for me during board bring up with Salvo, is to create a low priority task to blink an LED. I use OSDelay(500msec) between turning the LED on and off.

In practical terms, any time the LED is always on or off, there is a serious problem. If the LED is blinking, then Salvo is at least running, and therefore usually the rest of the code as well. A blinking blue LED is very soothing.

Example: my UART was getting flooded with noise on the RX line. The LED was not blinking, so this was a clue that the PIC was so busy doing something (in this case spending all it's time looping through the ISR) that Salvo was getting no OSTicks.

Example: I was having conflicts with multiple devices on the SPI bus, and the PIC was stuck in a 2 instruction loop waiting for the BF flag (which was never going to be set). The LED was always on, alerting me that something was seriously wrong.

I've been using Salvo on PIC 18's for almost a year now, and it works great. I have very limited memory resources but I wanted a product with source access and strong technical support. Salvo is the clear winner for my products.

Ken


Re: Salvo as a board bringup debugger

PostPosted: Wed Jun 18, 2008 4:12 am
by aek
Thanks, Ken!

A blinking LED that runs as a low-priority task is a great way to see at-a-glance that things are working properly.

------------------


Re: Salvo as a board bringup debugger

PostPosted: Wed Jun 18, 2008 10:01 am
by aek
Another thing I have found to be useful is to do the following in the idling hook:
code:
set IO low;
sleep;
set IO high;

This gives a high pulse that is indicative of how much the system is loaded. A short pulse indicates that that the system is asleep the majority of the time (as it should be in an event-driven system). As the pulse grows in length, the system is spending more time multitasking. And if it goes dc, the system is running tasks all the time with no headroom left (or you've accidentally failed to yield out of a task).

------------------