Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 22nd May 2009, 08:48 AM   #1
Default PIC16877 question about converting to Hex file

I am a beginner and I want to convert the following program to HEX file and then send it to PIC16F877 . Please can anyone guide and help.
Attached Files
File Type: txt PIC Code.txt (6.4 KB, 37 views)

Last edited by olympus123456; 22nd May 2009 at 01:27 PM.
olympus123456 is offline  
Old 22nd May 2009, 08:58 AM   #2
Default

Download and install MPLAB from MicroChip, and use either that, or the standalone assembler MPASM to asemble the code.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 22nd May 2009, 09:31 AM   #3
Default

Try to learn CCS C compiler or MPLab compiler...This can convert the source code to Hex code. It will give you the complete idea....
Joesamuel is offline  
Old 22nd May 2009, 10:10 AM   #4
Default

hi,
The program listing is full of errors, lots of typo's.!

Ive tidied up the program, removed the errors and it now assembles

As suggested goto: Microchip Technology Inc. - a Leading Provider of Microcontroller and Analog Semiconductors and download the MPLAB IDE V8.0
Attached Files
File Type: asm my1.asm (6.4 KB, 16 views)
__________________
Eric " Good enough is Perfect "
I will NOT answer PM's requesting technical help, please use the Forum
PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/
ericgibbs is offline  
Old 22nd May 2009, 12:07 PM   #5
Red face Downloaded MPLAB

I have MPLAB IDE 8.30 and also i got the PICKIT2 . Could u please guide how to compile it in MPLAB, if you could give me the steps for proceeding further, that will be very much appreciated. Thank you for fixing my errors . Please help me further toooo.


Quote:
Originally Posted by ericgibbs View Post
hi,
The program listing is full of errors, lots of typo's.!

Ive tidied up the program, removed the errors and it now assembles

As suggested goto: Microchip Technology Inc. - a Leading Provider of Microcontroller and Analog Semiconductors and download the MPLAB IDE V8.0
olympus123456 is offline  
Old 22nd May 2009, 12:36 PM   #6
Default

I have used MPASMWIN , from the MPLAB software i downloaded to convert to HEX file. It is giving me errors :

Error in parameter "and" , "documents and settings"

basically its not reading the source file from my desktop. What should i do to fix it ?
olympus123456 is offline  
Old 22nd May 2009, 12:43 PM   #7
Default

Uninstall and reinstall it. Run the wizard when setting up a project.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com/
blueroomelectronics is online now  
Old 22nd May 2009, 01:02 PM   #8
Default

Quote:
Originally Posted by olympus123456 View Post
I have used MPASMWIN , from the MPLAB software i downloaded to convert to HEX file. It is giving me errors :

Error in parameter "and" , "documents and settings"

basically its not reading the source file from my desktop. What should i do to fix it ?
hi,
I have noticed that MPLAB struggles with long file addresses.

Create a newfolder on the 'C' Hard Drive, call it say MyAsm1 and move the asm file from the desktop to that folder.

Also use the MPLAB Project/Project Wizard,, when doing that point the Wizard to MyAsm1 folder and you should be OK.
__________________
Eric " Good enough is Perfect "
I will NOT answer PM's requesting technical help, please use the Forum
PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/
ericgibbs is offline  
Old 22nd May 2009, 01:17 PM   #9
Unhappy

I did as u said eric , so it created three files one of 1Kb , other of 23 Kb and one has extension .mcs
The problem is there is no hex file found but i could see asm code when i open the 23 kb file as the source file

Also i right clicked the my1.asm file and assemble in the project , and it said "build succeeded " . And there are three new files in the folder that i created .err , .LST, and .o files

How do i proceed from here now.

Last edited by olympus123456; 22nd May 2009 at 01:25 PM.
olympus123456 is offline  
Old 22nd May 2009, 01:26 PM   #10
Default

Quote:
Originally Posted by olympus123456 View Post
I did as u said eric , so it created three files one of 1Kb , other of 23 Kb and one has extension .mcs
The problem is there is no hex file found but i could see asm code when i open the 23 kb file as the source file

Also i right clicked the my1.asm file and assemble in the project , and it said "build succeeded " . And there are three new files in the folder that i created .err , .LST, and .o files

How do i proceed from here now.
hi,
By using the 'Build ALL ' option and getting a build succeed you should have a *.hex file.?
To check use 'View'/ Program Memory the hex file should be displayed.
__________________
Eric " Good enough is Perfect "
I will NOT answer PM's requesting technical help, please use the Forum
PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/
ericgibbs is offline  
Old 22nd May 2009, 01:32 PM   #11
Default

Yes, it is displaying when i went to program memory. Its a relieve though after sooo much of writing the code and you fixing it. Really , patience is the key.

Okay good news got ittttt. Hex file is there. Now, how do i send it to the PIC, I have bought PICKIT2.

Last edited by olympus123456; 22nd May 2009 at 01:34 PM.
olympus123456 is offline  
Old 22nd May 2009, 01:42 PM   #12
Default

Quote:
Originally Posted by olympus123456 View Post
Yes, it is displaying when i went to program memory. Its a relieve though after sooo much of writing the code and you fixing it. Really , patience is the key.

Okay good news got ittttt. Hex file is there. Now, how do i send it to the PIC, I have bought PICKIT2.
hi,
Select the PICKIT2 programmer from thr MPLAB Programmer/'select programmer'
also ensure that 'RELEASE' is displayed near the top menu not debug.

Now you are on your own, I dont use that version of programmer,, good luck.
__________________
Eric " Good enough is Perfect "
I will NOT answer PM's requesting technical help, please use the Forum
PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/

Last edited by ericgibbs; 22nd May 2009 at 01:45 PM.
ericgibbs is offline  
Old 22nd May 2009, 01:42 PM   #13
Default

Quote:
Originally Posted by ericgibbs View Post
hi,
I have noticed that MPLAB struggles with long file addresses.
Yes, keep short filenames, directory names, and reasonably close to the root directory.

MicroChip seem stuck back in DOS and 16 bit Windows file systems.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 22nd May 2009, 01:44 PM   #14
Default

Thanks alot Eric. I owe u man.
olympus123456 is offline  
Old 22nd May 2009, 01:46 PM   #15
Default

Quote:
Originally Posted by olympus123456 View Post
Thanks alot Eric. I owe u man.
hi,
Your welcome, I would like to know what the program is supposed to do, can you give a run by.
__________________
Eric " Good enough is Perfect "
I will NOT answer PM's requesting technical help, please use the Forum
PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/
ericgibbs is offline  
Reply

Tags
pic16

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
converting 99 decimal to 0x99 HEX etc.. - newbie question (MPLAB, PIC 16F870) Schwuppes Micro Controllers 6 17th April 2009 03:29 AM
HEX file.Please help macobt Micro Controllers 4 11th March 2009 06:39 PM
Converting S-Video to Composite: Beginner schematic question chson General Electronics Chat 2 29th June 2005 02:49 PM
pdf file Navid Robotics Chat 2 22nd March 2005 08:56 PM
converting file type? Thorpydo Micro Controllers 8 6th May 2004 06:17 AM



All times are GMT. The time now is 04:17 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker