Pics not running in release mode

Thread Starter

spinnaker

Joined Oct 29, 2009
7,815
I created this simple program:

Rich (BB code):
#include <P18F26J53.h>

#pragma config WDTEN = OFF
#pragma config XINST = OFF
#pragma config CFGPLLEN = OFF
#pragma config OSC = INTOSCO
#pragma config FCMEN = OFF



void main()
{

    TRISBbits.TRISB3 = 0;
    LATBbits.LATB3 = 0;

    while(1) LATBbits.LATB3 =~ LATBbits.LATB3;

}
It does noting more than toggle LATB3. It works fine in debug mode but when I compile for release and program the chip the code does now run.

Any idea why?

I have a 18F26J53 and a 18F27J53 and both do the same thing.
 

be80be

Joined Jul 5, 2008
1,927
You need to set the osccon setting or the chip will just set there till the oscillator starts
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,815
You need to set the osccon setting or the chip will just set there till the oscillator starts

Which ones? Clock Freq? Default is 4MHZ.

How does this explain why it works in debug but not release?
 
Top