4
\$\begingroup\$

In the university, even though I did do some PIC programming and project, the project was quite simple. We could always put in a blinking LED as a sign of life into our program or have the code write to the serial port every now and then to let the programmer know that the code is executing ok. However, I am sure that there are some real proper standard ways to (1) debug and (2) simulate the PIC code. This becomes important when we have really huge and complex programs.

I think there is some sort of simulator for PIC but I can't find a link which says "The simulator does ABC and this is how you use it...". So what do the experts here say?

\$\endgroup\$
  • \$\begingroup\$ I don't use PICs (I use mostly the MSP430 where the MSP430-FET programmer can be used for debugging) but it seems that some programmers, e.g. PICKit3 support debugging. \$\endgroup\$ – Renan Nov 20 '14 at 0:19
  • 1
    \$\begingroup\$ Keep in mind the difference between software engineering methods (code coverage analysis, benchmarking, revision control and so on) and tools that facilitate the use of the methods. @AdamLawrence has given you a good answer on the tools. I believe MPLAB X has a code coverage analysis tool. \$\endgroup\$ – Spehro Pefhany Nov 20 '14 at 2:24
5
\$\begingroup\$

The PICkit3, ICD3 and REAL ICE programmers/debuggers from Microchip all support various levels of debugging. All of these allow you to pause execution, set breakpoint(s) and view variables / SFRs / CPU registers / etc. REAL ICE also allows you to stream data out at high speed through DMCI.

Microchip also has their MPLAB SIM simulator, which does a pretty good job of simulating the parts (with exceptions of course). There are also third-party tools like Proteus VSM.

\$\endgroup\$
  • 1
    \$\begingroup\$ I used the MAPLAB Sim 12? years ago (It was DOS based at the time I think). I used it extensively to bit bang a simple RS232 link from first principles. It was a little tedious to calculate the bit timings for testing the serial decoding on a pin. Once done it was a good test to ensure I had not messed with the timing during further development. Later I developed an alternative 125k baud optical link using the UART. Here it was useful to check the timing and register interactions during FIFO interrupts etc. \$\endgroup\$ – Spoon Nov 20 '14 at 12:30
1
\$\begingroup\$

PICsim is an open source program which provide a way to simulate PIC PIC16F628/16F877A/18F452 MCUs. It simulate a complete development kit with useful components such as leds and keypad.

\$\endgroup\$
0
\$\begingroup\$

I have used Proteus 8 from labcenter electronics and found it to be quiet useful for my graduation project. It provides a veriety of circuit components and devices which can be used to great advantage. It also has a virtual compiler for microcontroller programs.

http://www.labcenter.com/index.cfm

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.