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.

Program works fine in debug mode, but not in release mode - Where do I start?

Status
Not open for further replies.

cyrusthevirus

Newbie level 4
Joined
Jul 5, 2009
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,317
I created a very simple program and it works fine in debug mode, the LED never turns on in release mode. I am sure it is something simple, but I can not find it.

I am using a PIC24F, PICKIT3 and MPLAB.

Thanks for eveyone's help.

Code:
//***************************************************/
// Include Header File
//***************************************************/

#include "p24FJ128GA110.h"

//***************************************************/

int main (void)
{
	//ANi as digital I/O
	AD1PCFGH = 0xFFFF;
	AD1PCFGL = 0xFFFF;

	TRISB=0b00000000;;
	while(1)  //run clock
		{
			LATBbits.LATB6 = 1;
		}
}	

//end of code
 

john blue

Advanced Member level 3
Joined
Jun 7, 2007
Messages
821
Helped
213
Reputation
430
Reaction score
204
Trophy points
1,323
Activity points
4,749
Are you using ICSP? That is your programmer connected to your application or development board. If it has, you need to go to Programmer -> Release from reset.
 

cyrusthevirus

Newbie level 4
Joined
Jul 5, 2009
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,317
Are you using ICSP? That is your programmer connected to your application or development board. If it has, you need to go to Programmer -> Release from reset.

Yes it is connected, but wouldn't a powering down and up of the chip do the same thing?
 

john blue

Advanced Member level 3
Joined
Jun 7, 2007
Messages
821
Helped
213
Reputation
430
Reaction score
204
Trophy points
1,323
Activity points
4,749
Nope. It's different. :) Does it work? As I have experience that the release from reset is set in MPLAB and my program in the PIC cannot start running. After the release from reset is cleared, then it works fine,
 

cyrusthevirus

Newbie level 4
Joined
Jul 5, 2009
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,317
I got it. It ended up to be very simple. I did not add a 10K reistor between MCLR and VDD. Thanks for everyone's help in troubleshooting this.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top