Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Program works fine in debug mode, but not in program mode - Where so I start?

Status
Not open for further replies.

cyrusthevirus

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

So I created a very simple program that just turns on a LED. It works fine in debug mode, but does not work in release mode. I verified the code and stillno luck. I am using a PIC24 on MPLAB.

Any thoughts?

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
 
Last edited:
Anyone have any suggestions or a different forum to post on?

I expect the problem is not in your code but in the c0 code that calls your main. It does needed setup. In C18 the file is named C018 so it may be called C024. But microchip is not very consistent.

It may be the you are linking in a version that passes control to the debugger.

But I have not use the 24F toolchain.
 
Where the compiler library source files are stored.

I expect you know most of this but have have to check.

Are you using program rather then debug from the main menu to program the PIC? (expect yes)

I wonder if it is executing code?
Does it run when programmed (non debug) and still connected to the ICSP.
Does it run when programmed and removed from the ICSP.
If disconnected does it have power to the PIC?

Do you have the MCLR line tied high with a resistor ?
 
Last edited:
Where the compiler library source files are stored.

I expect you know most of this but have have to check.

Are you using program rather then debug from the main menu to program the PIC? (expect yes)
Yes.
I wonder if it is executing code?
Does it run when programmed (non debug) and still connected to the ICSP.
No
Does it run when programmed and removed from the ICSP.
No
If disconnected does it have power to the PIC?
Yes

Do you have the MCLR line tied high with a resistor ?
No. Should I? If so, what size?
 
In the datasheet see FIGURE 2-1: RECOMMENDED MINIMUM CONNECTIONS
etoHelp.jpg
 
Hi all,

I have a really similar problem where an LED will light in debug mode but wont light in release mode. I have the MCLR line tied high. No capacitors on the board but the PICkit 3 diagram seems to say dont put a capacitors between Vdd and Vss. Nor does it want a cap on the PGC/PGD lines according to the info poster. I can't take it off the PICkit because that's powering it. Any help would be greatly appreciated!
 
Last edited:
Aha! Got it lol, for reference to anyone else googling this problem (as I did to find this page): setting the config in the configuration bits window of the PICkit 3 will be fine in the debug mode but hard coding it into the source file is necessary to make it run in release mode :)
 
Status
Not open for further replies.

Latest threads

Back
Top