Program memory check failed

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Program memory check failed

Post by Jan Lichtenbelt »

Using a PIC16F688 I got the message "Program memory check failed". Reading all about this problem in this Forum, I tried the Flowcode 4 example program: "Sampling and outputting" with code protection "off" and a new, never used, IC. The first time the programming has been corretly performed. Now I tried a second time and the programming failed with the same messag "Program memory check failed". What to do?

User avatar
Steve
Matrix Staff
Posts: 3426
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Program memory check failed

Post by Steve »

Which hardware are you using?

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Program memory check failed

Post by Jan Lichtenbelt »

I use the EB006 board version 6 with 13.5 Volt external power supply

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: Program memory check failed

Post by Benj »

Hello Jan,

Which chip are you trying to program?

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Program memory check failed

Post by Jan Lichtenbelt »

Hi Ben

I tried the PIC16F688, with the results as given in the first message.

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Program memory check failed

Post by Jan Lichtenbelt »

Is there anybody who can help me to get working this simple setup?

Thanks already.

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: Program memory check failed

Post by Benj »

Hello Jan,

Do you have anything connected to port A on your EB006? Especially pins 0 and 1 as these are the device programming pins.

Also do you have any of the config code protection settings enabled? If so then the verification will fail as you are not able to read back the contents of memory for testing purposes.

I've had a look through the device datasheet and I've not spotted anything obvious as yet.

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: Program memory check failed

Post by Benj »

Hello Jan,

Right I have been doing some testing with the 16F688 devices and I have found the following through trial and error.

Once these devices have been programmed then further identifying and programming seems to fail on these devices.

To get around this problem you can do the following.

1) Start the programming process holding down the reset button on the EB006.

2) You will get the error message "Could not ID the onboard chip"

3) Now release the reset button and then click OK and the device should program correctly.

You will need to make sure that either PPP or Flowcode have a correct configuration before you do the process listed above. This ensures that the 16F688 is the device being programmed even if the auto detect did not work correctly.

Doing this process I have been able to sucessfully reprogram the device multiple times without fail. If this is not the case for you then please let me know and I will dig in a bit further.

I have also replicated this programming problem on the Microchip PICkit programmers so it seems there may be something fundementally wrong with these devices rather then our EB006 boards.

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Program memory check failed

Post by Jan Lichtenbelt »

Dear Ben,

I followed your procedure with succes. The programm is now well downloaded into the PIC16F688.

Is it possible to use the A-port for eg. LCD screen, after the programming procedure (with LCD disconnected while programming) ?

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Program memory check failed

Post by Jan Lichtenbelt »

Using the A-port of 16F688 fails. I don't know why? Who can help?
I use the EB006-V2 board with EB004 diode board on port A with using the PIC16F688 and the Flowcode as enclosed.Each A-port A0-A2 and A4-A5 must be high for 300 msec. But without succes. (Remark: Port A3 is only an input port and will not be tested.)
Attachments
Test_16F688_A_outputs.fcf
(9 KiB) Downloaded 264 times

User avatar
Dan81
Valued Contributor
Valued Contributor
Posts: 268
Joined: Sun Jan 15, 2006 4:07 pm
Location: Albi France
Been thanked: 60 times
Contact:

Re: Program memory check failed

Post by Dan81 »

Hello Jan

Watchdog Timer is ON !

Daniel

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Program memory check failed

Post by Jan Lichtenbelt »

Dear Daniel,

I tried it also with Watchdog off, but without any result.


Jan

User avatar
Dan81
Valued Contributor
Valued Contributor
Posts: 268
Joined: Sun Jan 15, 2006 4:07 pm
Location: Albi France
Been thanked: 60 times
Contact:

Re: Program memory check failed

Post by Dan81 »

Hello Jan

- if you want to use internal clock you must manage osccon register with C-code icon.
osccon = 0x60 ; (don't forget the semicolon) for 4MHz (and change the frequency in project options).
- I'm not sure that you can use internal clock with EB006 (oscillator is conneted)

Daniel

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Program memory check failed

Post by Jan Lichtenbelt »

Dear Daniel,

I indeed forget the osccon. But even with the osccon ste to 0x70 (8MHz), de LED's did not do anything. At least some of the LED's shoud do it. What do I forget?

Jan

User avatar
Dan81
Valued Contributor
Valued Contributor
Posts: 268
Joined: Sun Jan 15, 2006 4:07 pm
Location: Albi France
Been thanked: 60 times
Contact:

Re: Program memory check failed

Post by Dan81 »

Hello Jan

Try this file.
It seems to be OK with Proteus (I haven't got a 16F866)

Or try to use Xtal and A0 A1 A2 outputs.

Daniel
Attachments
jan2.fcf
tested with Proteus
(9 KiB) Downloaded 174 times

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Program memory check failed

Post by Jan Lichtenbelt »

Dear Daniel,

Thanks for your help. However, without succes. Nothing happens, neither with internal clock nor with external crystal.


Jan

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: Program memory check failed

Post by Benj »

Hello Jan,

Do you have the oscillator switch on the EB006 board et to the XTAL position? It might be worth switching back to RC and then back to XTAL to ensure that the switch is making contact correctly.

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Program memory check failed

Post by Jan Lichtenbelt »

Dear Ben,

I swithed SW2 between RC and XTAL as you said, without succes. I tried a PIC16F88 which works correctly. I placed a new PIC16F688, also with the same result, which means no action at all.

Jan

Albert38
Posts: 23
Joined: Mon Jan 18, 2010 8:40 am
Has thanked: 2 times
Contact:

Re: Program memory check failed

Post by Albert38 »

Hello Jan,

You did nothing wrong. A simulair problem I had with 12f609. What possible went wrong is that the pins used to program the chip now are configured in a way the eb006 will not allow you to reprogram the chip. When you put the chip in a programmer like easyprog or wellon you are able to program the chip and reconfigure it.

In the FCD file is this Initialise="ansel = 0x00;\ncmcon0 = 0x07;\n"
I cant find in the data sheet of this chip "ncmcon" so I have no idea what this is for.

Fist try this:
Put the clock jumpers to OSC and place the switches as follows.
SW1 - Fast
SW2 - RC

You could try to put in a c block
ansel = 0;

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Program memory check failed

Post by Jan Lichtenbelt »

Dear All,

Thanks a lot to Daniel, I found the solution.

I took the multimeter which showed the expected results of the microchip. Then the question arise why the LED's on the A-Port of the did not work. The next step was to look more carefully at the circuit diagram of the main board EB006. And indeed this shows that only A0, A1 and A2 of the 14 pins socket are connected to B7, B6 respcitively B2 (and not any A's). Thus changing the LED's to the B-port of EB006 showed the wanted results.

Afterwards it is always easy to understand problems. I'm glad it is solved. That makes me more confident to go on with this microchip. Thanks you all a lot.

Jan

User avatar
Steve
Matrix Staff
Posts: 3426
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Program memory check failed

Post by Steve »

I'm glad you found the solution.

The reason we have connected some of the portA pins on this device to portB is because the programming pins are there and these need to be connected to the programming chip. All other chip pinouts have these programming pins on portB.

Post Reply