Question about feeding back values

Discussion in 'Embedded Systems and Microcontrollers' started by hunterage2000, Apr 26, 2016.

  1. hunterage2000

    Thread Starter Active Member

    May 2, 2010
    400
    0
    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.
     
  2. nigelwright7557

    Senior Member

    May 10, 2008
    487
    71
    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.
     
  3. NorthGuy

    Active Member

    Jun 28, 2014
    603
    121
    Yes. There's a thing called debugger - works for most chips. Requires a debugger, such as PICkit3.
     
  4. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,677
    899
    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
     
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    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.
     
Loading...