Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to configure Configuration bits for PIC16f1527 IC?

Status
Not open for further replies.

ragav4456

Full Member level 4
Joined
Aug 1, 2012
Messages
228
Helped
19
Reputation
38
Reaction score
17
Trophy points
1,308
Activity points
2,568
Problem in configuration bit



Code:
#include<pic.h>
#include<htc.h>

//__CONFIG(HS & PWRTEN & BOREN & LVPEN & WDTDIS & DUNPROT & DEBUGDIS); 

__CONFIG1(FOSC_HS & PWRTE_ON & BOREN_OFF & WDT_OFF & MCLRE_ON & CP_OFF & CLOCKOUT_ON & IESO_OFF & FCMEN_OFF);
__CONFIG2(WRT_OFF & VCAPEN_OFF & LVP_OFF & LPBOR_OFF & BORV_OFF & STVR_ON);

//unsigned int value1,value2;
void main()
{
	ADCON1=0X06;                                                                                                                                      ;
	TRISA = 0xFF;		/* Configure RA<0...7> as input */
	TRISB = 0xFF;		/* Configure RB<0...7> as input */
	TRISD = 0x00;		/* Configure RD<0...7> as output */
	TRISC = 0x80;		/* Configure RC0, RC1, RC3, RC4, RC5 and Tx(RC6) as output */
	TRISE = 0x00;
	TRISF = 0x00;
	TRISG = 0x00;
	
	CCP1CON=0X0C;
	T2CON=0X04;
	//CCPR2L=0x3F;
	PR2=24;
	CCPTMRS0=0x00;
	CCPTMRS1=0x00;
	CCPTMRS2=0x00;

	PORTA=0x00;
	PORTC=0x00;
	PORTB=0x00;
	PORTD=0x00;
	PORTE=0x00;
	PORTF=0x00;
	PORTG=0x00;
	while(1)
	{
		ADCON0=0X80;
		//delay();
		ADGO=1;
		//while(ADGO);
		//value1=ADRESH*255+ADRESL;
		//value1=value1/4;
		//T2CON=0X04;
		CCP1CON=0b00011100;
		CCPR1L=0b00000001;// 5%duty cycle 100khz
	} 	
}

delay()
{                                                                                                                                                                                                                                                                                                 
	unsigned int i;
	for(i=0;i<200;i++);
}


Executing: "C:\Program Files\HI-TECH Software\PICC\9.80\bin\picc.exe" --pass1 "D:\Testing\PWM Light ctrl\PIC16f1527\Testing\Basic\1\pwm.c" -q --chip=16F1527 -P --runtime=default --opt=default -D__DEBUG=1 --rom=default --ram=default -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Error [194] D:\Testing\PWM Light ctrl\PIC16f1527\Testing\Basic\1\pwm.c; 6.11 ")" expected
Error [194] D:\Testing\PWM Light ctrl\PIC16f1527\Testing\Basic\1\pwm.c; 7.11 ")" expected

********** Build failed! **********
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top