Best Method to watch a variable dynamically

Status
Not open for further replies.

electronicsman

Full Member level 5
Joined
May 4, 2012
Messages
291
Helped
11
Reputation
22
Reaction score
12
Trophy points
1,298
Activity points
3,737
In microchip i want to watch a variable which I know should change like a sine wave. What is the best method to do that? If i put a break point i can only see it at only some instants of time. I want to monitor each and every change on a kind of screen. What is the method i should follow? Please advise.
 

Hi,

Your post is a bunch of riddles.

"Microchip" is a brand name...but I assume you are talking
* about a software.. it can be a windows software, a Linux software, or any other OS, maybe you are talking about software you have written on your own...
* about a specific chip. Maybe a Microcontroller. AVR, PIC, DSPIC or whatever they produce...

Your description sounds as if you are talking about some kind of debugger.
For sure - depending on what debugger you are talking about - it may output variable values as integer, as hex, as decimal on the monitor, or it may be able to write the values to a file...
Maybe it is able to show it like a scope picture...

sinewave.. this does not tell much either. It may be a 1MHz sine with 100 points per fullwave. It can be 50Hz with 8 points per fullwave or anything else.

Variable: could be an 8 bit value, or a 32 bit integer, any bit width fixed point or a floating point....

***

Maybe the straight forward solution is to use a DAC and a scope....

Klaus
 

Previous posts make be guess that you are referring to dsPIC debugging. Besides all open points addressed by KlausST, Microchip RealICE debugger has a data capture feature that might achieve what you want. It's not available with the low end (PICkit, ICD) debuggers.
 

Sorry it is dspic33EP256MC506 micro controller. I am using Pickit3 debugger and the variable is a 16bit integer. The sine wave frequency maximum it could go to is 500Hz. The software is for running the motor. I have not checked if it can write to a file. That will be a useful feature. The board does not have a DAC. The board is MCLV-2 board.
 

Hi,

if the sine frequency is 500Hz and most probably you have more than 3 points per fullwave, this means more than 1500 values per second.
Obviously one can not verify them by looking at the numeric values online.

I see these possible solutions:
* writing to a file and verfy tehm later
* ouput the values via UART, USB (or whatever interface you have) to a PC and write your own validation software
* Add a DAC and verify the analog signals with a digital scope.

Klaus
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…