The idea is to develop a "histogram" or other display showing what parts of the code the processor is spending the majority of its time in. These become the primary target for optimization. It becomes more useful as the code complexity increases, becomes less deterministic and more time critical. On most processors with timed interrupts and readable stacks, a subroutine is added to the timer ISR which reads and records the return address at the TOS (or uses it as an index to a table of values that get incremented for each "hit") so that as the main program runs a "profile" of what parts of the program require the most processor time is built up. The most obvious way to implement this on a PIC is to add a timer or external pin ISR that sends to the host PC an "I'm in subroutine X" byte which got set to the subroutine address being executed at the time of the interrupt. You would have to add a bit of code to set that byte at the start of each subroutine being profiled. --- James Newton (PICList Admin #3) mailto:jamesnewton@piclist.com 1-619-652-0593 PIC/PICList FAQ: http://www.piclist.com or .org -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Tony Nixon Sent: Monday, August 21, 2000 16:07 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: PIC Profiler Dan Michaels wrote: > PIC Prolifer - it just occurred to me that this may be something > that could be put into '877 ICD/debug/monitor that Tony and Wouter > have been doing. > > best regards, > - danM > I am a little 'green' on this subject, what exactly would be of use? -- Best regards Tony ICmicro's http://www.picnpoke.com mailto:sales@picnpoke.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu