Flow code 5 to my Chip PIC16F1826

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Flow code 5 to my Chip PIC16F1826

Post by JLeith »

Hello All,
It has been a while since I had to asked for some further help with my project in Flow code.

I have the program running nicely in Flow code but when I load the PIC I can send a High into RB0 but I don't get the action on the PIC as I see on Flow Code.

I have the PIC on a Bread Board so I don't get other parts reacting. ( PIC16F1826 )

I have uploaded my program to this topic. ( March 14 )

On a quick note is there a way to have my PICKIT 2 running version 2.61 work in flow code saving me to save the HEX and use the PICKIT2 software. I tried the setting from other 2007 post but they didn't work with the new 2.61 version ?

On a simple test I would send a High into RB0 and in the Ball selection ( 1 ) I have add Port A 0 to send out a High when entering the Ball selection.

It is like my RBO is not activating the Switch Value ?

John
Attachments
Flowcode Scoreboard March 14.fcf
Flow code March 14 for Score Board
(119.44 KiB) Downloaded 292 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: Flow code 5 to my Chip PIC16F1826

Post by medelec35 »

Hi John,
The configurations has not been set.
That could be the reason why flowchart is simulating ok, but hardware is not working.

As for Pickit 2, I have not go a 16F1826 to try but here are my setting for pickit 2 which programs device via Flowcode just fine.

Programmer:
Location
C:\Program Files (x86)\Flowcode\V5\Tools\PICkit2\pk2cmd.exe

Parameters
-BC:\Program Files (x86)\Flowcode\V5\Tools\PICkit2\ -PPIC%p -F%f.hex -M -A5 -R
I'm running 64 Bit windows, so if your not then (x86) is not required.
Martin

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: Flow code 5 to my Chip PIC16F1826

Post by JLeith »

Hello once again medelec35.

it has been some time since we communicated.

On the Config settings something has gone totally wrong since my Feb project. I have been looking on where I can modify the Config 1 & 2 when I ask FlowCode to Config the chip it comes up with ( Config 1 = 00ff , Config 2 = 0013.

This is a mess - I would like to to know how I fix this to read ( Config 1 = 3FFF , Config 2 = 3713 )

On the program do you see any reason I can't get the RB0 to trigger on the chip ?

I will try the settings fro Flowcode to work directly to PICKIT 2.

So if you can help point me into the changing the Config settings maybe I can get things to work. I think it is in the Header under the FlowCode directory but I don't know how to make the changes.

John

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: Flow code 5 to my Chip PIC16F1826

Post by JLeith »

Hy again medelec35,

I tried the PIC2 to flowcode and received a message that a UPDATE to pic2cmd is required.

I looked around the web but no luck finding a update.
Update PK2cmd.jpg
Update PK2cmd.jpg (43.59 KiB) Viewed 12711 times
More fun.

John

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: Flow code 5 to my Chip PIC16F1826

Post by medelec35 »

JLeith wrote:
This is a mess - I would like to to know how I fix this to read ( Config 1 = 3FFF , Config 2 = 3713 )
Those setting do not look right to me.

To enter config value, just go to configuration settings and:
Config settings.png
(85.24 KiB) Downloaded 7503 times
Leave the 0x in place and enter new configuration settings

As for Pickit2 I did not believe it supports 18F1826?
pickit2 16F1826.png
(69.19 KiB) Downloaded 7503 times
acestu also stated this on a differnt thread.
That's probably why the message is about update required, and this may not have been done to get you to purchase Pickit3.
Have you managed to program your 16F1826 via stand alone programming software?
Martin

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: Flow code 5 to my Chip PIC16F1826

Post by JLeith »

medelec35 hello,

I have looked through the options and I don't see the screen you have listed ??

I have I think placing the hex into my chip PIC16F1826 which is supported under the 1v8 voltage settings in the PICKIT 2 program.

Once I have the hex loaded I manually change the Config bits. I hope you can point me to your nice settings.

It is hard to know what the chip has with nothing moving.
Flow menu items.jpg
Flow menu items.jpg (55.07 KiB) Viewed 12707 times
John

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: Flow code 5 to my Chip PIC16F1826

Post by JLeith »

A Little more info.

Here is the action from the PICKIT 2 program.
PIC2 hex.jpg
PIC2 hex.jpg (30.61 KiB) Viewed 12703 times

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Flow code 5 to my Chip PIC16F1826

Post by kersing »

To set the configuration in FC5, in the "Build" menu choose "Project Options". On tab "General Options" there is a button "Configure chip". That button opens the screens Martin included.
DIALOG.JPG
DIALOG.JPG (37.96 KiB) Viewed 12702 times
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

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: Flow code 5 to my Chip PIC16F1826

Post by medelec35 »

Your Version of Flowcode is not up-to date
You can download the latest version from here:
http://www.matrixmultimedia.com/flowcode.php
Make sure you have the last 2 sections of your key handy 1st as you will need it for the download to start.

As for the configuration screen.
This only needs doing once.
Go to 'Build', Compiler options' and select programmer.
Make sure Use external program to set configuration options is ticked.
In the location box should be the correct path for PPP

Select OK.

Now go to Build then select Configure the Chip.
You should have the same options as I have then.

As for the out of date device file have you tried the latest one from here:
http://www.microchip.com/stellent/idcpl ... e=en023805
?
It looks like your target device is supported:
pickit2 16F1826 v2.png
(71.44 KiB) Downloaded 7490 times

Edit crossed posts ..sorry Jac
Martin

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: Flow code 5 to my Chip PIC16F1826

Post by JLeith »

medelec35 You have a Magic PC ?

I did the upgrade - Now when it finished it posted a screen asking for pass key but if this is a upgrade no key needed. So this was an upgrade so I didn't put in a key.

I don't get that MAGIC screen you have on your PC.

Here is what I have and also the Flowcode version.
Configure Chip.jpg
Configure Chip.jpg (57.91 KiB) Viewed 12693 times
I looked for another option to turn on the screen but no luck.

This whole project has been cursed since I started and I have to come up with a fix ASAP because the baseball season starts in April and 8 months to build a project is not working out well.

John

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: Flow code 5 to my Chip PIC16F1826

Post by medelec35 »

JLeith wrote: I don't get that MAGIC screen you have on your PC.
Hi John,
Did you follow this step:
medelec35 wrote: As for the configuration screen.
This only needs doing once.
Go to 'Build', Compiler options' and select programmer.
Make sure Use external program to set configuration options is ticked.

In the location box should be the correct path for PPP

Select OK.

Now go to Build then select Configure the Chip.
You should have the same options as I have then.
settings.png
(42.28 KiB) Downloaded 7481 times
Martin

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: Flow code 5 to my Chip PIC16F1826

Post by JLeith »

I'm sorry missed the first check box.

Ok I'm off to see what happens.

I will post a new Version once I confirm the config works.

John

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: Flow code 5 to my Chip PIC16F1826

Post by JLeith »

medelec35 hello,

Well the Configuration has been fixed, Thank you.

Now I still have not been able to get the PICKIT 2 working. Now I have the Current version in the PICKIT 2 software which is not the same in the Flowcode application.

Not sure how to get Flowcode to work with the new 2.61 version of PICKIT 2.
Forcode vs PICKIT 2.jpg
Forcode vs PICKIT 2.jpg (65.66 KiB) Viewed 12682 times
Still working out how the PIC is processing the code no way near what Flowcode does.

John

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: Flow code 5 to my Chip PIC16F1826

Post by Benj »

Hello,

All you should have to do to get PICkit working with the new DAT file in Flowcode is to copy the DAT file into the following location on your PC.

C:\Program Files (x86)\Flowcode\v5\Tools\PICkit2

or on a 32-bit PC

C:\Program Files\Flowcode\v5\Tools\PICkit2

Then follow the instructions detailed here to setup the PICkit 2 command line as your default programmer.

http://www.matrixmultimedia.com/support ... f=68&t=787

If this fails to work then you may also need an updated version of the standalone command line pk2cmd.exe tool which is produced by Microchip.

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: Flow code 5 to my Chip PIC16F1826

Post by JLeith »

Hello Benj,

it has been a while since we worked on my never ending problems with my Scorebaord.

Well it must be a brighter day I double checked my settings and I emailed Microchip and they sent me a link to a new PK2cmd file.

I uploaded the pk2cmd and now I don't get the error on the outdated pk2cmd. I get that It can't find the chip.
Find Chip
Find Chip
FIND Chip.jpg (42.65 KiB) Viewed 12595 times
The PICKIT 2 is plugged into my USB port. Not sure how Flowcode can find my chip I don't see a setting to point it to the USB.

Odd when I use the PICKIT 2 software it finds the chip... well I think it does because I get flashing lights on the PICKIT 2. Not 100% sure the PIC reads the code because it does not execute the code as outlined in Flowcode. I posted another item on the programing difference from a PIC16F88 which was the project I worked with and selected the bigger chip PIC16F1826 but it is not working.

Benj I would like to see if there is someone that could upload my project and see if it could work. I'm almost at the point in saying this is not possible to do in the real world. I don't want to cash in because in flowcode the project works exactly like I would like to see.

Well I'm going to keep working on the beast thought I might try a basic program to my PIC like a switch on Port B and turn on a Led on Port A when pushed.

John

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: Flow code 5 to my Chip PIC16F1826

Post by Benj »

Hello,

I just found this which says it supports your device and in the folder is a new hex file, presumably new firmware for the PICkit itself so it can talk to all the new devices.

http://digital-diy.com/forum/pickit2/ne ... t1722.html

Try adding the hex file, the pk2cmd.exe and the PK2DeviceFile.dat to your "Tools\PICkit2" directory and seeing if this helps at all.

You may also be able to flash the PICkit2 with the updated firmware using the stand alone PICkit 2 software.

Let us know how your getting on. Last resort may be to get hold of a PICkit 3 as I know these do work properly with the new devices.

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: Flow code 5 to my Chip PIC16F1826

Post by JLeith »

Benj you are a wizard.

Thank you so much I down loaded the ZIP file and placed the files into the Flowcode 5 PICKIT 2 directory and it worked first time.

:D John

Maybe you could post the link for other users with PICKIT 2 and Flowcode 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:

Re: Flow code 5 to my Chip PIC16F1826

Post by Benj »

Hi John,

I've added this forum topic to the FAQ for the PICkit2.

Thanks for letting us know how you got on.

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: Flow code 5 to my Chip PIC16F1826

Post by JLeith »

Hello Benj

Benj you know flowcode inside out.

Benj is there a way to add more chips to the Flow of the project with in Flow code.

I have the PIC and buttons to activate the functions I would like to know if I could add additional chips like this.

PIC ----- 3 to 8 decoder ---- ULN2004 Segment driver to simulate the full project.

I see there is many options that I have no knowledge on how or when to use them.
(Comm) (Peripheral) (Mechatronics) (DSP) ( Miac Module) (Misc)

Just trying to see if I could follow the PIC output.

John

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: Flow code 5 to my Chip PIC16F1826

Post by Benj »

Hello John,

You can create a flowcode program to control all the external devices but you will not currently be able to simulate them in v5. You can however use the ICD feature to try and debug the running hardware.

In v6 we hope to allow the features you are suggesting where you can add your own components and peripherals and make them behave like the real device.

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: Flow code 5 to my Chip PIC16F1826

Post by JLeith »

Hi Benj

I thought that might be the case.

Not a major problem I hope my project will work as it does in flowcode.

All the best,
John

Post Reply