Author Topic: Problems with MPlab IDE  (Read 7607 times)

Offline 5th-axis

  • Chief squatting Hard
  • *
  • Posts: 13
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Problems with MPlab IDE
« on: April 03, 2009, 10:40:48 PM »
Hey,
 What are the correct steps To compile the .asm to hex. I have tried everything and I always get this error:
Error   [141] F:\sleeperrf.asm; 40.23 can't open include file "p12F683.inc": No such file or directory
Error   [141] ; . can't open object file "sleeperrf.obj": No such file or directory.
What am I doing wrong? I am not new to computers and program CNC machines using cad cam software. I am at my whits end. On  another note, I am currently working on the Cad file for a PS3 controller that fits my hands. An XBOX controller is also planned for my son. Finger grooves and all. Ill post pics when its completed, although im months away from it. Any help is appreciated and thanks in advance.

Offline 5th-axis

  • Chief squatting Hard
  • *
  • Posts: 13
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: Problems with MPlab IDE
« Reply #1 on: April 04, 2009, 06:47:35 PM »
Nevermind guys, I figured it out right after I posted this.
 Thanks

Offline 802Chives

  • Sargeant at Arms
  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1304
  • Post quality +10/-0
  • Gender: Male
Re: Problems with MPlab IDE
« Reply #2 on: April 21, 2009, 09:09:02 AM »
hahaha figured it out before we could help you :tup:

Just to clarify for anyone else with this issue:
you generally need 3 files to produce a .hex file in MPLAB IDE using assembly language; .ASM, .LKR, and .INC.

.ASM is the assembly file or the source code, and is unique to your project(the other two are common to most projects and correspond to the chip model).

.LKR is a file that assigns proper locations and keep outs for the program memory of your desired chip.  For 12F683 the file is called 12F683_g.LKR, the g stands for general.(there are 3 options for the .LKR file I always stick with the _g option)

.INC is a file the equates all the common variables to there machine code or hex values.  For example Trisio is actually H'0085' so the .INC file allows you to code using real words rather than hex values.  Dont neccessarily need the .INC if you a robot and can remember all the codes, but most people code in real words that mean something to humans

The two latter files are located in the MPLAB folder usually in program files under the MPASM Suite folder, and can be added to an existing project by right clicking the destined folder in the project tree and adding.  The .INC file belongs in the Header Files folder, and you guessed it, the .LKR belongs in the Linker Script folder.  It is easier to just use Project Wizard and add both files when it prompts you to add files and they will automatically be placed in the right spots.(source files can also be added and removed from the file tree by right clicking or added in the add file prompt)

*note on using project wizard: when you have completed project wizard for some reason mplab displays nothing.  To fix it click View menu and view project to see the file tree.

Once you have the project all set with your 3 files you can "build all" and MPLAB will produce a couple files that correspond to your project.   The most important file produced is the .hex file that will be located in your project folder under the same name as ur project.


Offline 5th-axis

  • Chief squatting Hard
  • *
  • Posts: 13
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: Problems with MPlab IDE
« Reply #3 on: April 21, 2009, 09:42:43 AM »
Yeah, I tend to get spun out a little too easily over simple things. I just did not have the correct suite selected. Thanks for the help though. It is appreciated.

 

SMF spam blocked by CleanTalk
SimplePortal 2.3.5 © 2008-2012, SimplePortal