Using the FlowKit ICD Tool

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.

Moderators: Benj, Mods

Please rate this article out of 5: (1 being the worst and 5 being the best)

1
0
No votes
2
0
No votes
3
0
No votes
4
1
20%
5
4
80%
 
Total votes: 5

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Using the FlowKit ICD Tool

Post by Benj »

The FlowKit In-Circuit Debugging (ICD) tool is a great new way of debugging your Flowcode v4 embedded programs. It also allows the monitoring / updating of variables in real time which means that communications from other systems such as RS232, CAN, Zigbee etc can be injected and tested without requiring the other communications node to be up and running. The FlowKit comes complete with an E-Blocks adapter and a USB out socket to allow you to connect up an E-Blocks set, or one of our USB reprogrammable devices. As well as these options there are also single pin connections available allowing you to connect just about any 3rd party or custom hardware. Basically if Flowcode v4 can target the hardware then the FlowKit ICD tool can debug it on a Flowchart icon level. As a side note the EB006 v7 can also perform ICD functionality as shown here but is limited to EB006 compatible PIC devices only.
HP299-71-1.jpg
HP299-71-1.jpg (15.45 KiB) Viewed 64828 times
EB006.JPG
EB006.JPG (16.27 KiB) Viewed 64829 times
Firstly we have to setup Flowcode to use the FlowKit device. This is done via the Project Options window, which is available from the View menu. The code to drive the FlowKit is enabled by ticking the ICD Mode option. On the right hand side of the window are some settings for the FlowKit that define some of the basic functionality.
proj.JPG
proj.JPG (20.1 KiB) Viewed 64828 times
Breakpoint count - defines the maximum number of breakpoints you wish to enable in your program. The more you have enabled the more memory the ICD driver code requires on your embedded target device.

Callstack depth - Defines the maximum number of jumps in your stack. This will be 8 by default but means that software stacks such as the one included with BoostC can still be used while debugging.

Communication speed - Defines the bus speed between your embedded device and the FlowKit. The number represents a delay so the smaller the number the faster the communications speed. This is automatically calculated based on your clock speed to provide an optimum communication speed.

Override ICD pins – Allows the ICD pins to be manually specified instead of taking the default values from the Flowcode definition file (FCD).


ICD Functionality

Once you have been into your program and changed the settings in the project options window it is time to program your device and get debugging. The debugger is started in the same way as you would start a normal Flowcode simulation (by clicking the simulation play button or one of the simulation step buttons inside Flowcode). You may note that the 'current icon' marker is now green instead of red when in simulation mode.
ss1.JPG
ss1.JPG (32.14 KiB) Viewed 64828 times
Variables can be added to the debugger in the same way as the simulation by right clicking the Variables window and selecting 'add variable'. Note that the variables window is only available when the ICD or the simulation is running or paused.

Breakpoints can be set or cleared by right clicking a flowchart icon and selecting toggle breakpoint. When a program has active breakpoints the debugger will pause on the specific icons that have their breakpoint enabled.
ss2.JPG
ss2.JPG (30.8 KiB) Viewed 64828 times
When the FlowKit is inactive the onboard LEDs remain at a constant brightness. When your target program is running the FlowKit pulses its LEDs rapidly and when the target program is paused the FlowKit pulses the LEDs slowly.
IMG_1821.jpg
IMG_1821.jpg (124.61 KiB) Viewed 64826 times
Note that if your Flowcode program changes at all then you will have to recompile the program to the device before you will be able to proceed with debugging.


FlowKit Hardware Configurations

Following are some examples of how the FlowKit would be used to interface with several different hardware setups.


HP488 development board
IMG_1812.jpg
IMG_1812.jpg (114.01 KiB) Viewed 64829 times
When using the E-Blocks adapter board as shown above the ICD pins are automatically routed to bits 6 and 7 of the port. The E-Blocks adapter board even allows for E-Blocks to be connected so you are not sacrificing an entire port for the ICD functionality. For the setup shown above I have to manually change the ICD pins to Port C pins 6 and 7. If pins 6 and 7 are not an option for you then you can instead wire single pin connections from the FlowKit to the E-Blocks adapter board remembering to connect the ground as well as the ICD clock and data pins.

Other hardware that can be used in this method:
EB019 AVR Board
EB006 v6 or earlier
ECIO Application Board
EB031 ARM Board (when Flowcode v4 ARM is available)


MIAC
IMG_1818.jpg
IMG_1818.jpg (106.33 KiB) Viewed 64829 times
When using the FlowKit with one of our USB Bootloader products it is possible to use the same USB cable for both re-programming and debugging. These USB products all have their default ICD pins set so that the USB connection is the default connection for ICD communications. Debugging the hardware is achieved by moving the switch on the FlowKit to the ICD position. Programming the hardware is achieved by moving the switch on the FlowKit to the Prog position.

Other hardware that can be used in this method:
ECIO PIC
ECIO ARM (when Flowcode v4 ARM is available)
Formula Flowcode
Locktronics PIC

Note: The ECIO devices will not work with the FlowKit unless they are using the EXT power method. This is because the USB connection is being used for ICD communications and therefore is unable to supply the power required to run the ECIO in USB power mode. Flowcode USB components will also fail to work when using the ICD through the USB OUT cable so single pin connections must be used instead.


3rd Party / Custom Hardware
IMG_1816.jpg
IMG_1816.jpg (95.87 KiB) Viewed 64827 times
Microchip development boards generally come with an ICSP header that is used with a PICkit programming tool to provide re-programming functionality. The ICSP header on these boards can also plug directly into the single pin connections on the FlowKit so that the board can be both powered and debugged at the same time via the one connection. For other third party hardware, wires can be connected from the socket on the FlowKit directly to the I/O pins of your choice. The ICD pins are labelled as ICDC and ICDD, which stand for clock and data respectively. You will also need to connect a third wire for ground if you are using the individual wire connections.


Troubleshooting

The most common causes of the FlowKit communications failure is due to one of the two following problems.

1) You are using the ICD pins in your program.

If you are sending data to the port that the ICD is connected to (as shown in picture ss3) then you must use the masking feature so that the ICD pins remain untouched (as shown in picture ss4). The same goes for inputs, component connections and C code etc.
ss3.JPG
ss3.JPG (8.77 KiB) Viewed 64827 times
ss4.JPG
ss4.JPG (9.08 KiB) Viewed 64827 times
2) The program on the target device is out of date.

If the star appears on the Flowcode title bar for any reason indicating that there are unsaved changes then you will have to save the file and recompile to the target device. Here is a list of common things that will cause Flowcode to require a re-save and therefore a re-compilation.

Changing Project Options,
Changing the contents of an icon properties page,
Clicking OK on a property page,
Moving / Modifying items on the panel,
Modifying the Flowchart.

More information on using the FlowKit can be found in the device datasheet available from here: http://www.matrixmultimedia.com/datashe ... 9-30-1.pdf

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: Using the FlowKit ICD Tool

Post by saschech@gmx.de »

Hello Benj

Is these the " stand alone " icd for V4?
Works the tool together with pickit3 ?
Regards wolfgang

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using the FlowKit ICD Tool

Post by Benj »

Hi Wolfgang

Yes this is the stand alone ICD tool for Flowcode 4 and it works fine with the PICkit 2 or 3.

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: Using the FlowKit ICD Tool

Post by saschech@gmx.de »

Hello Benj

I am very hot to these tool,but i have a lot of question.
You write : As a side note the EB006 v7 can also perform ICD functionality as shown here but is limited to EB006 compatible PIC devices only.

so i have a look for the 18F8722 ---- the list finish on 18F4681.What type of pic`s suppots the tool together with pickit3 ?

On the PDF i show connection typ3:

Is programmer the pickit3 ? ; must i change the plug between icd and programming mode ?

Regards Wolfgang
Attachments
Flow Kit connection.PNG
(49.68 KiB) Downloaded 27417 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using the FlowKit ICD Tool

Post by Benj »

Hello Wolfgang

The 18F8722 will not work with the EB006 as it is only available in a surface mount package and the chip is not supported by PPP.

However the FlowKit will work with any device that Flowcode can target.

Therefore you should be able to program using the PICkit 3 and ICD using the FlowKit though you will require two free I/O pins.

The diagram would look more like this.
PICkit.gif
PICkit.gif (2.96 KiB) Viewed 64702 times

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: Using the FlowKit ICD Tool

Post by saschech@gmx.de »

Hello Benj

I have not understand the the both connection because the target have only 1 connector?

Regards Wolfgang
Attachments
icd connector.PNG
(54.54 KiB) Downloaded 27363 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using the FlowKit ICD Tool

Post by Benj »

Hello Wolfgang.

In this case you will be able to either connect the FlowKit to any unused I/O on the board whilst keeping the PICkit connected.

If you are using all of your free I/O then you may still be able to use the ICSP pins RB6 and RB7 if these are unused by your application.

This would be done by unplugging the PICkit and then plugging in the FlowKit. In this setup you would have to swap between the devices to program or debug.

keshav@solus.in
Posts: 19
Joined: Tue Sep 07, 2010 7:03 am
Contact:

Using the FlowKit ICD Tool

Post by keshav@solus.in »

HI

I am using HP299-flowkit debugger and third party pic 18f8722 target board,

I have following query about HP299-flowkit debugger tool:

1) I am using MPLAB IDE ICD2 to download the program into target board,

2) after programming i connected HP299-flowkit debugger tool to target board,
a) flowkit debegger tool switch is in ICD mode,
b) from the target board mclr,+5v,gnd,pgc,pgd pin connected to the flowkit debugger,

3) In flowcode program project option selected ICD mode,

4) After this connection i click on step into button of the flowcode,

5) After this i am getting following error and also flowkit debugger led blinking regarding this issue i attached image file,

please kindly go through following query

please help me out how to solve this problem,

Thanks & regards

keshav
Attachments
flowkitdebuggerdownloading.JPG
(168.72 KiB) Downloaded 26475 times
flowkitdebugger.JPG
(171.65 KiB) Downloaded 26475 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using the FlowKit ICD Tool

Post by Benj »

Hello,

If you make any changes to Flowcode then it will assign a new number to check the program is up to date. If at any time a star appears in the Flowcode title bar then something has changed in the program resulting in a new number being generated. This could include going into a window such as project options and making no changes except clicking ok.

Therefore when you compile and program your device make sure that nothing happens to change the Flowcode program and then the numbers should match and the debugger should fire up correctly.

keshav@solus.in
Posts: 19
Joined: Tue Sep 07, 2010 7:03 am
Contact:

Re: Using the FlowKit ICD Tool

Post by keshav@solus.in »

Hello BENZ

Thank you for your reply,

i have following query

1) i downloaded the code into target board using MPLABICD2 after i removed MPLABICD2 connection from the target board and then connected flowkit debugger to target board, i did not changed anything in my flowcode program i click on STEP INTO button again i am getting same error,

2)Can you send me the exact procedure to debug the code using flowkit debugger,

please reply as soon possible

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using the FlowKit ICD Tool

Post by Benj »

Hello,

This troubleshooting guide should help to get you started.

http://www.matrixmultimedia.com/softwar ... _Guide.pdf

keshav@solus.in
Posts: 19
Joined: Tue Sep 07, 2010 7:03 am
Contact:

Re: Using the FlowKit ICD Tool

Post by keshav@solus.in »

Hello

Presently I am using MPLABICD2 and HP299-FLOWKIT debugger to download and debug the code from target board PIC 18F8722 microcontroller,


1) I activated ICD feature in project option window using tick mark,

2) After finishing settings in project option and device configuration bits,

3) Using compile option compile flow code program,

4) Using Microchip MPLABICD2 downloaded the code into the target board,

5) After finishing download program into the target board I disconnected MPLABICD2 connection from the target board,

6) Using Flow kit debugger ICD pins a)MCLR b)VDD c)GND 4)ICDD 5)ICDC Pins connected to the target board, please
clarify these connection?

7) ICD pins directly connected to target board PIC microcontroller it does not Connected to any other external hardware

8) After FLOWKIT debugger connection, I click start icon in flow code,

9) It does not connecting, continuously I am getting following message “The Program in the chip is out of date, please
recompile your flowchart and send it to The chip”

10) Whatever you given in the flow code ICD debugger guide PDF file, I am Following same procedure please suggest
me how to solve this problem,

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using the FlowKit ICD Tool

Post by Benj »

Hello,

Do you mind attaching your Flowcode program so I can have a quick look. Also have you tried running the program with the ICD turned off to ensure that the program does run as expected without the ICD enabled?

keshav@solus.in
Posts: 19
Joined: Tue Sep 07, 2010 7:03 am
Contact:

Re: Using the FlowKit ICD Tool

Post by keshav@solus.in »

Hello Benz

Thank you for your reply,

For your kind reference i attached flow code program,
Attachments
TESTING_MPLAB.fcf
(6 KiB) Downloaded 1263 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Using the FlowKit ICD Tool

Post by medelec35 »

Hello keshav@solus.in
I had a similar problem when using internal oscillator on 4MHz. This is what Ben posted:
Hello Medelec

Success I know why!!!!

Ok when the ICD is enabled the program will run until it gets to the first icon in your flowchart. It will then wait there until told to proceed.

Flowcode is expecting the clock speed to be 4MHz however when the chip first starts using the internal oscillator the clock speed is set to 31.25KHz.

It is only when the first flowchart block is called that the clock speed is switched to the 4MHz setting.

So to work around this problem is fairly simple. You can do this using a custom component or any other component you happen to have in your program. Select the component and click the custom code button. In the custom code window select the Initialization macro and click edit. In here add your line of C code to configure the internal oscillator. Now click OK to exit the custom code windows and delete the icon containing the oscillator frequency change.
Martin

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Using the FlowKit ICD Tool

Post by medelec35 »

I have modifed your Flowchart. I'm not sure if it will work,as it depends if your target starts up at 31KHz as well? But its worth a try.
Attachments
TESTING_MPLAB_Modified.fcf
(11 KiB) Downloaded 1243 times
Martin

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Using the FlowKit ICD Tool

Post by medelec35 »

Hiya all.

When using Flowkit plugged in to 40pin demo board (uses 16F887) which was free with pickit 2. When ran Flowcode, Green outline is present. Can Step though program OK, and LED's light as expected, so communications is OK. Except Variables do not update, they stay fixed as though reading data from wrong addresses. Any ideas please?
Or is this a bug?
Attachments
16f887_demo3_ICD.fcf
(12 KiB) Downloaded 1203 times
Martin

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Using the FlowKit ICD Tool

Post by medelec35 »

Is there a way to determine address which is read by Flowcode when flowkit is connected, then how could I change the necessary file to enable correct address for variables to be displayed on Flowcode please?

Could it be just component related?
Since When using flowkit with Miac, correct value of variables are displayed.
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using the FlowKit ICD Tool

Post by Benj »

Hello,

The addresses of variables are worked out using the COFF debug file that is generated during compilation. I will have a look at the 887 and see if there is anything that is potentially causing the ICD variable readback functionality to fail.

D.Bouchier
Posts: 28
Joined: Tue Sep 28, 2010 12:36 pm
Has thanked: 5 times
Been thanked: 1 time
Contact:

Re: Using the FlowKit ICD Tool

Post by D.Bouchier »

Hello, is it possible to use the HP299 as a "virtual controll unit" from your pc to the target?

So that if i simulate my program and press a button on the screen, my targets executes the task assigned to that button (ofcourse the task would have to be programmed and the button has to be read in with a variable)

So i dont need physical buttons for the target to preform a task when a button is pressed,
Regards

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using the FlowKit ICD Tool

Post by Benj »

Hello,

You would probably be better off with an ECIO and then use the USB slave Flowcode component to create your slave device. There are a few examples of how to do this using the free version of VB Express Edition or Labview available as part of the Flowcode examples pack.

D.Bouchier
Posts: 28
Joined: Tue Sep 28, 2010 12:36 pm
Has thanked: 5 times
Been thanked: 1 time
Contact:

Re: Using the FlowKit ICD Tool

Post by D.Bouchier »

Hi, thanks for the respons.

I have an ECIO-40 with flowcode v4, but i can't find a good example of what you are talking about, can you send a link to what you mean?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using the FlowKit ICD Tool

Post by Benj »

Hello,

The main Flowcode 4 examples pack can be downloaded from here:
http://www.matrixmultimedia.com/Downloa ... .php?id=63

If you then look inside the following folders you will find some relevant examples.

Examples / Components / USB Slave / USB Slave Demo 3-Byte.fcf

A VB example that will run using VB 2010 express edition is available in this folder.

Examples / Components / USB Slave / Slave Interface VB / VB.Net 3 Byte Param Slave / Project1.NET / ECIO_Interface_Example.vbproj

The pre-compiled VB executable code can be found here.

Examples / Components / USB Slave / Slave Interface VB / VB.Net 3 Byte Param Slave / Project1.NET / bin / Project1.exe

D.Bouchier
Posts: 28
Joined: Tue Sep 28, 2010 12:36 pm
Has thanked: 5 times
Been thanked: 1 time
Contact:

Re: Using the FlowKit ICD Tool

Post by D.Bouchier »

So if I programm the example in my ecio-40 and run the .exe I should be able to send characters to my LCD by typing them in the .exe and press transmit?

Also, in the example there is a macro called "service_macro" but i dont see where it is called, could you explain this, or is there a text document related to this example? nvm this part, found it in usb-slave properties

many thanks

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using the FlowKit ICD Tool

Post by Benj »

Hello,

The service macro in the program is referenced in the properties of the USB slave component. Basically when the PC sends out data to the ECIO the macro is automatically called. When the macro is not running the ECIO will simply wait for the next incoming data. This functionality is started after calling the Run Slave Service macro as seen at the bottom of the main in the 3byte example. You can then resume normal functionality in the main if you wish by calling the stop slave service macro from within the service macro.
So if I programm the example in my ecio-40 and run the .exe I should be able to send characters to my LCD by typing them in the .exe and press transmit?
Thats the theory :mrgreen: You may need to install a VB runtime or at least download and install VB express edition to allow the VB pre-made executable to run.

Post Reply