Problem programming Chip

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:

Problem programming Chip

Post by JDR04 »

Hi Folks, I have done a simple program that flashes two LED's alternatively. It seems to work great in the simulation.

My first problem is I can no longer see the IC (PIC16F690) on the screen. Somehow I have turned that option off and do not know how to get it back.

My second problem is that I cant seem to download the program into the kit.

I get the following message

"If your flowchart contains C code, please review this carefully. If your flowchart contains no C-code or you have thoroughly reviewed the code, contact Technical Support."

I'm using a Pickit2 with the low pin count board with a PIC16F690.

I'm also using FLOWCODE5 pro version.

Youre help will be greatly appreciated.
Thanks again-JDR04

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: Problem programming Chip

Post by dazz »

HI
goto view and select chip view that should bring the chip back
can you post your flowchart.fcf flowchart C and flowchart.msg.txt files as someone can look over it to see if theres an issue

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

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

Re: Problem programming Chip

Post by JDR04 »

Hi Dazz, thanks for the prompt reply. Heres the stuff you asked for.

Have also spotted the following messages;

PICkit 2 found with Operating System v2.30.01

"Use -D to download minimum required OS v2.32.00 or later"

""Return code = 11

"Flowcode was unable to compile the flowchart's C code due to the following errors:"

"If your flowchart contains C code, please review this carefully. If your flowchart contains no C-code or you have thoroughly reviewed the code, contact Technical Support."


"Don't know what it all means but maybe somebody out there can help."

Thanks again JDR04
Attachments
agitator servo 1.c
(3.24 KiB) Downloaded 272 times
agitator servo 1.fcf
(8 KiB) Downloaded 290 times
agitator servo 1.msg.txt
(850 Bytes) Downloaded 276 times

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: Problem programming Chip

Post by dazz »

Hi
Looks like you need to upgrade your pickits firmware, chapter 4 in your pickit user guide details how to do it,
so upgrade the firmware, try programming again after and let us know how it goes
Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

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

Re: Problem programming Chip

Post by JDR04 »

Thanks Dazz, I'll give that a try. Dont understand how a month or so agao it all worked fine but now there is a proble.

Anyway, I'll see if I can update the PICKit2 and try again. JDR04

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

Re: Problem programming Chip

Post by JDR04 »

Downloaded latest PIKit2 software, v2.61. Restarted laptop and tried programming again but to no avail. Same error messages. Also tried programs that were working a little over a month agao and got the same error messages.

Evertime I go to use this Flowcode there is one problem or another. Getting really frustrated with this as I am new to this and when something keeps going wrong its frustrating as I do not understand the messages and what they mean.

Anyway thats my small rant so hoping somebody out there can help.

Thanks guys-JDR04

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

Re: Problem programming Chip

Post by JDR04 »

OK, we seem to be getting somewhere now. Flowcode messages are all good. Ccompiling to Hex says its all good.

Compile to chip also says its good. But...................................the LEDs do not flash at all!!!

Any help out there please. JDR04

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: Problem programming Chip

Post by kersing »

The PICkit2 programmer requires different firmware for different chips. This is not a flowcode issue, it has to do with the programmer you're using.

When using PICkit2 I prefer to use it in combination with MPlab IDE 8.xx. This work flow requires a few more steps because flowcode is not calling the programmer directly, but side steps the issues of having to think about PICkit2 code updates.

The way I use MPlab to program the devices is:
- In flowcode use 'Compile to HEX' (just left of the chip icon), not 'Compile to chip'
- Open MPlab IDE.
- Choose the correct chip in the 'Configure' - 'Select Device' menu.
- Select PICkit2 in the 'Programmer' - 'Select programmer' menu.
- Load the hex file in the 'File' - 'Import' menu.
- Program the device in 'Programmer' - 'Program' menu.

If you keep MPlab open it will automatically detect newer HEX files, so after modifying your code you just need to use the first and last step to program the device. For most circuits I remove power before connecting PICkit2 and remove PICkit2 after programming before applying power.

Hope this helps...
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

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: Problem programming Chip

Post by kersing »

JDR04 wrote:Compile to chip also says its good. But...................................the LEDs do not flash at all!!!
Have you set the chip configuration? (Project options, TAB 'General Options' use button 'Configure chip')
You need to set at least 'Watchdog timer' to 'OFF'. Depending on your circuit you might need to set 'Master Clear Enable' to 'Internal' (Not needed if you have connected a pull-up to pin 4).
I would also set 'Brown Out Detect' to 'BOD and SBOREN disabled'. Specify the correct option for the oscillator you are using.

Also make sure to set the clock speed in the General Options to the correct value, depending on the oscillator setup being used. The value is used to calculate the timing of the delay statements...
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

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

Re: Problem programming Chip

Post by JDR04 »

Thanks Kersing, I'll give it all a try and get back to you guys. JDR04

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

Re: Problem programming Chip

Post by JDR04 »

Hi Kersing, tried all that but LEDs still not flashing.
How do I determine the correct clock speed? I bought FLOWCODE thinking it would enable be to program microchips easily without having to mess around with more than one program.

The first time I used FLOWCODE I had a few problems that were easily sorted out with the help of various forum members. This time I'm having more problems in trying to get to grips with it all. Really did think FLOWCODE would make it easier for me but so far I'm struggling to work for me. Hopefully the next time I use it there are no further problems which require more settings and messing about.

Anyway, can you help any further please, I do appreciate your guys time and patience. JDR04

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: Problem programming Chip

Post by dazz »

hi
you determine the clock speed according to the xtal you are using, you also need to match the speed to the config settings. I have also just downloaded the manual for the demo board and the leds appear to be connected to port C so try changing A0 to C0 and A1 to C1
Let us know how you get on


Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

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

Re: Problem programming Chip

Post by JDR04 »

Hi Dazz, changed the port settings but LED's still not flashing.

I used the PICKit2 software to delete any program in the chip and verified that the chip is empty. I then used FLOWCODE and dowloaded the program into the chip and got a sucesfull message at the end. Also noticed the Busy light on the programmer flickering during the burn operation which seemed to indicate the chip was being programmed by the FLOWCODE software.

Then went back into the PICKit2 software and verified the program is infact in the chip as the memory is no longer blank.

I also used the PICKit2 software to check communications between laptop and programmer and all is OK.

So I take it that the chip is programmed but them pesky LED's will not flash. Any other ideas???

Cheers-JDR04

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: Problem programming Chip

Post by medelec35 »

Hi JDR04, If you post the flowchart your now using, then I can take a look at it for you and make adjustments if necessary.

Martin

Edit: I have posted a program for you to try.
You must make sure JP1 And JP2 are connected.
Attachments
agitator servo 2.fcf
(12 KiB) Downloaded 177 times
Martin

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

Re: Problem programming Chip

Post by JDR04 »

Hi Medelec35, as soon as I can get my laptop back from my wife I will post the program for you. Flowcode is only installed on my laptop and I dont think I'm allowed to install it on my desktop PC which I am now at.

JP1 and JP2 are not at the moment joined so I'll do that. Can you you explain why so I will understand. I do however have JP5 joined. Should JP5 not be joined. Also, must JP1 and JP2 be joined for all further programs??

Thanks again JDR04

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

Re: Problem programming Chip

Post by JDR04 »

Just checked JP1 and JP2 with my meter and they are already joined. Dont understand why the holes are there??

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: Problem programming Chip

Post by kersing »

Microchip demo boards often have jumpers connected with a copper trace between the pads with the holes. If you want to use the pin for other purposes you can cut the trace. If at a later point in time you want to re-establish the original connection you can solder a small wire in place or use proper headers and jumpers.

As this board has no crystal you need to set the oscillator setting to internal oscillator, also, add a C code block with

Code: Select all

osccon = 0b01110000;
Set the clock speed in the project options to 8000000 (8 million). Also use the settings I mentioned earlier (Watchdog timer off, BOD and SBOREN disabled)
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

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: Problem programming Chip

Post by kersing »

What is the voltage on pin 4 when your application should be running? And what is the voltage on pin 1?
“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: Problem programming Chip

Post by medelec35 »

JDR04 wrote:lowcode is only installed on my laptop and I dont think I'm allowed to install it on my desktop PC which I am now at.
You are allowed Flowcode to be installed on more than one PC you own within reason.
See:
http://www.matrixmultimedia.com/mmforum ... 78&#p39507


Martin
Martin

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

Re: Problem programming Chip

Post by JDR04 »

Hi Kersing, in answer to your question on Pin 1 and Pin 4 voltages, they are both 4.9V as set with the Vdd box in the PICKit2 software.

I tried doing the programming into the chip with Vdd on and off but it does not seems to make any difference. It appears that the chip itself is being programmed because I can wipe out the program memory using the PICKit2 software and then program via Flowcode and then verify it with the PICKit2 software.

Also the red busy light on the programmer flockers as you push the COMPILE TO CHIP button in Flowcode so I'm assuming al;l is well on the Flowcode side of things.

I'd be interested to know which is the programming pin on the PIC16F690 as well.

I've also noticed that the oscillator is set as INTERNAL RC CLOCKOUT. Is this correct?

Hope this helps JDR04

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

Re: Problem programming Chip

Post by JDR04 »

Hi Martin, tried using the program you posted but had the same problems as in the very begining of all this. I'm going to try and insert the c code bit as Kersing suggested and see what happens.......standby JDR04

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: Problem programming Chip

Post by medelec35 »

Hi JDR04,The program i posted has already got osccon set.
I ran it on my hardware before posting it.

Good luck anyway.

Martin
Martin

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

Re: Problem programming Chip

Post by JDR04 »

Heres my flowchart up till now..........

Anybody with any ideas out there?????
Attachments
agitator servo 1.fcf
(12 KiB) Downloaded 161 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: Problem programming Chip

Post by kersing »

I have no doubt the PIC is programmed correctly. So either the program contains an error or something else is wrong.

What are you using to power the circuit?
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

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

Re: Problem programming Chip

Post by JDR04 »

The chip is in the PICKit2 low pin count board. Power is supplied via the programmer itself which is connected to my laptop.

Also I checked pin 19 while the program was been burnt into the ic with my scope and there is definately various signals of about 2V on the pin 19 when the red busy light on the programmer is flickering.

Post Reply