Programming a 16f628A

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

Post Reply
graeme
Posts: 5
Joined: Thu Apr 08, 2010 6:53 pm

Programming a 16f628A

Post by graeme »

Hi, I'm using an E-blocks programmer EB-006. I can only seem to be able to program the chip with the osc switches set to slow/RC. If I set it to XTAL and fast I get a message saying the chip hasn't been erased and programming failed. Once programmed I can set the switch to XTAL and the code will run normally.

Is this normal??

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times

Re: Programming a 16f628A

Post by JohnCrow »

Hi Graeme
Are you able to post the flowchart you are having trouble with.
1 in 10 people understand binary, the other one doesn't !

graeme
Posts: 5
Joined: Thu Apr 08, 2010 6:53 pm

Re: Programming a 16f628A

Post by graeme »

Hi John,

The problem I'm having is with all flowchart programs on this chip. For example a loop with a delay turning on and off a led at 100ms intervals. If I set the board to slow/RC then it will program the chip with no errors and the program will run as expected when switched to XTAL. But if I try to program the chip when set to XTAL an error saying chip not erased and if you say continue it will come up program failed. Just by switching back to RC/slow and it will program ok. When I try the same with say a 18f4550 there's no problem and the chip will program regardless of where the oscillator switches are.

I have attached a very simple example but it will do the same with any flowchart.

Thanks and I hope this makes sense.
Attachments
Flash.fcf
(4 KiB) Downloaded 238 times

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Programming a 16f628A

Post by medelec35 »

That does sound odd since RB6, RB7, VPP, 5V and 0V are used to program device. the xtal is not connected to any of these so it should not make any difference on the switch settings.

The only thing I can see wrong with your flowchart is you have not got configuration settings (Chip menu then configure) correctly set up.

Can you retry with this modified flowchart and see if its just the same issue please.

Martin
Attachments
Flash with set config.fcf
(4 KiB) Downloaded 237 times
Martin

graeme
Posts: 5
Joined: Thu Apr 08, 2010 6:53 pm

Re: Programming a 16f628A

Post by graeme »

Hi,

loaded your program but it was set to 16f84. Sorry I should have posted the version set to 16f628A. Ran config autodetect to set it to 16f628a and set for XTAL operation. Still the same.

Thanks.
Attachments
Flash.fcf
(4 KiB) Downloaded 222 times

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Programming a 16f628A

Post by medelec35 »

I may be clutching at straws here, and may not be able to help. but Do you have a power supply of at least 12V DC plugged into your programmer, The psu/usb jumper on PSU (there has been issues with the jumpers in the past so you could try swapping LVP and PSU/USB jumpers)
If all of that fails, then maybe Matrix Staff can help tomorrow?
Odd its not the same with every device though.

Good luck and hope it sorted soon.

Martin
Martin

graeme
Posts: 5
Joined: Thu Apr 08, 2010 6:53 pm

Re: Programming a 16f628A

Post by graeme »

Hi,

Thanks for your efforts. This is a problem I can live with as I can still program the chips but it seems strange. I have the matrix power supply and it's set to 13.5V. I'm thinking it might be some sort of decoupling problem??? Time to get the scope out I think.

Cheers.

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

Re: Programming a 16f628A

Post by Steve »

graeme wrote:Hi, I'm using an E-blocks programmer EB-006. I can only seem to be able to program the chip with the osc switches set to slow/RC. If I set it to XTAL and fast I get a message saying the chip hasn't been erased and programming failed. Once programmed I can set the switch to XTAL and the code will run normally.

Is this normal??
Sorry for the late reply - been kind of busy here over recent weeks!

I have seen this behaviour before. I think it should only affect certain chips, and perhaps only those situations where they are set to use an internal oscillator and/or an internal MCLR reset.

The workaround (as you have discovered) is to set the clock source switch temporarily to RC while programming the device.

graeme
Posts: 5
Joined: Thu Apr 08, 2010 6:53 pm

Re: Programming a 16f628A

Post by graeme »

I'm glad it's not just me. And as I said there's an easy workaround. It doesn't appear to be any particular configuration and I get slightly different results with various chips of the same type. Looking at the circuit doesn't give any clues and it works ok every time with a 18f4550,16f877a and 16f88.

Thanks for everyone's input.

Post Reply