PDA

View Full Version : Peculiar issue with U2 programmer - PIC12F1840 / Win 7 Ultimate x64



mtripoli
- 1st February 2015, 22:14
There isn't a meLabs programmer section so I thought I'd start here. I'm using the U2 programmer (latest code) with MicroCode Studio. MPASX (latest), PBP3.0.7.4.

Currently I'm doing a few projects using a PIC16F1823, PIC16F1503 and a PIC12F1840. The '1823 and '1503 work fine; the 1840 does not. When I program any other device (16F) with this setup everything works perfectly.

The first time I program the '1840 it works as expected. The second time I get the "Targets don't match error". I swapped out the device for a new one; same thing, first time it programs, next time not. Did this 4 times.

(The following refers to the U2 programmer and meProg) I discovered (with a bit of head scratching) that if I first READ the device (which shows all zero's), then manually open(it doesn't seem to update the new file itself like it does for the other devices) the hex file, I can program the device, but it will always fail on verify. If I say "ok" to the failed verification the device starts running as if nothing is wrong (I turned off auto verify just in this instance). Is there something that one is supposed to do that I am not when using the 12F series? As I plan on using a few thousand of these in this project I'd really like the tools to behave...

Thanks.

longpole001
- 3rd February 2015, 22:46
melabs forum on u2 programmer

http://support.melabs.com/forums/6-U2-USB-Programmer

mtripoli
- 4th February 2015, 17:06
SOLVED.

For those interested, with the help of Charles Leo this is solved. As it turns out, this is one of the cases in which if you have DAT and CLK pins configured as outputs, and MCLRE turned off (in CONFIG - so that it is an input pin and NOT MCLRE) there is no way for the programmer (meLabs U2) to "grab" the programming pins to re-program the device. The fix was to set MCLRE to ON and put a small delay at the very beginning of the program so that the PIC isn't trying to run. This programmer can then access the programming pins. If your programmer controls VDD as well you shouldn't see this issue (meaning you aren't doing in-circuit programming, or your powering your entire board from the programmer which isn't a good idea). If you're using one of meLabs adapters you won't see this as well as they do control VDD. I can't explain why this isn't an issue with PIC16Fxxxx devices (Ihave MCLRE set as an I/O on these) and have no issues; seems its a PIC12F issue...


ASIDE: Is there a way to change the title of a post so that one can insert something like "SOLVED"? As the OP I thought I'd be able to...