pic12c508A programing problem Help Need...

Status
Not open for further replies.

Senthilkumar_rjpm

Full Member level 2
Joined
Jul 21, 2009
Messages
123
Helped
15
Reputation
30
Reaction score
15
Trophy points
1,298
Location
chennai
Activity points
2,039
Hi All...
Today i commit a small project using 12c508. This is first time i am using this ic. So i start to check a small blink code....

//=========================

#include <12C508a.h>
#fuses INTRC, NOWDT
#use delay(clock=4000000)

//=========================
void main()
{

while(1)
{
output_high(PIN_GP0);
delay_ms(500);
output_low(PIN_GP0);
delay_ms(500);
}

}

//=========================


I am using MPLAB6.30.
Compiler CCS PCM-3.114 (original version)
My problem is;
I didn't find 12c508 header file in Installed folder(PIC C- Devices).

If i build a code it shows "BUILD FAILD".

Why 12c508 Header file missing in MPLAB Project Bar?

Is there any source to add 12c508 header file in that folder(PIC C- Devices).?

Pls healp me..
Thanks in Advance...
 
Last edited:


obviously you will get error as it cannot find the header file. I think you should check for language tool weather it is correctly and please check in "build options" for "include search path" probably this should be missing. Finally try with a different processor to confirm weather the compiler works properly if it works then MPLAB or CCS does not support 12C508.

Thankyou
 

Thanks for your reply... Actually now i am using this same MPLAB & CCS for other microcontrollers. So Both are working good. The supporting devices of compiler also shows this ic(12c508a) My doubt is Why header file of 12c508a Missing? Any other option to add header file in CCS? or How to work with 12C508 in this same compiler (or Any other free versions?).... Any one Plz Help;....
 

Thats quite an old micro, maybe they have stopped supporting it?

Here is Hi-Tech header file you might be able to use.

Code:
/*
 *	Header file for the Microchip 
 *	PIC 12C508 
 *	PIC 12C509 
 *	PIC 12F508 
 *	PIC 12F509 
 *	PIC 12C508A 
 *      PIC 12C509A 
 *      PIC 12CE518 
 *      PIC 12CE519 
 *      PIC 12CR509A 
 *      rfPIC 12C509AG 
 *      rfPIC 12C509AF 
 *	Baseline Microcontrollers
 */

volatile unsigned char	INDF	@ 0x00;
volatile unsigned char	RTCC	@ 0x01;
volatile unsigned char	TMR0	@ 0x01;
volatile unsigned char	PCL	@ 0x02;
volatile unsigned char	STATUS	@ 0x03;
         unsigned char	FSR	@ 0x04;
volatile unsigned char	OSCCAL	@ 0x05;
volatile unsigned char	GPIO	@ 0x06;

         unsigned char control	OPTION	@ 0x00;
volatile	unsigned char control	TRIS	@ 0x06;

/*	STATUS bits	*/
bit 	GPWUF	@ (unsigned)&STATUS*8+7;
bit	PA0	@ (unsigned)&STATUS*8+5;
bit 	TO	@ (unsigned)&STATUS*8+4;
bit 	PD	@ (unsigned)&STATUS*8+3;
bit 	ZERO	@ (unsigned)&STATUS*8+2;
bit	DC	@ (unsigned)&STATUS*8+1;
volatile bit	CARRY	@ (unsigned)&STATUS*8+0;

/*	OPTION bits	*/
#define		GPWU	(1<<7)
#define		GPPU	(1<<6)
#define		T0CS	(1<<5)
#define		T0SE	(1<<4)
#define		PSA	(1<<3)
#define		PS2	(1<<2)
#define		PS1	(1<<1)
#define		PS0	(1<<0)

/*      OSCCAL bits     */
#if defined(_12C508) || defined(_12C509)
volatile bit     CAL3    @ (unsigned)&OSCCAL*8+7;
volatile bit     CAL2    @ (unsigned)&OSCCAL*8+6;
volatile bit     CAL1    @ (unsigned)&OSCCAL*8+5;
volatile bit     CAL0    @ (unsigned)&OSCCAL*8+4;
#elif	defined(_12C508A) || defined(_12C509A) ||\
	defined(_12CE518) || defined(_12CE519) ||\
	defined(_12C509AG) || defined(_12C509AF) ||\
	defined(_12CR509A)
	volatile bit     CAL5    @ (unsigned)&OSCCAL*8+7;
	volatile bit     CAL4    @ (unsigned)&OSCCAL*8+6;
	volatile bit     CAL3    @ (unsigned)&OSCCAL*8+5;
	volatile bit     CAL2    @ (unsigned)&OSCCAL*8+4;
	volatile bit     CAL1    @ (unsigned)&OSCCAL*8+3;
	volatile bit     CAL0    @ (unsigned)&OSCCAL*8+2;
#elif defined(_12F508) || defined(_12F509)
volatile bit     CAL6    @ (unsigned)&OSCCAL*8+7;
volatile bit     CAL5    @ (unsigned)&OSCCAL*8+6;
volatile bit     CAL4    @ (unsigned)&OSCCAL*8+5;
volatile bit     CAL3    @ (unsigned)&OSCCAL*8+4;
volatile bit     CAL2    @ (unsigned)&OSCCAL*8+3;
volatile bit     CAL1    @ (unsigned)&OSCCAL*8+2;
volatile bit     CAL0    @ (unsigned)&OSCCAL*8+1;
#endif
	
/*	GPIO bits	*/
#if defined(_12CE518) || defined(_12CE519)
	volatile bit     SCL     @ (unsigned)&GPIO*8+7;
	volatile bit     SDA     @ (unsigned)&GPIO*8+6;
#endif
volatile bit	GP5	@ (unsigned)&GPIO*8+5;
volatile bit	GP4	@ (unsigned)&GPIO*8+4;
volatile bit	GP3	@ (unsigned)&GPIO*8+3;
volatile bit	GP2	@ (unsigned)&GPIO*8+2;
volatile bit	GP1	@ (unsigned)&GPIO*8+1;
volatile bit	GP0	@ (unsigned)&GPIO*8+0;


#define CONFIG_ADDR	0xFFF

/* MCLR Pin function */
#define MCLREN		0xFFF	// master clear reset enable
#define MCLRDIS		0xFEF	// master clear reset disable

/*watchdog*/
#define WDTEN		0xFFF	// watchdog timer enable
#define WDTDIS		0xFFB	// watchdog timer disable

/* code protection */
#define PROTECT		0xFF7	// protect the program code
#define UNPROTECT	0xFFF	// do not protect the program code

/*osc configurations*/
#define EXTRC   	0xFFF	// external resistor/capacitor
#define INTRC		0xFFE	// internal
#define XT		0xFFD	// crystal/resonator
#define LP		0xFFC	// low power crystal/resonator
 

Unfortunately your device is not supported by CCS. Here are CCS device supports. Try with 12F508 instead of 12C508.

Supported devices:


* Indicates new parts supported with v1.40 of the device file.

+ Indicates parts that require 4.75V minimum VDD for programming.
PICkit 2 may not be able to generate sufficiently high VDD,
so an external 5.0v power supply may be required.

# indicates Midrange parts that support low Vdd programming


Baseline Devices
----------------
PIC10F200 PIC10F202 PIC10F204 PIC10F206
PIC10F220 PIC10F222
PIC12F508 PIC12F509 PIC12F510 PIC12F519
PIC16F505 PIC16F506
PIC16F54 PIC16F57 PIC16F59


Midrange Devices
----------------
PIC12F609 PIC12HV609
PIC12F615 PIC12HV615
PIC12F629 PIC12F635# PIC12F675 PIC12F683#
PIC16F610 PIC16HV610 PIC16F616 PIC16HV616
PIC16F627 PIC16F628 PIC16F639
PIC16F627A PIC16F628A PIC16F648A
PIC16F630 PIC16F631 PIC16F636# PIC16F676
PIC16F677 PIC16F684# PIC16F685# PIC16F687#
PIC16F688# PIC16F689# PIC16F690#
PIC16F72+
PIC16F73+ PIC16F74+ PIC16F76+ PIC16F77+
PIC16F716
PIC16F737+ PIC16F747+ PIC16F767+ PIC16F777+
PIC16F785 PIC16HV785
PIC16F84A PIC16F87# PIC16F88#
PIC16F818# PIC16F819#
PIC16F870 PIC16F871 PIC16F872
PIC16F873 PIC16F874 PIC16F876 PIC16F877
PIC16F873A PIC16F874A PIC16F876A PIC16F877A
PIC16F882#
PIC16F883# PIC16F884# PIC16F886# PIC16F887#
PIC16F913# PIC16F914# PIC16F916# PIC16F917#
PIC16F946#

PIC18F Devices
--------------
PIC18F242 PIC18F252 PIC18F442 PIC18F452
PIC18F248 PIC18F258 PIC18F448 PIC18F458
PIC18F1220 PIC18F1320 PIC18F2220
PIC18F1230 PIC18F1330
PIC18F2221 PIC18F2320 PIC18F2321 PIC18F2331
PIC18F2410 PIC18F2420 PIC18F2423 PIC18F2431
PIC18F2450 PIC18F2455 PIC18F2458* PIC18F2480
PIC18F2510 PIC18F2515 PIC18F2520 PIC18F2523
PIC18F2525 PIC18F2550 PIC18F2553* PIC18F2580
PIC18F2585
PIC18F2610 PIC18F2620 PIC18F2680 PIC18F2682
PIC18F2685
PIC18F4220 PIC18F4221 PIC18F4320 PIC18F4321
PIC18F4331 PIC18F4410 PIC18F4420 PIC18F4423
PIC18F4431 PIC18F4450 PIC18F4455 PIC18F4458*
PIC18F4480
PIC18F4510 PIC18F4515 PIC18F4520 PIC18F4523
PIC18F4525 PIC18F4550 PIC18F4553* PIC18F4580
PIC18F4585
PIC18F4610 PIC18F4620 PIC18F4680 PIC18F4682
PIC18F4685 PIC18F6310 PIC18F6390 PIC18F6410
PIC18F6490 PIC18F6520 PIC18F6525 PIC18F6527
PIC18F6585 PIC18F6620 PIC18F6621 PIC18F6622
PIC18F6627 PIC18F6628* PIC18F6680 PIC18F6720
PIC18F6722 PIC18F6723*
PIC18F8310 PIC18F8390 PIC18F8410 PIC18F8490
PIC18F8520 PIC18F8525 PIC18F8527 PIC18F8585
PIC18F8620 PIC18F8621 PIC18F8622 PIC18F8627
PIC18F8628*
PIC18F8680 PIC18F8720 PIC18F8722 PIC18F8723*


PIC18F_J_ Devices
-----------------
PIC18F24J10 PIC18F25J10 PIC18F44J10 PIC18F45J10
PIC18LF24J10 PIC18LF25J10 PIC18LF44J10 PIC18LF45J10
PIC18F63J11* PIC18F63J90* PIC18F64J11* PIC18F64J90*
PIC18F65J10 PIC18F65J11 PIC18F65J15 PIC18F65J50*
PIC18F65J90
PIC18F66J10 PIC18F66J11 PIC18F66J15 PIC18F66J16
PIC18F66J50* PIC18F66J55* PIC18F66J60 PIC18F66J65
PIC18F67J10 PIC18F67J11 PIC18F67J50* PIC18F67J60
PIC18F83J11 PIC18F83J90 PIC18F84J11 PIC18F84J90
PIC18F85J10 PIC18F85J11 PIC18F85J15 PIC18F85J50*
PIC18F85J90
PIC18F86J10 PIC18F86J11 PIC18F86J15 PIC18F86J16
PIC18F86J50* PIC18F86J55* PIC18F86J60 PIC18F86J65
PIC18F87J10 PIC18F87J11 PIC18F87J50* PIC18F87J60
PIC18F96J60 PIC18F96J65 PIC18F97J60


PIC18F_K_ Devices
-----------------
PIC18F25K20 PIC18F45K20


PIC24 Devices
-------------
PIC24FJ16GA002 PIC24FJ16GA004
PIC24FJ32GA002 PIC24FJ32GA004
PIC24FJ48GA002 PIC24FJ48GA004
PIC24FJ64GA002 PIC24FJ64GA004
PIC24FJ64GA006 PIC24FJ64GA008 PIC24FJ64GA010
PIC24FJ96GA006 PIC24FJ96GA008 PIC24FJ96GA010
PIC24FJ128GA006 PIC24FJ128GA008 PIC24FJ128GA010

PIC24HJ12GP201* PIC24HJ12GP202*
PIC24HJ64GP206 PIC24HJ64GP210 PIC24HJ64GP506
PIC24HJ64GP510
PIC24HJ128GP206 PIC24HJ128GP210 PIC24HJ128GP306
PIC24HJ128GP310 PIC24HJ128GP506 PIC24HJ128GP510
PIC24HJ256GP206 PIC24HJ256GP210 PIC24HJ256GP610


dsPIC33 Devices
---------------
dsPIC33FJ12GP201* dsPIC33FJ12GP202*
dsPIC33FJ64GP206 dsPIC33FJ64GP306 dsPIC33FJ64GP310
dsPIC33FJ64GP706 dsPIC33FJ64GP708 dsPIC33FJ64GP710
dsPIC33FJ128GP206 dsPIC33FJ128GP306 dsPIC33FJ128GP310
dsPIC33FJ128GP706 dsPIC33FJ128GP708 dsPIC33FJ128GP710
dsPIC33FJ256GP506 dsPIC33FJ256GP510 dsPIC33FJ256GP710

dsPIC33FJ12MC201* dsPIC33FJ12MC202*
dsPIC33FJ64MC506 dsPIC33FJ64MC508 dsPIC33FJ64MC510
dsPIC33FJ64MC706 dsPIC33FJ64MC710
dsPIC33FJ128MC506 dsPIC33FJ128MC510 dsPIC33FJ128MC706
dsPIC33FJ128MC708 dsPIC33FJ128MC710
dsPIC33FJ256MC510 dsPIC33FJ256MC710


dsPIC30 Devices
---------------
dsPIC30F2010 dsPIC30F2011 dsPIC30F2012
dsPIC30F3010 dsPIC30F3011 dsPIC30F3012
dsPIC30F3013 dsPIC30F3014
dsPIC30F4011 dsPIC30F4012 dsPIC30F4013
dsPIC30F5011 dsPIC30F5013 dsPIC30F5015
dsPIC30F5016
dsPIC30F6010A dsPIC30F6011A dsPIC30F6012A
dsPIC30F6013A dsPIC30F6014A dsPIC30F6015


dsPIC30 SMPS Devices
--------------------
dsPIC30F1010
dsPIC30F2020 dsPIC30F2023


KEELOQ HCS Devices
------------------
HCS200* HCS201* HCS300* HCS301* HCS320*
HCS360* HCS361* HCS362*

See Release Notes V2.40.00 for more information.

Serial EEPROM Devices
---------------------
NOTE: Other supported voltage grades are listed in paratheses
next to the device. Select the "LC" part number to program
these other voltage grades.

24LC00 (AA)(C)* 25LC010A (AA)*
24LC01B (AA)* 25LC020A (AA)*
24LC02B (AA)* 25LC040A (AA)*
24LC04B (AA)* 25LC080A (AA)*
24LC08B (AA)* 25LC080B (AA)*
24LC16B (AA)* 25LC160A (AA)*
24LC32A (AA)* 25LC160B (AA)*
24LC64 (AA)(FC)* 25LC320A (AA)*
24LC128 (AA)(FC)*
24LC256 (AA)(FC)* 25LC256 (AA)*
24LC512 (AA)(FC)*
24LC1025 (AA)(FC)* 25LC1024 (AA)*


93LC46A/B/C (AA)(C)*
93LC56A/B/C (AA)(C)*
93LC66A/B/C (AA)(C)*
93LC76A/B/C (AA)(C)*
93LC86A/B/C (AA)(C)*

here another one I could not follow Mach-X does this means MAC OS support?
CCS, Inc. - CCS C Compiler Device Support

Thankyou
 
hope senthi has gone longway in his project by now... i too faced same problem while programmming pic24fj16ga004.... thoug my task was simple tx rx of 2 simple bytes thre was severe problem due to non availability of language tool C30 as the older pic works with c18... the linker and header pic24fj16ga004.h pic24fj16ga004.lkd were not available.. nw i got c30 and project fine too
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…