Page 1 of 1
Programming a 16f628A
Posted: Sun Dec 11, 2011 5:09 pm
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??
Re: Programming a 16f628A
Posted: Sun Dec 11, 2011 9:44 pm
by JohnCrow
Hi Graeme
Are you able to post the flowchart you are having trouble with.
Re: Programming a 16f628A
Posted: Mon Dec 12, 2011 9:19 pm
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.
Re: Programming a 16f628A
Posted: Mon Dec 12, 2011 9:38 pm
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
Re: Programming a 16f628A
Posted: Mon Dec 12, 2011 9:59 pm
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.
Re: Programming a 16f628A
Posted: Mon Dec 12, 2011 10:17 pm
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
Re: Programming a 16f628A
Posted: Mon Dec 12, 2011 11:42 pm
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.
Re: Programming a 16f628A
Posted: Tue Dec 13, 2011 9:13 am
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.
Re: Programming a 16f628A
Posted: Tue Dec 13, 2011 7:06 pm
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.