Flowcode8 and Microchip ICD4

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
RILamb
Posts: 35
Joined: Mon Nov 25, 2019 3:51 pm
Been thanked: 4 times
Contact:

Flowcode8 and Microchip ICD4

Post by RILamb »

In order to interwork Flowcode8 to a Microchip target development board can I send the hex code from Flowcode8 directly to the ICD4 in Microchip. Is that the correct path to follow. I suppose the alternative would be to copy the .hex file from Flowcode somehow into the Microchip file area? Sorry, I am very new to PIC programming and probably quite naiive regarding the process. I would welcome any assistance that will push the learning process forward. Thank you.

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by QMESAR »

Hi
Not quite sure what you need however if you want to program your Microchip board with the ICD4 directly from Flowcode the answer is
Yes this should be doable please check this post and document it could help you
viewtopic.php?f=7&t=19433&p=84498&hilit=ICD4#p84498

The other option is to install MPLABX on your PC ,with MPLABX is installed a programming SW called IPE (Integrated Programming Environment)
you compile your FC flowchart open IPE load the .hex file and program your board from the IPE SW,however for me programming directly from flowcode is much easier, just set it up and use the compile to chip button and the process is completed automatically

RILamb
Posts: 35
Joined: Mon Nov 25, 2019 3:51 pm
Been thanked: 4 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by RILamb »

Many thanks for your response to my query regarding Flowcode8 and the ICD4. I have had moderate success with the MPLAB IPE but can't get the chip to respond despite the ICD4 connecting to the development board and down loading the hex to the chip. Nonetheless I will persevere!
However, what really took my interest in your reply was the suggestion of programming the chip directly from Flowcode (Program to Chip). I can see the option but can't figure out what the physical path to the chip would be. With the IDE4 there is the USB connection to the IDE4 from the PC then the RJ11 link from IDE4 to the Microchip development board. Are you saying that the development board would not be appropriate in the case of the 'Programme to chip' option or is there another way of completing the connection? All very basic but part of the learning process!
Robert

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by QMESAR »

Hi
You can directly program from Flowcode
The following crude sketch show you the connections or the setup of your development system
ICD connect to RJ11 Connector on the Microchip board
The USB side of the ICD you must connect to your PC USB port and MPLABX must be installed as the drivers for the ICD is installed by MPLABX
The board must be powered by your Power supply either externally or over the USB
T1.JPG
T1.JPG (27.39 KiB) Viewed 7475 times
Then you have to setup in Flowcode (go to build >> Compiler Options >> Programmer) the ICD and the path to the IPE software
this is explained in this document

https://www.matrixtsl.com/wikiv7/index. ... _.28NEW.29

Note read the Forum post I showed you my previous post as the document shows ICD3 settings however the post shows you what to replace for ICD4
when done your path in FC should look something like this
P1.jpg
P1.jpg (114.39 KiB) Viewed 7475 times
When all of this is done then you write your flowchart press Compile to chip and FC will compile your Flowchart and automatically connect the ICD to the chip and program it ,this is all that is needed
Hope this helps you get going :D

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by QMESAR »

Hi
I have had moderate success with the MPLAB IPE but can't get the chip to respond despite the ICD4 connecting to the development board and down loading the hex to the chip
(1)I think your tool (ICD4) does not release the chip from reset after programming :D
In the IPE SW go to Settings and select release from Reset then do a program of the chip again and it will run
P2.jpg
P2.jpg (104.84 KiB) Viewed 7473 times
(2) Is your chip configuration set correctly this is done in build >>> project options >> configure

let us know how you get along :D
P1.jpg
P1.jpg (135.48 KiB) Viewed 7461 times

RILamb
Posts: 35
Joined: Mon Nov 25, 2019 3:51 pm
Been thanked: 4 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by RILamb »

Thank you again for the detailed help. I confess to being quite confused for two reasons: firstly, the details you have listed I can't replicate in my setup. Secondly, I am having difficulty understanding the relevance of some of the material shown in the settings, config etc. That comes down to my unfamiliarity with coding and programming in general and may well prove to be ultimately my undoing! I think what I am trying to say is that I cannot relate to actually what the relevance is of certain strings of characters, That I will come to later.
My setup is exactly as you have sketched and the target chip is a PIC16F628A on my Microchip development board.
Your first reference material relating to how the ICD4 is powered identifies a root path terminating in:
C:\Program Files (x86)\ …………… \ MPLABX \v5.30\ mplab_ipe\ipecmd.exe
That same path on my machine shows \ MPLABX \ v5.30 \ …. but there is no mplab_ipe etc to follow.
Yes, I am powering the ICD4 from the target board (ie externally) so would presume that the path shown in your FC7 reference document would be replicated on my machine. As regards the parameters I wouldn't know where to find that character string to be able to make the change to TPICD4.

You then pointed me to the set up in Flowcode as being (Build ))Compiler Options ))Programmer ). On my version , on the LHS under Compiler Options I show: ARM
AVR
PIC
Default
PIC 8 Bit
PIC 16 Bit
and correspondingly the location becomes:
$ (appdir) tools\ mloader \mloader.exe
In other words there is no PK3 or indeed any other option.
Should I be overwriting what appears ie taking out PIC 8 Bit for PK3 or something else. This is what I mean about not knowing what it is I am doing when faced with 'Location' and a path or 'Parameters' and a string of characters which I don't appreciate the relevance of!
When trying previously to 'Compile to Hex' then load that hex into MPLAB IPE, the ICD4 chatters away and seemingly loads the PIC. Problem is that it tells me that the expected addresses are all wrong! In other words, that process doesn't seem to work presumably because of the initial settings prior to compilation. Thoroughly confusing. Sorry to be so dependant on your help but I am very confused.
Robert

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by QMESAR »

Hi Robert,
I confess to being quite confused for two reasons: firstly, the details you have listed I can't replicate in my setup. Secondly, I am having difficulty understanding the relevance of some of the material shown in the settings, config etc. That comes down to my unfamiliarity with coding and programming in general
Dont get worried learning PIC's and programming is a steep learning curve ,I understand now you are at the very beginning of all of this so my suggestions would be for now.
(1) Tell me which Microchip board/chip you are having, I will make a Flowcart with all the settings set for you as a reference for this chip ,If you change chips some off the config settings will have to be changed but at that time you will be able to do that yourself.
(2) let us use the IPE programming SW until your board programs and is running fine ,Then I will help you to set the paths (this is easy to do but later then)
(3) show me a screen print of the messages /errors the IPE shows you when you program the device .

I will try my best to walk with you step by step until you are up and running with this board and chip,
Micro controllers are a fantastic world you are getting into but hard to get started with you have no help ,
Post me the info and we will take it from there
You then pointed me to the set up in Flowcode as being (Build ))Compiler Options ))Programmer ). On my version , on the LHS under Compiler Options I show: ARM
AVR
PIC
Default
PIC 8 Bit
PIC 16 Bit
You have to create a menu for your ICD4 and check the check box use as default and then set the paths but later we will use IPE directly for now

Regards

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by QMESAR »

Hi.
Just for your info the new MPLABX 5.30 has changed the location of the ipe it is now in a folder call MPLAB_Platforms and then IPE

the default path is
Location
C:\Program Files (x86)\Microchip\MPLABX\v5.30\mplab_platform\mplab_ipe\ipecmd.exe

Parameters:
/P$(chip) /F"$(outdir)$(target).hex" /TPICD4 /M /OL

This will be the settings for the programmer setup.

To set the paths do the following step by step as I show you here

(1) go to build >> compiler options >> programmer ,On the LHS make sure you are set on PIC and default unchecked the use default check box
R1.jpg
R1.jpg (108.96 KiB) Viewed 7415 times
(2) Now select the disk menu icon on the RHS top next to default, a window will open enter ICD4 in the setting name and make sure the group box PIC is highlighted. Press the OK button at the bottom
R2.jpg
R2.jpg (95.05 KiB) Viewed 7415 times
(3)You should now see on the LHS PIC and your ICD4 ,Make sure to check the use as default check box.At this point in the location and parameter boxes are still the mloader shown,now go to browse next to location and Browse to the location for the ipecmd.exe as I showed above
next copy and paste the parameter strings as I showed above into the parameters
R3.jpg
R3.jpg (106.02 KiB) Viewed 7415 times
Your setup should look like this now press OK ,the window will close ,as a check just go to build >> compiler options >> programmer and the settings should be visible as before as the default ICD4 and you are ready to run program from FC8
R4.jpg
R4.jpg (128.21 KiB) Viewed 7415 times
Hope this helps

RILamb
Posts: 35
Joined: Mon Nov 25, 2019 3:51 pm
Been thanked: 4 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by RILamb »

Many thanks. I was about to reply to your earlier suggestion of using the IPE when your latest message came in. I have followed your instructions and run the program. The error message is attached.
Thanks Robert
Attachments
2019-11-27 (8).png
Error information.
(102.45 KiB) Downloaded 1116 times

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by QMESAR »

Hi.

The IPE is telling you it does not find the hex file. Why I am not sure :D

Did you make a folder and saved your flowchart to this folder that the hole project is located in one folder.
Can you zip your project folder and upload it so that I can see where is the hex file .
the good side is that it seems you are now connecting to the ICD from flowcode :D

RILamb
Posts: 35
Joined: Mon Nov 25, 2019 3:51 pm
Been thanked: 4 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by RILamb »

Thanks again Qmesar. You really must have a lot of patience! I attach a zip file of screenshots which may be useful.
Robert
Attachments
New folder.zip
(1.05 MiB) Downloaded 172 times

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by QMESAR »

Hi.
No worries I am use to work with engineers fresh from the Uni and always have to help them get started :D patience is no problem

You must upload your FC8 Flowchart project this is the only way I can help you

From your screen prints the following

(1) it seems the ICD with IPE program the chip correctly however it is not running
(2) it not running because the Oscillator is set incorrectly (if you upload the Flowchart and tell me the Chrystal value (Clock value)your board is using I will set it for you) ,again what MC board you are using then I can look at it myself for the info I need
(3) From Flowcode you do access the ICD but is does not find the hex file for some reason (this is also why I need your Flowcode project and Flowchart

You are 10 seconds away from having a running micro controller just send me the files as asked :D

RILamb
Posts: 35
Joined: Mon Nov 25, 2019 3:51 pm
Been thanked: 4 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by RILamb »

Thanks for your reply. I wasn't sure what you meant by sending the project files which is why I sent the screenshots. My mistake. I hope this attachment is more helpful.
Robert
Attachments
Flowcode2.fcfx
(7.45 KiB) Downloaded 143 times

RILamb
Posts: 35
Joined: Mon Nov 25, 2019 3:51 pm
Been thanked: 4 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by RILamb »

Sorry,
You asked which board I am using. It is the Microchip Demo Board 2010. Number 02-01630-1.
Robert

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by QMESAR »

Hi Robert

I do not find this board under this name and number can you upload the user manual for it please :D

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by QMESAR »

Hi.
I have set the OSC in this Sample Flowchart to internal Oscillator 4MHZ as I do not know what your board is using

(1)Place this folder on your Hard disk and open the StartupTest.fc file from Flowcode by selecting open Project.
if you brows in this folder you will see the .hex file with the same project name.
RR_FC.rar
(46.85 KiB) Downloaded 121 times
HexFile.jpg
HexFile.jpg (161.38 KiB) Viewed 7347 times
(2) Use the IPE to program your device and see if it is running.
the 8 leds on Port B should switch on in a binary sequence as it is a counter which counts from 0-255 and start again .you can run the chart in Simulation and see what the leds should do on the board

(3) if this all is working go to your compiler settings>> programmer and make sure there is a space between .hex" and /TPICD4 as shown here
then save all compile to chip and see how it goes
P3.jpg
P3.jpg (64.32 KiB) Viewed 7347 times

RILamb
Posts: 35
Joined: Mon Nov 25, 2019 3:51 pm
Been thanked: 4 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by RILamb »

The delay in responding was as a result of having problems opening the RAR file - a new type of file to me!
Your program, ran from the IPE, executed correctly and the LEDS came on in sequence.
I then attempted to run your program using the compiler/programmer settings you advised me yesterday to set up (ICD4) after having created the space between .hex'' and /TPICD4. That program failed. I attach the screenshot showing the error.
But it is all progress!!
Attachments
2019-11-28 (2).png
(166.61 KiB) Downloaded 1041 times

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by QMESAR »

Hi Robert,

I am happy that the Chip runs with my basic setup file which you can use as a reference for your own FC charts.
The space you added in your paths is also progress as FC and the IPE find the hex file now no Hex file error report.

It seems to me the error you are having now is somehow ICD4 related and to be honest I do not have an ICD4 to check this I have an ICD3 and PicKit3.
the error seems to be a USB(endpoint error) at this point I have to ask that Ben and leigh get on board and help us out here.
However in the mean time you can write flowcharts and program from the IPE :D

Ben/leigh please help us here

just thought about it was the IPE closed when you tried programming from FC it can be that the IPE was still owning the USB port when it was open

RILamb
Posts: 35
Joined: Mon Nov 25, 2019 3:51 pm
Been thanked: 4 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by RILamb »

Brilliant! Just as you suggested, I hadn't closed the IPE ( I wasn't aware that it could be an issue) and that is what was giving rise to the problem.
I can really only say a big thank you for your perseverance and encouragement. I have been a bit slow but gradually things have been making more sense although there is a long way to go. The prime objective was to become familiar with PIC's and to avoid coding; that to be achieved through the use of Flowcode. Now that the access issue to the development board from Flowcode has been resolved I can get on and with the task in hand.
I have to say I wasn't expecting this degree of assistance nor in the friendly and understanding manner in which you have approached it. I do appreciate how much of your time I must have taken up with my problems and I can only say again very many thanks.
Robert

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by QMESAR »

Hi Robert.

You are welcome! I am happy that you are up and running now .
my 2 cent's for the road ahead
(1) Take the datasheet and carefully read the Oscillator section and make sure you understand it,this is important as in any Programming you need to set the OSC settings even in FC without it the chip never respond .
(2) It is useful to know what speeds you can run a chip as different speed can help you in many Hardware situations
(3) The 628 is not a very good chip for the future it is a bit old and resource limited probably a 16F1938 or 39 would be a better variant
to get to know PIC's
(4) Always have the datasheet at hand when working with micro's (read and read a datasheet as much as you can)
(5) Would be advisable to perhaps use a MATRIX development board with GHOST which allows you debugging from FC (debugging is unavoidable as your program complexity grows)and last if in need you can ask help here in the forum, we are a small community but like the Marines, we never leave a buddy behind :D

Good luck

RILamb
Posts: 35
Joined: Mon Nov 25, 2019 3:51 pm
Been thanked: 4 times
Contact:

Re: Flowcode8 and Microchip ICD4

Post by RILamb »

Thank you for the advice. The settings on my own test program were all wrong, particularly the oscillator setting. Actually the signs were already there in an earlier error report. I amended the settings in 'Configure' and learnt a lesson!
As regards data sheets I had just acquired that for the 16F628A and having got a few of those chips from a friend decided to start with that. I note your comment regarding a better PIC for the future and will send for a few in the next week.
As regards the Matrix range, I was actually looking at what is shown on the website. I had hoped to get the advantages of Flowcode8 and the debugging capabilities of the IDE to save me investing in more hardware. I will have to give some thought to that one.
Again, many thanks for your help.
Robert

Post Reply