Page 1 of 3

Problem programming Chip

Posted: Thu Jun 06, 2013 8:14 pm
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

Re: Problem programming Chip

Posted: Thu Jun 06, 2013 8:20 pm
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

Re: Problem programming Chip

Posted: Thu Jun 06, 2013 8:32 pm
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

Re: Problem programming Chip

Posted: Thu Jun 06, 2013 9:46 pm
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

Re: Problem programming Chip

Posted: Thu Jun 06, 2013 10:58 pm
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

Re: Problem programming Chip

Posted: Thu Jun 06, 2013 11:19 pm
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

Re: Problem programming Chip

Posted: Thu Jun 06, 2013 11:32 pm
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

Re: Problem programming Chip

Posted: Thu Jun 06, 2013 11:34 pm
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...

Re: Problem programming Chip

Posted: Thu Jun 06, 2013 11:43 pm
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...

Re: Problem programming Chip

Posted: Thu Jun 06, 2013 11:53 pm
by JDR04
Thanks Kersing, I'll give it all a try and get back to you guys. JDR04

Re: Problem programming Chip

Posted: Fri Jun 07, 2013 12:05 am
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

Re: Problem programming Chip

Posted: Fri Jun 07, 2013 8:34 am
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

Re: Problem programming Chip

Posted: Fri Jun 07, 2013 7:59 pm
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

Re: Problem programming Chip

Posted: Fri Jun 07, 2013 8:22 pm
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.

Re: Problem programming Chip

Posted: Fri Jun 07, 2013 9:10 pm
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

Re: Problem programming Chip

Posted: Fri Jun 07, 2013 9:13 pm
by JDR04
Just checked JP1 and JP2 with my meter and they are already joined. Dont understand why the holes are there??

Re: Problem programming Chip

Posted: Fri Jun 07, 2013 9:25 pm
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)

Re: Problem programming Chip

Posted: Fri Jun 07, 2013 9:30 pm
by kersing
What is the voltage on pin 4 when your application should be running? And what is the voltage on pin 1?

Re: Problem programming Chip

Posted: Fri Jun 07, 2013 9:46 pm
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

Re: Problem programming Chip

Posted: Sat Jun 08, 2013 8:48 pm
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

Re: Problem programming Chip

Posted: Sat Jun 08, 2013 9:17 pm
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

Re: Problem programming Chip

Posted: Sat Jun 08, 2013 9:19 pm
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

Re: Problem programming Chip

Posted: Sat Jun 08, 2013 9:32 pm
by JDR04
Heres my flowchart up till now..........

Anybody with any ideas out there?????

Re: Problem programming Chip

Posted: Sat Jun 08, 2013 9:47 pm
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?

Re: Problem programming Chip

Posted: Sat Jun 08, 2013 11:05 pm
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.