Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've built a simple PIC programmer which works OK on a PIC16F628 but fails on a PIC16F88:

enter image description here

I've checked the VPP voltage and it's within spec (although I had to substitute a 1.8K for the 1.6K to get it to 12.75 - the input is not exactly 5.0v) and I've added a lengthy delay to allow it to settle, but the 16F88 just won't play ball. Sadly I don't have access to an oscilloscope, but my logic analyser shows the right traffic on the logic lines at least, although the data coming back is always all zeroes. I've scrutinized the datasheets side by side but can't find anything which would explain the difference.

Does anyone have experience of these two MCUs? Is the 16F88 'more picky' in some way? Is my schematic, in fact, completely bogus? It works on a breadboard (with the 628).

The MCU is connected only to the ICSP lines, there's no other lines or circuit involved.

I suspected insufficent current, but the datasheet says that the current draw on VPP is very low (it's supplying about 50mA I think, I only have a cheap multimeter and I'm not sure I trust it).

Link to the software: Bitbucket

[Edit] Updated schematic to try and make it more clear.

[Edit] DC-DC step up is based on this tool: http://www.nomad.ee/micros/mc34063a/ with Vin=5, Vout = 13, Iout=35, Vripple=50, Fmin=125

[Edit] Schematic should be clearer now

[Edit] Added MCU to schematic. The capacitor C1 is actually just a ceramic capacitor, not tantalum or anything, but I can't get the right symbol to show in the schematic (so please ignore the little + sign).

share|improve this question
2  
Did you ground the LVP pin? Decouple the power? IME a series resistor (I use 47 Ohm) in the data and clock lines is a good idea (reduces ringing). – Wouter van Ooijen Mar 6 at 19:36
    
I put a 10k resistor between RB3/PGM and GND, no change, sadly. Not sure what you mean by decoupling the power? The MCU is powered from the ICSP directly, it's not plugged into anything else (is that ok? the VDD is supplied from the main 5V via one of the two 3906 PNPs). The logic analyser doesn't show any spurious transitions on the clock & data lines (I tried a couple of 180 Ohm resistors on them and the 628 still works but the 88 still doesn't). Totally mystified now... – Charlie Skilbeck Mar 6 at 20:32
    
have you try to programm always the same 16F88 Pic or have you test it on different 16F88 pics? Maybe the PIC16F88 that you are using is defective. – Alf Mar 6 at 21:24
    
Other reason could be on the software side, check that you are assigned the right libraries to program the 16F88, maybe you are using in your program the wrong libraries. – Alf Mar 6 at 21:32
    
Not sure what you mean about libraries? I'm just trying to read the config and device ID words. The 628 reads correctly, the 88 reads all zeroes. – Charlie Skilbeck Mar 6 at 22:25
up vote 2 down vote accepted

The two micros enter programming differently.

The pic16f628 wants the Vpp line pulled high before the Vdd line is pulled high.

enter image description here

The pic16f88 is the opposite, it wants the the Vdd line pulled high before the Vpp line is pulled high.

enter image description here

There may also be other programming differences i did not inspect the entire programming specification for both.

share|improve this answer
    
Ah yes, good one. The sheet says tpu must be < 250 uS, which my step up maybe can't manage (I need an oscilloscope). Also, VPP line might start up noisily, but I can't control the 13v line with a transistor. I tried feeding the main +5v into the dc converter and using a transistor to control it, but I think the different voltages and only one ground was causing a problem because it was always on, regardless of what the base was. If I could get that working, I could start with a long delay to allow VPP to settle, then control it with the transistor which would make the rise time very fast. – Charlie Skilbeck Mar 8 at 7:11
    
Yoink! It works. With no delay between raising VDD and VPP it can read the config of both the 628 and the 88. Thanks! – Charlie Skilbeck Mar 8 at 7:33
    
And also works with a 16F628a so I reckon it's good enough. Would be nice to look at VPP with an oscilloscope to see if the rise time is coincidentally correct but anyway, thanks again. – Charlie Skilbeck Mar 8 at 19:27
    
@CharlieSkilbeck Not a problem. – vini_i Mar 8 at 19:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.