I am using the MikroC compiler from Mikroelektronika and MikroProg ICD which allows me to download the program and debug it.
I was wondering if anyone had this weird problem.
I am able to do a debug build type and download and debug the program BUT when I do a release build type and download the program the controller does nothing ????
Not used that IDE and compiler but one of the common reasons why this sort of thing occurs with other environments is because you are setting the DEBUG config parameter yourself instead of letting the IDE do it for you.
Another cause is the ICD not releasing the \MCLR\ line. Try disconnecting the ICD and powering up the chip and see if it starts.
Susan
I just tried to disconnect the MCLR wire from the programmer after I downloaded the program with a release build type and nothing. The led that's supposed to blink stays lit??
Even if I disconnect the programmer's cable completely and power down and power back up there's nothing that happens!
The Debug configuration parameter should be set accordingly by the IDE.
void main(){
JTAGEN_bit =0;// Disable JTAG
AD1PCFG =0xFFFFFFFF;// Configure AN pins as digital I/O
TRISA =0;// Initialize PORTA as output
TRISB =0;// Initialize PORTB as output
TRISC =0;// Initialize PORTC as output
TRISD =0;// Initialize PORTD as output
TRISF =0;// Initialize PORTE as output
TRISG =0;// Initialize PORTG as output
LATA =0;// Set PORTA to zero
LATB =0;// Set PORTB to zero
LATC =0;// Set PORTC to zero
LATD =0;// Set PORTD to zero
LATF =0;// Set PORTE to zero
LATG =0;// Set PORTG to zerowhile(1){
LATA = ~PORTA;// Invert PORTA value
LATB = ~PORTB;// Invert PORTB value
LATC = ~PORTC;// Invert PORTC value
LATD = ~PORTD;// Invert PORTD value
LATF = ~PORTF;// Invert PORTE value
LATG = ~PORTG;// Invert PORTG value
Delay_ms(1000);}}
But no luck ...I have a LED connected on pin 21 and it always stays on :-(
Thanks for your help.... It's really appreciated !
Try both projects which are attached. Modified has code changes. PORTx is replaced by LATx and in unmodified project there are no changes but I compiled using my Compiler and the .hex file generated by your Compiler and mine differs.