Question about feeding back values

Thread Starter

hunterage2000

Joined May 2, 2010
487
I am using MPLAB to program a pic for a project. I was wondering is there something in the MPLAB or something I can download that can feedback an actual value on screen i.e show the value of an analog input from a pot. This value can be anything i.e binary, dec or hex.
 
1/ Use MPLAB simulator.

2/ I usually have at least one LED in my circuits so I can use that as a flag.

3/ I have also used a MAX232 to send data to my PC serial port.
 

NorthGuy

Joined Jun 28, 2014
611
I am using MPLAB to program a pic for a project. I was wondering is there something in the MPLAB or something I can download that can feedback an actual value on screen i.e show the value of an analog input from a pot. This value can be anything i.e binary, dec or hex.
Yes. There's a thing called debugger - works for most chips. Requires a debugger, such as PICkit3.
 

jpanhalt

Joined Jan 18, 2008
11,087
MPLab also has MPLab SIM (under debugger menu) built in. That is more of a software simulation rather than a hardware one as suggested by NorthGuy. If you are not using many peripherals and just want to check math and program flow, it works fine. You can set up a watch window and look at your registers or time segments of your program using the "stopwatch" function. You can use it to send a stimulus (e.g., set a pin high, set a recurring stimulus on a pin, or use it to look up a sequence of stimuli) and see whether your code responds appropriately.

MPLab SIM is limited in what it can simulate and is not able to simulate the same things with all chips (e.g., capture using the CCP module). Its advantage is that you have effectively unlimited breakpoints.

John
 

ErnieM

Joined Apr 24, 2011
8,377
Nothing can compare to seeing your actual code running in your actual hardware and walking the instructions as they run step by step. Most PICs have this capability built in, and most of the programmers can do the work. You just have to leave the in circuit programming pins free to use this.

It is such a useful tool I will buy a larger pin count device just to keep these pins free to do this.

Of lesser value are external signals like LEDs, or an RS232 stream. These are good and helpful, but nothing can compare (2 u) to an in circuit debugger.
 
Top