MikroProg debugger configuration issue trying to debug simple LED program for PIC18F4520

General discussion on mikroProg™ programmer and debugger and mikroProg Suite software as well.
Post Reply
Author
Message
uzairp100
Posts: 47
Joined: 12 Jan 2021 00:27

MikroProg debugger configuration issue trying to debug simple LED program for PIC18F4520

#1 Post by uzairp100 » 04 Feb 2021 19:39

Hi, I am trying to debug a simple LED program using MikroC with MicroProg debugger. I have connected 4 Mz crystal on pin#13 and 14. Can someone please help me if I need to change any default values on the programmer suit that writes to MCU based on the program I wrote to debug? it is set to 'checked' for 'Power target MCU 5v from programmer' and 'Oscillator to "HS"', everything else is default values.
Below is the program code;

void main() {
ADCON1 |= 0X0F; // ADC pins set as digital
TRISB.RB0 = 1; // RB0 as Input
PORTB.RB0 = 1;

TRISD = 0; // PORTD pins set as Output
PORTD = 0; // PORTD pins set LOW

while(1)
{
PORTD.RD0 = 1; // LED on
Delay_ms(400); // delay 400 ms
PORTD.RD0 = 0; // LED off
Delay_ms(400); // delay 400 ms
}
}
Can someone please help so I can debug this program line-by-line with MikroProg?

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: MikroProg debugger configuration issue trying to debug simple LED program for PIC18F4520

#2 Post by filip » 05 Feb 2021 09:35

Hi,

Can you program the board ?
What happens if you try debug, do you get any errors ?
Can you attach the connection schematics ?

Regards,
Filip.

uzairp100
Posts: 47
Joined: 12 Jan 2021 00:27

Re: MikroProg debugger configuration issue trying to debug simple LED program for PIC18F4520

#3 Post by uzairp100 » 06 Feb 2021 01:49

Yes, the programming goes through showing programming progress but clicking 'Run debugger' was not doing anything, 'Step into' and other options were greyed out, regardless of what I did.
I found that my 4 Mhz crystal was not connected to MCU properly so I fixed it and now everything is working. Thank you.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: MikroProg debugger configuration issue trying to debug simple LED program for PIC18F4520

#4 Post by filip » 10 Feb 2021 08:40

Hi,

I'm glad that the issue is solved.

Regards,
Filip.

Post Reply

Return to “mikroProg™ programmer and debugger”