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.

Debug/release build types for Pic32MX795

Status
Not open for further replies.

600V3Phase

Junior Member level 3
Joined
Mar 24, 2010
Messages
26
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,578
Hello,

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 ????

Would anyone have any idea why this happens?

Thanks in advance !
 

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
 

Hi Susan,

Thanks for replying that's very nice of you!

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.

Sowww ? That's that ....dunno what else to do!

Discouraged !

Thanks for your help
 

Try this.

Code:
void main() {
JTAGEN_bit = 0;
AD1PCFG = 0xFFFFFFFF;

}
 

Hi Okada,

Well what I have been trying all along is:


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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 zero
 
  while(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 !
 
Last edited by a moderator:

It should be

Code:
LATA = ~LATA

In general LATx = ~LATx

Zip and post your mikroC PRO PIC32 project. Complete project. I will test it on my EasyPIC Fusion v7 board.
 

Here you go...

Thank you for taking the time to help me!

r
 

Attachments

  • _MKE_LED_BLINKING.zip
    298.5 KB · Views: 45

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.
 

Attachments

  • modified project.rar
    253.3 KB · Views: 44
  • unmodified project.rar
    253.7 KB · Views: 42

Hi Okada,
I figured out that my external oscillator circuit crystal/resistor/caps was too fat from the uC.

I brought ten as close as possible to the uC and now it works ?

Thanks for all your help it's really appreciated !
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top