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.

[SOLVED] How disable or enable MCLR pin inside a function ?

Status
Not open for further replies.

Raady Here

Full Member level 5
Full Member level 5
Joined
Jun 8, 2013
Messages
242
Helped
26
Reputation
52
Reaction score
26
Trophy points
28
Location
India
Visit site
Activity points
1,571
MPLAB8.8V/PIC30F5011

Hi,

Normally MCLR pin enable/ disable is done when it is programmed, but I have a requirement to enable/disable at certain points of code execution.

What is the way to do it ?



Code:
void Switch_ON_Motor(void)
{

       _FBORPOR(MCLR_DIS);                  // Disable reset pin

	Latch_1 	= 	Enable;				// Enable Latch
	Relay_1		=	High;                         // R Phase
	Relay_2		=	High;                         // Y Phase
	Relay_3		=	High;                         // B Phase
	TimerDelay_10ms(1);
	Latch_1 	= 	Disable;				// Disable Latch
//	printf("\n\rSwitch ON Motor");	
}
My Error Log :
Code:
main.c: In function 'Switch_OFF_Motor':
main.c:298: error: section attribute cannot be specified for local variables
main.c:298: warning: ignoring space attribute applied to automatic _FBORPOR
main.c:298: warning: unused variable '_FBORPOR'
main.c: In function 'Switch_ON_Motor':
main.c:610: error: section attribute cannot be specified for local variables
main.c:610: warning: ignoring space attribute applied to automatic _FBORPOR
main.c:610: warning: unused variable '_FBORPOR'

Regards,
Raady.
 

You didn't understand the meaning of attributes like _FBORPOR(). They translate to hardware fuses that are set during device programming.
 

Ok, I get it FVM,

Then is it there any other possible way so that no one can disturb my running motor by reset as it get disabled ?
 

Quite simple, if you don't want MCLR function temporarily, you must disable it permanently.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top