PDA

View Full Version : help to program an PIC with MPLAB



mikmac
- 20th April 2009, 01:56
Hi,

I'm new to pic programming and I need help wth this assignment.

I bought an picKit 2, and now I can't prog an PIC 16F627,
i'm programming in c.

I'm using MPLAB v8.10, and I don't know if it is bad configuration
about set language tool location... or what...

I can't produce a hex file with MPLAB v8.10 for PIC 16F627,
it appears those errors below. I have tried many ways to alter this
but it is allways the same errors :(.

I set those configurations when I initiated the project programming
Active Toolsuite:
Toolsuite Contents:
C:\..\PICC\Ccsc.exe

MPLAB IDE v8.10

Active Toolsuite:
CCS C Compiler for PIC10/12/14/16/18/24/dsPIC30/dsPIC33

Toolsuite Contents
CCS C Compiler (ccsc.exe)

C:\..\PICC\Ccsc.exe

Executing: "C:\progPICS\PICC\Ccsc.exe" +FM "teste_01.c" +DF +LN +T +A +M +Z +Y=9 +EA

*** Error 24 "C:\PROGPICS\PICC\devices\16F627.h" Line 2(9,18): Unknown device type
1 Errors, 0 Warnings.

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

when I altered to HI-TECH programming

Active Toolsuite:
Toolsuite Contents:
C:\..\PICC\PRO\9.65\bin\picc.exe

Active Toolsuite:
HI-TECH Universal ToolSuite

Toolsuite Contents:
HI-TECH ANSI C Compiler


C:\..\PICC\PRO\9.65\bin\picc.exe

If anybody can help me I would appreciate it.

mister_e
- 20th April 2009, 03:43
Without code and such it's a bit hard to answer that.

Not sure for CCS, but it might just be because you have the demo version. Still, 16F627 is an old one, 16f627A is the "new" version, much recommended.

I'm much a fan of Hi-Tech C rather than CCS... not impressed at all with CCS... probably one of the many reason why Microchip Bought Hi-Tech company instead of CCS :rolleyes:

Anyways, here it's Melabs PicBasic forum, questions about Mplab third-party tool would be better answered on Microchip forum (http://www.microchip.com/forums/Default.aspx?) or via their tech support (http://support.microchip.com/scripts/slxweb.dll/external?name=webticketcust) or still via the respective third-party forums.

mister_e
- 20th April 2009, 04:04
Oh BTW, 16F627 is not supported by PICKIT 2 in MPLAB (8.30 here) but only in PICKIT 2 standalone application.

16F627A is supported in MPLAB & in the standalone application.

mikmac
- 20th April 2009, 15:29
Thanks for your interest.

If you says that 16F627 isn't supported by PICKIT 2 in MPLAB. And that seems to be right to me. So, how do I can program this pic. You say that you use HI-TECH C, where do I get that software?
I think I will need a different bootloader than that I used with for CCS...
Sorry, i'm a bit without any direction to go on :( ...

mister_e
- 20th April 2009, 16:01
Download the latest MPLAB version on Microchip website, and install Hi-Tech C pro, in Lite mode.
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&part=SW007002

OR go on Hi-Tech website, and download it from there
http://www.htsoft.com/microchip/downloads/demos.php

Here's the link for Hi-Tech compiler forum
http://forum.htsoft.com/all/ubbthreads.php

If you really have the ol' version of 16F627, you generate the .HEX files in MPLAB (when you compie your code, then import it in the PICKIT 2 standalone application, then program your PIC from there.