Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] How do I test an assembly language program? Software required?

Status
Not open for further replies.

coder123

Newbie level 4
Joined
Jun 11, 2015
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
42
How do i test an assembly language program ? Softwares required ?

Hello I am new with PIC 16f676 .
How do i test a simple program and run it using PIC16f676. Which software do i need to install and test it ? Also how do i compile and run it ?

Thank you
 

milan.rajik

Banned
Joined
Apr 1, 2013
Messages
2,528
Helped
540
Reputation
1,078
Reaction score
524
Trophy points
1,393
Activity points
0
Re: How do i test an assembly language program ? Softwares required ?

If you want to write code in asm then you need to install MPLAB or MPLAB X and MPASM. If you want to code in C then you can install free version of XC8 Compiler. For XC8 you need MPLAB X. It won't work with MPLAB. If you want to do C coding with MPLAB or MPLAB X then you can install C18, Hi-Tech PICC Compilers. Also you can try mikroElektronika's mikroC PRO PIC Compiler. In the demo version of MikroC PRO PIC you can write code upto 2 KB. You can also do inline assembly coding in all the Compilers mentioned.

You can use Proteus or Oshonsoft Simulators to test the working of the PIC project if you don't have the hardware. Testing in hardware will be better.
 

xenos

Full Member level 4
Joined
May 9, 2015
Messages
212
Helped
82
Reputation
164
Reaction score
81
Trophy points
28
Location
127.0.0.1
Activity points
1,182
Re: How do i test an assembly language program ? Softwares required ?

In MPLAB you can test the program if you select Debuger->MPLAB SIM.
The simulator MPLAB SIM, allow you to run program with breakpoints,step-by-step,timing code,watching variables etc.

If you want to use C in stead of assembly, I strongly recomend to use PIC18F microcontrollers in stead of PIC16.
If you insist on PIC16, use SDCC or HitechC.
If you use PIC18F, use MCC18 or XC8.
I do not recommend MikroC...
 

FenTrac

Full Member level 4
Joined
Jul 6, 2014
Messages
204
Helped
37
Reputation
74
Reaction score
39
Trophy points
28
Location
West Coast
Activity points
1,756
Re: How do i test an assembly language program ? Softwares required ?

Once you have your program written and debugged, you will need a PIC programmer, such as a pickit3, to load the .hex file into the Pic so you can run it. MPlab supports several programmers. A free program called picpgm supports even more types of programmers.
There are bootloader programs that can be loaded onto the Pic, using a programmer, such as tinybld198, They will allow .hex files of programs to be loaded into the Pic using the Pic's serial interface, without using a programmer.
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,931
Helped
4,874
Reputation
9,766
Reaction score
4,662
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
127,018
Re: How do i test an assembly language program ? Softwares required ?

... XC8 works fine in MPLAB. It's a stand alone compiler, the IDE you use (if any) isn't important.

The OP wants to debug assembly language code. The best tool by far is MPLAB/MPLABX in which you can import your assembly instructions or a ready built .hex file and use the simulator to trace and monitor your program, register contents and variables.

An alternative is to use Oshonsoft's "PIC Simulator IDE" (note: despite it's name, do not use "PIC16F Simulator IDE") and load the hex file before running simulation. Oshonsoft's program is more visual than MPLAB/MPLABX but is very, very slow in comparison!

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top