Pic Simulator 2.0

Frequently asked questions

1. How can I compile/assemble an asm file?

Ans. The asm file is compiled automatically as soon as you open or edit it.

2. How can I open a asm file?

Ans. Menu=>Open asm

3. How can I edit opened asm file?

Ans. Just click or touch the icon.

4. Can I assemble and simulate mplab asm files?

Ans. Yes, you can compile and simulate most of mplab samples without change. But, if the sample contains macro, or includes other files than device inc file, then that cannot be compiled.

5. Can I simulate mplab's hex file?

Ans. Currently no. We will add this support in next update.

6. Which mcu/devices are supported by this simulator?

Ans. All 8 bit mcu from microchip. There are nearly 200 MCUs of PIC10xx, PIC12xx and PIC16xx series. All are supported by this assembler and simulator.

7. Can I simulate port and external interrupt?

Ans. Yes. But, timers, spi, usart and other modules are not supported by the simulator. Anyway, the assembler can compile all codes (timers, adc, spi....)

8. How can I start, step, run and stop simulation?

Ans. Just click or touch the appropriate icons.


9. How can I see the errors in my asm file?

Ans. The error lines have yellow background. Just click or touch the yellow lines to see error message.


10. How do I know which line is executing now?

Ans. The current executing line has green background. See image of 9.

11. How can I see the hex or machine code of a line?

Ans. At left of each line, the blue number is hex/machine code. See image of 9.

12. How do I know the value of my variables?

Ans. Click the icon. Then you can see the name, address and current value of every variable.



13. How can I add variable to watch?

Ans. Variables are added to watch automatically. If there are many variables, just scroll up down by touch.

14. Can I give input to port pins?

Ans. Yes. Just click/touch and then click the 'IO' tab.
means 1, and means 0.
To give input, just click on the box.



15. Why a port pin may not change when I click on it?

Ans. If you have set a port pin in output mode in your asm code, then it does not respond to input.

16. What is the difference between IO and Pins section?

Ans. In 'Pins' tab, you see the original pin layout. But, in IO section, only port pins are shown.

17. Which files can I include from my asm code?

Ans. You can include only device include files, for example, "include p16f84.inc".

18. Can I generate hex file from asm code?

Ans. Yes, just click "menu=>export hex".

19. Can I generate list file from asm code?

Ans. Yes. When you open or edit an asm file, then generated list file (not asm) is shown to you. You can save this file by "menu=>export list".

20. Can I create new file?

Ans. Yes. menu=>new asm. Or, if you want to use other asm sample as template, then open that asm file. Then, click "menu=>save as".

21. How can I see SFR values at runtime?

Ans. Open the 'watch' window and then click on the 'SFR' tab.



22. Which instructions are supported by the assembler?

Ans. All pic instructions are supported. Here is the list:

ADDWF, ANDWF, CLRF, CLRW, COMF, DECF, DECFSZ, INCF, INCFSZ, IORWF, MOVF, MOVWF, NOP, RLF, RRF, SUBWF, SWAPF, XORWF, BCF, BSF, BTFSC, BTFSS, ADDLW, ANDLW, CALL, CLRWDT, GOTO, IORLW, MOVLW, RETFIE, OPTION, RETLW, RETURN, SLEEP, SUBLW, TRIS, XORLW

23. Is there any sample projects with the PicSimulator?

Yes. When you install PicSimulator, then a directory named "PicSimulator" is added to your sdcard. In that folder, there are some samples which you can open and test.

24. I have an asm file. But, I don't know, which pic device is compatible with this code. How can I test that?

Ans. In your asm file, remove the line 'include ...'. Then set "Default device" from "menu=>default mcu". Test with many devices. If it doesn't show any error, then that device is compatible with your asm file.

25. Where can I get latest information and bug-fixes about this simulator?

Ans. http://opentechbd.com/picsimulator