Flowcode5 & PICkit2 issue?

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

JDR04
Posts: 264
Joined: Tue Mar 05, 2013 10:49 pm
Has thanked: 111 times
Been thanked: 13 times
Contact:

Re: Flowcode5 & PICkit2 issue?

Postby JDR04 » Fri Mar 08, 2013 9:21 pm

OK, when I right click on the attachment you sent me, I get another box which only has a General tab, nothing else. In this tab it says that the file is a Microsoft Picture It! Document?? Does this sound right??

What I did do was manage to save the attachment to my desktop and it now has no problems opening up into flowcode etc.

When I push the button to compile to chip the busy light on my PICkit 2 programmer flickers so I assume the program is now in the chip?

However, when I push play to simulate the program, it works in the flowchart but the LED's on the low pin count board still do not light up as expected.

They work fine in the FLOWCODE panel, theres no problem there.

Any other suggestions guys cause I have not a clue. Thanks a hell of a lot for your time and patience-John

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8473
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2433 times
Been thanked: 3483 times
Contact:

Re: Flowcode5 & PICkit2 issue?

Postby medelec35 » Fri Mar 08, 2013 9:53 pm

JDR04 wrote:In this tab it says that the file is a Microsoft Picture It! Document?? Does this sound right??

Nope don't sound right to me.
JDR04 wrote:When I push the button to compile to chip the busy light on my PICkit 2 programmer flickers so I assume the program is now in the chip?

Not necessarily.
You need to check what's appearing in your compiler messages window.

If you closed it then select Build, Compiler messages.

If programmed ok you should see:

Code: Select all

Launching the programmer...
C:\Program Files (x86)\Flowcode\V5\Tools\PICkit2\pk2cmd.exe -BC:\Program Files (x86)\Flowcode\V5\Tools\PICkit2\ -PPIC16F690 -F2LED TEST int osc (1).hex -M -A5 -R
\ \ \ \| 
.

PICkit 2 Program Report
08-Mar-2013, 20:50:31
Device Type: PIC16F690

Program Succeeded.

Operation Succeeded
Return code = 0

FINISHED


You would be best paying attention to the report:
PICkit 2 Program Report
08-Mar-2013, 20:50:31
Device Type: PIC16F690

Program Succeeded.

Operation Succeeded
Return code = 0

FINISHED

Hopefully you have got
Return code = 0
which means no programming errors

Martin
These users thanked the author medelec35 for the post:
JDR04 (Sun Mar 10, 2013 8:17 pm)
Rating: 5.26%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

JDR04
Posts: 264
Joined: Tue Mar 05, 2013 10:49 pm
Has thanked: 111 times
Been thanked: 13 times
Contact:

Re: Flowcode5 & PICkit2 issue?

Postby JDR04 » Sat Mar 09, 2013 8:25 pm

Hi Martin, that's the report I get so all seems sorted on the programming side. Thanks for that.

I'm just going to make double sure I have connected the right LEDs to the right port etc so I dont make a further fool of myself.

I'll do that tonight and get back to you.

Really do appreciate your help. John

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8473
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2433 times
Been thanked: 3483 times
Contact:

Re: Flowcode5 & PICkit2 issue?

Postby medelec35 » Sat Mar 09, 2013 8:45 pm

Your welcome John,
That's good then.

We need to get you up and running.
When it works your bound to get the bug that makes you want to do more and more :P
I still get that! :lol:

I have got LEDs flashing away with your modified program I posted, so your hardware should work ok.

Have you got JP1, JP2 and JP5 linked.

Also if you have a meter, make sure there is +5V between RA3 and GND.
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

JDR04
Posts: 264
Joined: Tue Mar 05, 2013 10:49 pm
Has thanked: 111 times
Been thanked: 13 times
Contact:

Re: Flowcode5 & PICkit2 issue?

Postby JDR04 » Sat Mar 09, 2013 10:57 pm

OK, I only got JP5 linked not the others. I'll do that shortly.

However, I opened up the PICKit2 program and switched on the VDD and hey presto the LEDS are flashing away just like I expected them to.

However, I've noticed that when I run the Flowcode simulation on the laptop, it is not synchronised with the LED's on the low pin count board. I understand it must be the program that was downloaded into the PIC thats running. Is it possible to synchronised the simulation with what is actually happening on the board,or, is that why FLOWCODE has its own LEDs etc?

I've noticed the LED flashing is awafully slow. Is this because its running at 4MHZ? So..... is it possible to run the program faster by using controls in FLOWCODE?

Youre right, the bug has seriousely bitten and now I have alll sorts of ideas in my head but have to stop myself from entering the realms of fantasy - John

kersing
Valued Contributor
Valued Contributor
Posts: 1877
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 534 times
Been thanked: 1043 times
Contact:

Re: Flowcode5 & PICkit2 issue?

Postby kersing » Sat Mar 09, 2013 11:20 pm

If you want to synchonize the PIC program with the Flowcode you need to run the program in hardware debugging mode using FlowKit or the PIC Multiprogrammer. After using PICkit2 to program the PIC you have two independently running systems.
Emulation on Flowcode is (relatively) slow, depending on the speed of your computer and the simulation speed setting in the "Project Options" ("General Options" tab).
These users thanked the author kersing for the post:
medelec35 (Sun Mar 10, 2013 8:32 pm)
Rating: 5.26%
 
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8473
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2433 times
Been thanked: 3483 times
Contact:

Re: Flowcode5 & PICkit2 issue?

Postby medelec35 » Sat Mar 09, 2013 11:20 pm

JDR04 wrote:Is it possible to synchronised the simulation with what is actually happening on the board,or, is that why FLOWCODE has its own LEDs etc?

No the LED's in flowcode is just for simulation purposes only. Its purpose is to check the code is running how you would expect it to prior to sending code to the target microcontroller.
You can synchronise Flowcode with your harware, but it does not light the LED's in the simulator, instead the LED's and other bits on your hardware are controlled.
Jac has posted about that.
JDR04 wrote:I've noticed the LED flashing is awafully slow. Is this because its running at 4MHZ? So..... is it possible to run the program faster by using controls in FLOWCODE?


If your talikg about hardware then No its because you have seconds delay instead of 100's milliseconds. at 4MHz 1million instructions can be carried out per second. You can make the LEDs flash so fast, it looks like they are on instead of flashing.
Flowcode simulator runs a lot slower then your hardware.
I will create the knight rider effect of lights chasing one way then the other, with speed being controlled by variable resistor for something for you to try.

JDR04 wrote:Youre right, the bug has seriousely bitten and now I have alll sorts of ideas in my head but have to stop myself from entering the realms of fantasy
Told you :P :lol:
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8473
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2433 times
Been thanked: 3483 times
Contact:

Re: Flowcode5 & PICkit2 issue?

Postby medelec35 » Sun Mar 10, 2013 12:00 am

Here is the light chaser program, I have just thrown together for you.
I have altered the internal oscillator to 8MHz (2 million instructions per second)
To follow how the program runs step by step, just keep pressing the F8 key

I have added some notes to flowchart for you.

Hope you enjoy.

Martin
Attachments
LED Chaser1.fcf
(11 KiB) Downloaded 63 times
These users thanked the author medelec35 for the post:
JDR04 (Sun Mar 10, 2013 8:17 pm)
Rating: 5.26%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8473
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2433 times
Been thanked: 3483 times
Contact:

Re: Flowcode5 & PICkit2 issue?

Postby medelec35 » Sun Mar 10, 2013 12:15 am

Same chaser application but using loops instead of decisions.
Attachments
LED Chaser2.fcf
(14 KiB) Downloaded 59 times
These users thanked the author medelec35 for the post:
JDR04 (Sun Mar 10, 2013 8:17 pm)
Rating: 5.26%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

JDR04
Posts: 264
Joined: Tue Mar 05, 2013 10:49 pm
Has thanked: 111 times
Been thanked: 13 times
Contact:

Re: Flowcode5 & PICkit2 issue?

Postby JDR04 » Sun Mar 10, 2013 8:22 pm

A really big thanks to you guys. Its been great knowing that there are guys like you out there willing to impart your knoweledge and give your time, not to mention patience. Thanks for the other programs so I can learn and play around further.

I'm going to play around for a while and see what I can achieve before I tap your experpertise again.

Once again thanks so much - John

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8473
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2433 times
Been thanked: 3483 times
Contact:

Re: Flowcode5 & PICkit2 issue?

Postby medelec35 » Wed Mar 13, 2013 7:06 pm

Your welcome John.
Just so long as you have working hardware with the flowcharts posted, that the main thing.

Martin
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.