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??
Programming a 16f628A
- JohnCrow
- 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
Hi Graeme
Are you able to post the flowchart you are having trouble with.
Are you able to post the flowchart you are having trouble with.
1 in 10 people understand binary, the other one doesn't !
Re: Programming a 16f628A
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.
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
-
- 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
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
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
Re: Programming a 16f628A
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.
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
-
- 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
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
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
Re: Programming a 16f628A
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.
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.
- 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
Sorry for the late reply - been kind of busy here over recent weeks!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??
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
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.
Thanks for everyone's input.