PBM: Development and simulation environment

Depending on your project, you may be interested in having a simulation environment where you can test your solution. In other cases, that's the only option you have since you need to wait for the supplies or works in different groups. Concerning that, simulations can provide an excellent testing bench where you can try the best and worst scenario for your solution, saving you time and money.

In the following picture, you will see how much increase the cost of your projects, when it fails at a certain stage:


The graph was given DfR Solutions in a CORPE Workshop in 2019. Even when they refer to electronics projects, the same can be applied to any engineering field. Having that in mind, Two complementary solutions were selected for this project: MPLAB and ISIS Proteus. Besides, they work great together, as It will explain next:

Simulation Environment

With ISIS Proteus, you can simulate either digital and analogue circuits, but the interesting part comes with the microcontrollers: It does not matter what you like, Microchip, NXP, Texas Instrument, Atmel, ARM... It can simulate them all. Even Arduino boards! I am using ISIS Proteus 7.7 SP2, as I have it from my university lectures. The format is .DSN and you can download my simulation files from the GitHub repository:

ISIS Design

In this case, as it takes a massive amount of calculations with 160 LEDs in the circuit, all the components must be chosen to be digital to be able to run our code in real-time. Apart from LEDs and buttons, you can simulate everything with Proteus: USB connection with the computer, communications protocols, ADCs, buzzers, SD cards, different clocks frequencies...

Development environment

It will depend on the language you are using and the microcontroller: Arduino Studio, Atmel Studio, Energia... and finally MPLAB for Microchip. We are using an old suite from the university:  A student version of an MPLAB IDE v8.92 with C18 Compiler and a PICkit 3 as a programmer. C18 is the old-fashioned developing language for PICs and microchip has officially deprecated it, but I will be using it for this project. 

If you open the MPLAB project (available in GitHub), you will see something like:


Here you can control everything: Compile and execute your code line by line while checking the memory of your microcontroller. Also, Proteus is showing how is the system working. There are more things: You can select breakpoints to check loops or pieces of code, interact with your system using the buttons placed on Proteus and so on. Once you are done with simulations, you can swap to the physical debugger (PICKIT 3 in this case) and do the same with your hardware: line by line, breakpoints, checking memory status...

Fun fact: At the beginning, Pic Bytes Micro was tested with a screen of 10x25 LEDs and it was using LED drivers

Pic Bytes