Help! mikroProg for PIC, dsPIC and PIC32

General discussion on mikroProg™ programmer and debugger and mikroProg Suite software as well.
Post Reply
Author
Message
Sy
Posts: 708
Joined: 10 Dec 2009 13:41
Location: UK

Help! mikroProg for PIC, dsPIC and PIC32

#1 Post by Sy » 23 Dec 2012 21:17

Just received my mikroProg programmer, I am able to program my target device, but when I try to start the debugger, it displays an error dialog containing:

mikroICD:
- Error Starting Debugger
- PIC Clock Error.

Then another dialog containing:

mikroElektronika ICD
hardware not found

This is all after a successful download to the device, the project I'm trying to download is the stock LedBlnking project, I've changed the processor to match the PIC I have: P18F44K22, the MCU Clock is set to 32Mhz.

What's wrong?
Kind Regards,
Sy

Sy
Posts: 708
Joined: 10 Dec 2009 13:41
Location: UK

Re: Help! mikroProg for PIC, dsPIC and PIC32

#2 Post by Sy » 24 Dec 2012 13:02

I have pulled out a PIC16F887 and insert it into a prototyping breadboard, connected up the mikroProg as directed on page 21 of the mikroProg booklet for a PIC DIP40 PIC16F887. I've modified the LEDBlinking project as follows:

Code: Select all

void main() {

  TRISA = 0;           // set direction to be output

  do {
    PORTA = 0x00;       // Turn OFF LEDs on PORTA
    Delay_ms(1000);    // 1 second delay
    PORTA = 0xFF;       // Turn ON LEDs on PORTA
    Delay_ms(1000);    // 1 second delay
  } while(1);          // Endless loop
}
I've modified the Project Settings:

Device
Name: P16F887
Frequency: 20Mhz

Build/Debugger Type
Build Type: ICD Debug
Debugger: mikroICD

The project compiles without erorr and loads into the device without problem. I've programmed the device several times, but when I try to run and start debugging I get:

Debug error: PC out of scope. Please reprogram chip and restart debugger.

Connections:

PIN 1, RE3/MCLR/VPP to MCU-MCLR pin 7
PIN 32, VDD to MCU-VCC pin 1
PIN 40, RB7/ICSPDAT to MCU-PGD pin 5
PIN 39, RB6/ICSPCLK to MCU-PGC pin 3
PIN 31, VSS to GND pin 9

What is wrong?
Kind Regards,
Sy

Sy
Posts: 708
Joined: 10 Dec 2009 13:41
Location: UK

Re: Help! mikroProg for PIC, dsPIC and PIC32

#3 Post by Sy » 24 Dec 2012 15:10

Anyone?
Kind Regards,
Sy

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: Help! mikroProg for PIC, dsPIC and PIC32

#4 Post by janko.kaljevic » 24 Dec 2012 15:36

Hello,

Please make sure that at the moment when ICD starts, your controller is powered.
You can do this with external power supply or to power it with mikroProg.

I have tested your code and it worked fine on EasyPIC v7 board.
Please can you tell me at which point you get this error?
When you start debugger or when you do step over?

Best regards.

Sy
Posts: 708
Joined: 10 Dec 2009 13:41
Location: UK

Re: Help! mikroProg for PIC, dsPIC and PIC32

#5 Post by Sy » 24 Dec 2012 18:40

Hi Janko,

I tried powering the controller from the mikroProg programmer, checking the box and selecting 3.0v using the slider.

I get the errors as soon as I try to start debugging the application.
Kind Regards,
Sy

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: Help! mikroProg for PIC, dsPIC and PIC32

#6 Post by janko.kaljevic » 25 Dec 2012 12:09

Hello,

Please try to set slider to 5V, and make sure that there is clock on the PIC.
The best would be to set up internal oscillator at first.

Best regards.

Sy
Posts: 708
Joined: 10 Dec 2009 13:41
Location: UK

Re: Help! mikroProg for PIC, dsPIC and PIC32

#7 Post by Sy » 25 Dec 2012 13:39

With the slider set to 5V I get:

Vpp voltage error!
(6.84 volts)
Kind Regards,
Sy

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: Help! mikroProg for PIC, dsPIC and PIC32

#8 Post by janko.kaljevic » 25 Dec 2012 15:02

Hello,

Please can you post here how you connected your mikroprog to the controller.
Also does this error message occurs during programming, or only when you try to start ICD?

Best regards.

Sy
Posts: 708
Joined: 10 Dec 2009 13:41
Location: UK

Re: Help! mikroProg for PIC, dsPIC and PIC32

#9 Post by Sy » 25 Dec 2012 15:26

The message comes up when I try to start the debugger.

I have a 40 pn PIC16F887 plugged directly into a bread board, with:

Pin 1 of the PIC connected to Pin 7 of the mikroProg
Pin 32 of the PIC connected to Pin 1 of the mikroProg
Pin 31 of the PIC connected to Pin 9 of the mikroProg
Pin 39 of the PIC connected to Pin 3 of the mikroProg
Pin 40 of the PIC connected to Pin 5 of the mikroProg

No other components. I'm no electronics wiz, I apologize if this turns out to be an error on my part, can you suggest a better set-up, I intended to add LED's and resistors for testing.

I also have a 44-Pin Demo Board for a PICKit 2, which from the datasheet I think I could probably use with the mikroProg, it also has a PIC16F887.

If I want to try the PICKit2 Demo board with the mikroProg, am I correct in the following:

PICKIT2 Demo Board Header:

Pin 2 connect to VCC (pin 1 on mikroProg)
Pin 5 connect to PGC (pin 3 on mikroProg)
Pin 4 connect to PGD (pin 5 on mikroProg)
Pin 1 connect to MCLR (pin 7 on mikroProg)
Pin 3 connect to GND (pin 9 on mikroProg)
Kind Regards,
Sy

Sy
Posts: 708
Joined: 10 Dec 2009 13:41
Location: UK

Re: Help! mikroProg for PIC, dsPIC and PIC32

#10 Post by Sy » 26 Dec 2012 11:19

Using the PICKit2 Demo Board I have connected and programmed using the mikroProg as shown in previous post.

The code I've downloaded is:

Code: Select all

void main() {

  TRISD = 0;           // set direction to be output
  PORTD = 0xFF;       // Turn ON LEDs on PORTA

  do {
    PORTD = 0x00;       // Turn OFF LEDs on PORTA
    Delay_ms(1000);    // 1 second delay
    PORTD = 0xFF;       // Turn ON LEDs on PORTA
    Delay_ms(1000);    // 1 second delay
  } while(1);          // Endless loop
}
However I cannot see any LED on portD comming on, I've checked the voltage on the port and there is nothing, what is wrong?

The mikroProg Suite seems a bit flaky, in that when I build and program I often get error dialogs popup. Such as:

Error in call to Device driver
The handle is invalid.

or

Error trying to send data to programmer!

Also, it often clears the "Power board from programmer" check box.

Whilst the mikroProg Suite for PIC is up (v2.26) if I check the box then Read Voltage all is ok, then click the Write button, it downloads the project with no errors, then clears the check box again...I then check the box again, and Start Debugger, the execution stops at the first line of the code:

Code: Select all

TRISD = 0;
As expected, but when I single step (F8) twice, to run over the next two lines, the LED does not come on.

Help!

edit...After reading the data sheet on the PICKit2 Demo board I changed the LED to PORTD and I can see it blinking on and off now, still get lots of error dialogs tho and the Power checkbox keeps reseting.
Kind Regards,
Sy

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: Help! mikroProg for PIC, dsPIC and PIC32

#11 Post by janko.kaljevic » 27 Dec 2012 15:24

Hello,

Please can you tell me how do you connected mikroprog to computer?
In this case I really believe that the problem comes from USB port on your computer.

If you are using more devices on the same USB port as mikroprog, it is possible that mikroProg does not get enough power for operation, and thus these various error messages.
Also if this is laptop check if the power saving on USB ports is disabled.

And the best would be to try it on another computer and on various USB ports on your computer.

Best regards.

Sy
Posts: 708
Joined: 10 Dec 2009 13:41
Location: UK

Re: Help! mikroProg for PIC, dsPIC and PIC32

#12 Post by Sy » 27 Dec 2012 21:24

Hi, the mikroProg is connected to one of the USB ports on my computer, apart from this I also have a USB mouse and a USB serial port adapter. The PC has a high power PSU. The error messages sometimes come up, it's very intermittent, at the moment it seems to be working fine.
Kind Regards,
Sy

Post Reply

Return to “mikroProg™ programmer and debugger”