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: 271
Joined: Tue Mar 05, 2013 10:49 pm
Has thanked: 111 times
Been thanked: 13 times
Contact:

Re: Flowcode5 & PICkit2 issue?

Post by JDR04 »

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

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: Flowcode5 & PICkit2 issue?

Post by medelec35 »

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
Martin

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

Re: Flowcode5 & PICkit2 issue?

Post by JDR04 »

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

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: Flowcode5 & PICkit2 issue?

Post by medelec35 »

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

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

Re: Flowcode5 & PICkit2 issue?

Post by JDR04 »

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: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Flowcode5 & PICkit2 issue?

Post by kersing »

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).
“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: Flowcode5 & PICkit2 issue?

Post by medelec35 »

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

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: Flowcode5 & PICkit2 issue?

Post by medelec35 »

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 221 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: Flowcode5 & PICkit2 issue?

Post by medelec35 »

Same chaser application but using loops instead of decisions.
Attachments
LED Chaser2.fcf
(14 KiB) Downloaded 206 times
Martin

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

Re: Flowcode5 & PICkit2 issue?

Post by JDR04 »

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

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: Flowcode5 & PICkit2 issue?

Post by medelec35 »

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

Martin
Martin

Post Reply