Tech Support

unable to find device

Q:

tried the hello world example on the microchip tutorial and followed the steps through several times.  When it comes to building the code i get the following error: 

Error - Device not specified. Use /p option to specify a device.
Errors    : 1

I have selected the device i want to use through configure->select device

Im not sure what the /p option actually means and if it actually means the PIC device :s

i have ran a check on the ICD3 and it says working fine and can find the PIC when it is plugged in.

Any ideas? 
 

-----------------------

A:

If you are using assembly language, in the "MPASM™ Assembler, MPLINK™ Object Linker MPLIB™ Object Librarian User’s Guide" on page 44 it says...

/p Set the processor type, where processor_type is
a PIC1X MCU device, e.g., PIC18F452.
(That is a "command line option")

Then on page 112 it says...

4.55 processor - SET PROCESSOR TYPE...
processor 16f877a ;Sets processor to PIC16F877A
(another way to set the processor type in your program.)

Then on page 99 it says...
(Note: I use this option)

list [list_option, ..., list_option]
p=type
Set processor type; for example, PIC16F54. See
also processor.
Note: Processor type is set in MPLAB IDE
(Configure>Device.)

Or if your Pic is a 16F1938, then stick this line at the top of your program...

 LIST   P=PIC16F1938

Then you don't need the /p command line option.

Here is the MPASM manual...
http://ww1.microchip.com/downloads/en/devicedoc/33014j.pdf

FYI - "switches" like /p are from the old world of "DOS" line commands. These can be seen from MPLAB in Project/Build Options/Project and then click on the MPLINK tab. Then you will see something like this...
/m"$(BINDIR_)$(TARGETBASE).map" /w /o"$(BINDIR_)$(TARGETBASE).cof"

And it is using /m /w and /o "command line switches".

If you are using Windows, you can see how this works by clicking on Start/All Programs/Accessories/Command Prompt

Then you are now using DOS and the command line prompt.

Type in help [then press enter]

help /?
help print
print /?
etc.

So when MPLAB compiles, it calls mpasm and will also include command line switches as they are set by default or changed by you.

I would not mess with the command line switches, rather specify the processor type in your program.

Then you can search google.com for this...
LIST   P=PIC16f

...and see examples of where other people have named the prosessor type in their programs. Here is that search...
http://www.google.com/#sclient=psy&hl=en&q=LIST+++P%3DPIC16f&aq=0v&aqi=g-v2g-o1&aql=f&oq=&gs_rfai=&pbx=1&fp=e18ec2db23988f7d
 

Hits:  UpdateTime:2010-12-10 16:48:44  【Printing】  【Close

Tech Support

Hot Products

Topsee International Co.,LTD
Tel:0755-2699 3393
Email:info@topsee.com.cn
Web:www.topsee.com.cn