Page 1 of 1

PIC18F47J53 ICD (Flowkit ) Not working

Posted: Sat Nov 11, 2017 7:14 pm
by QMESAR
Hi Team.

I am trying to debug a Flowchart with Flowkit 2 on a PIC18F47J53 and as you will see the ICD doies not functioan at all
the general popup comes up and say there is no code for ICD as you will also see <I compile to chip with ICD switched ON and program the chip with this switched ON ICD and then I do a reset before I run the ICD as you will also see there are a number of errors/warnings reported during compilation.

Please can you help out here I am in the middle of a proto-type design.
Note the code runs fine when I only compile to chip all is great and the mcu is running well another confusion I have with FC during simulation the running cursor will never enter the macro's (using low speed debugging and also placing a break point in the macro the break point is never reached so I want to ask this should the macro's be executed in simulation.This is not pc related as I am using it on a WIN7 and a WIN 10 machine both shows the same result

Is the macro supposed to be simulated or NOT ? the logic analyser print shows that in real time the macro is executed correctly but during Simulation nothing.

Re: PIC18F47J53 ICD (Flowkit ) Not working

Posted: Sun Nov 12, 2017 10:58 am
by QMESAR
Hi Team.

The same issue exists for the PIC16F1508.

Re: PIC18F47J53 ICD (Flowkit ) Not working

Posted: Mon Nov 13, 2017 10:28 am
by LeighM
Hi QMESAR,

Which particular macro are you having problems with the breakpoint in simulation?

The compiler warnings look OK, and I don't think these will be any cause of the ICD failure.
The references to _MARKER etc confirms it's an ICD build.

Could you try disabling the TMR1 interrupt and see if the ICD then runs correctly?

Re: PIC18F47J53 ICD (Flowkit ) Not working

Posted: Mon Nov 13, 2017 11:34 am
by QMESAR
Hi Leigh.

The break point in macro and simulation I experience or more than 1 micro ,had this issue on PIC32,PIC18F2585,I am having it on the P18F47J53 and the PIC16F1508 so I am not sure what is happening.

I will try to disable the TMR1 interrupt however this is my issue with Flowkit and FC ICD in general you always have to do some special trick to get it working where when I use MPLAB and the ICD3/PICKIT3 I just write code press debug in the the IDE and it runs with no issues or special trick and this apply to mikroC and mikroProg as well it always work even when I place a break point in another c file the debugger will jump to the break point .
I appologize if I sound rude however this is the truth every single time I want to debug an application it is always an uphill and getting support from you before the ICD works .a few time I just left FC and went head with MPLAB then I try again FC same issue ,I will just keep on with MPLAB on this project again ,I might be a bad programmer however I can not do and test an application with out using debugging, I trust and relay on debugging to see that my code is doing exactly what i think it should do and a tool with out it has no value for me .

Then again on PIC32 the ICD is far from working correctly but I will leave that there for now but will try your solution when i have time and report back

Have good time and my apologies for spitting this out :oops:

Re: PIC18F47J53 ICD (Flowkit ) Not working

Posted: Mon Nov 13, 2017 11:48 am
by Benj
Hi Peter,

Sorry for any frustration, we know debugging isn't as nice as it maybe could be, especially for larger more complex programs.

We feel that Flowcode allows us to do some very clever and powerful things that set us apart from the competition but we are never going to be at the same technical level as Microchip simply because we aren't actually creating the silicon devices and hence having that intimate knowledge of the inner workings.

What's good to remember is that Microchip are a massive billion dollar organisation with tens to hundreds of engineers working on a single feature such as ICD. We in comparison are a very small organisation with a very small team working on a fairly large selection of features.

Saying this we do feel that Flowcode 7.2 should be a lot better in terms of Ghost (ICD/ICT) support. It certainly should be working with the 18F device. Might be worth performing a 1 second flash test to confirm the chip is running at the speed you think it is.

I've just seen you are using the INTOSC, there is a problem here in that the chip is running very slow as it hits that first C icon which is enough to break ICD comms. To allow this to work move the code from the C icon into the <main> <start code=''> section of the FCD. This way the chip is up to speed when you hit the first Flowchart icon. I've made a new custom FCD with the change for you here.
18F47J53ICD.fcdx
(53.81 KiB) Downloaded 240 times

Re: PIC18F47J53 ICD (Flowkit ) Not working

Posted: Mon Nov 13, 2017 1:05 pm
by QMESAR
1 second flash test to confirm the chip is running at the speed you think it is.
Ben I hear what you say and I agree and that is all ok ,however the 1 second flasher insults me :D as the very first thing I do is varify my timing with the scope and in my RC chart the scope and the interrupt timing is running exact times .

The issue here is that the ICD does not even connect to the chip so it hard for me to understand why the C code will through the ICD out ,the senario is after programming the chip with the ICD build and go for reset the ICd does not connect

I will try the new file when I have time later tonight or tomorrow again I am sure my chip is running at the correct speed that has been check and varified by scope and timer interrupt time
Thank a million for the modified file

Re: PIC18F47J53 ICD (Flowkit ) Not working

Posted: Mon Nov 13, 2017 1:15 pm
by Benj
Hi Peter,
however the 1 second flasher insults me :D as the very first thing I do is varify my timing with the scope and in my RC chart the scope and the interrupt timing is running exact times
Sorry not meant as an insult, I often find it's the simple things that get overlooked. I know this has bitten me more than once :? Also others may look at this thread in the future so it's not 100% targetted at you.

We've come across the INTOSC + ICD problem before in v5, here we fixed it by adding a custom override to one of the components which was a bit easier to do but a bit more hidden and less intuitive. I wanted to do something similar with the INTOSC helper but I think it requires API changes to allow the code to be inserted behind the scenes without calling a component macro or C icon.

Let us know how you get on.

Re: PIC18F47J53 ICD (Flowkit ) Not working

Posted: Mon Nov 13, 2017 1:24 pm
by QMESAR
:D :D

There is no problem at all Ben ,
OK I understand what you say so now a dum question should I only place the new fcdx file in the PIC folder and FC will automatically use this file ? or should I remove the original 18F47j53.fcdx ?

Thank a million again

Re: PIC18F47J53 ICD (Flowkit ) Not working

Posted: Mon Nov 13, 2017 1:29 pm
by Benj
Hi Peter,

Not a dumb question, sorry I should have given better instructions on what to do.

Place the new FCD file into the "Flowcode 7/FCD/PIC" folder and in your project options change the target device to the new 18F47J53ICD device. You will also have to re-specify your configuration settings, sorry about this.

To confirm the change has worked simply look at the generated C code, specifically the top of the main function.

Code: Select all

void main()
{
OSCCON=0x78;
ANCON0 = 0xFF;
ANCON1 = 0x1F;
You can then remove the OSCCON C code icon from the start of your project and fingers crossed ICD will now work as expected.

Re: PIC18F47J53 ICD (Flowkit ) Not working

Posted: Mon Nov 13, 2017 2:27 pm
by QMESAR
Hi Ben.

Sorry however here is a bit of confusion, I try to explain again

(1) the PIC1847J53 does not use INTOSC it uses Extrenal HS+PLL as you will see in the oploaded FC project
(2) the PIC16F1508 is running on INTOSC

I guess it does not help much to run or try your modified 18F47J53fcdx file what i did now I tried to run the PIC16F1508 with external OSC however I am still not able to connect or Run the ICD on either the PIC18 or the PIC16 and both are running now on External OSC

Any case that you very much for trying to solve this issue -

Re: PIC18F47J53 ICD (Flowkit ) Not working

Posted: Fri Dec 29, 2017 8:00 pm
by QMESAR
Benj wrote: We've come across the INTOSC + ICD problem before in v5, here we fixed it by adding a custom override to one of the components which was a bit easier to do but a bit more hidden and less intuitive. I wanted to do something similar with the INTOSC helper but I think it requires API changes to allow the code to be inserted behind the scenes without calling a component macro or C icon.
Hi Ben ,
I had a bit of time now with the holidays and got back to this problem of the PIC16F1508 not working with the ICD.
However I modified the board and added a Chrystal and then I have no problems to connect to Ghost and debug.
It is when I use Internal Oscillator that the ICD would not work .

Just to let you know
have good one

Re: PIC18F47J53 ICD (Flowkit ) Not working

Posted: Wed Oct 30, 2019 9:27 am
by medelec35
Hi Ben,
Benj wrote:We've come across the INTOSC + ICD problem before in v5, here we fixed it by adding a custom override to one of the components which was a bit easier to do but a bit more hidden and less intuitive. I wanted to do something similar with the INTOSC helper but I think it requires API changes to allow the code to be inserted behind the scenes without calling a component macro or C icon.
Will this sill been implemented in V8 or later?
If API change will not work, what about a checkbox with an option to add the OSCCON value, then add the code like the fix here?