Maker Pro
Maker Pro

16F PIC DIY Programmer troubleshooting

D

Damn Dan

Jan 1, 1970
0
I'm designing a programmer for my 16F88 and I almost have the engine
complete. I'm running into one bizarre issue that I can't seem to
trace down. I'm hoping for some troubleshooting advice.

The programming spec says to write a 14-bit word by cycling the clock
16 times and latching the word onto the 2nd through 15th cycle.
Likewise, reading a 14-bit word involves cycling the clock 16 times and
reading the 2nd through 15th bits. The 1st and 16th bits are always
pads. I've noticed that my PIC always uses 1's to pad the 14-bit word
during a read command.

My issue arises when the MSB of my 14-bit word is not a "1". When I
try to read a word whose MSB is "0", the PIC doesn't throw a "1" as the
16th bit and then fails to read any more addresses. If I attempt to
increment and read beyond that troublesome word, it always returns
0x3FFF.

For example, if my 14-bit word is b00000000000001, then the PIC returns
the 16-bit value of b1000000000000011 and everything is great (I just
grab the 14-bits between the padded 1's). However, if my word is
b00000000000010, the PIC returns b1000000000000100 and everything fails
after that (it didn't throw the last "1" as the 16th bit).

I confirmed my write procedure is correct by incrementing past the
troublesome word and continuing to read. In other words, all the data
is being written, it's just not being read correct.

I'd appreciate any toubleshooting advice. This problem has been
perplexing me for a while now.

Thanks!

-Dan
 
C

colin

Jan 1, 1970
0
Damn Dan said:
I'm designing a programmer for my 16F88 and I almost have the engine
complete. I'm running into one bizarre issue that I can't seem to
trace down. I'm hoping for some troubleshooting advice.

The programming spec says to write a 14-bit word by cycling the clock
16 times and latching the word onto the 2nd through 15th cycle.
Likewise, reading a 14-bit word involves cycling the clock 16 times and
reading the 2nd through 15th bits. The 1st and 16th bits are always
pads. I've noticed that my PIC always uses 1's to pad the 14-bit word
during a read command.

My issue arises when the MSB of my 14-bit word is not a "1". When I
try to read a word whose MSB is "0", the PIC doesn't throw a "1" as the
16th bit and then fails to read any more addresses. If I attempt to
increment and read beyond that troublesome word, it always returns
0x3FFF.

For example, if my 14-bit word is b00000000000001, then the PIC returns
the 16-bit value of b1000000000000011 and everything is great (I just
grab the 14-bits between the padded 1's). However, if my word is
b00000000000010, the PIC returns b1000000000000100 and everything fails
after that (it didn't throw the last "1" as the 16th bit).

I confirmed my write procedure is correct by incrementing past the
troublesome word and continuing to read. In other words, all the data
is being written, it's just not being read correct.

I'd appreciate any toubleshooting advice. This problem has been
perplexing me for a while now.

I just programmed my 16f88 the other day, using about 5 resistors conected
it directly to the serial port (much like the com84 design) and winpic
software. although you might just want to build one for yourself for
fun/torture it might be an idea to see how the bits are sent with a working
programmer considering how simple it is.

Colin =^.^=
 
Hey Colin, Since my Picstart died just today and my chip of choice is
just the 16f88, this is great news! Unfortunately my electronics
insight is quite limited and so I doubt I could work that out by
myself. Stating that it's "much like the com84 design" I assume there
are changes in your design. Would you mind sharing your wisdom? Or do
you even have an schematic off hand, that would be so cool ! Best,
Hannes
 
C

colin

Jan 1, 1970
0
Hey Colin, Since my Picstart died just today and my chip of choice is
just the 16f88, this is great news! Unfortunately my electronics
insight is quite limited and so I doubt I could work that out by
myself. Stating that it's "much like the com84 design" I assume there
are changes in your design. Would you mind sharing your wisdom? Or do
you even have an schematic off hand, that would be so cool ! Best,
Hannes

The comm84 design is on the web somewhere, it realy is so simple though,
i just conected resistors from the various rs232 ports to the various pic
pins,

tx from the pc rs232 port =pin3 on a 9pin connector, goes to mclr|vpp via
4k7 resistor,
dtr =pin4 goes to pgdata|rb7 via 2k2 resistor,
cts =pin8 goes also to pgdata|rb7 but with no resistor,
rts =pin7 goes to pgclock|rb6 via 10k resistor,
gnd =pin5 goes to gnd.

its basicaly the absoulute minimum needed.

The only issue is that it relies on the pc port giving a good healthy +12v
output some laptops only give 8v wich isnt enough,
however you could use low voltage prgm mode, also the input threshold of the
rs232 must be slightly positive wich again on some laptops isnt, an
alternative is to conect the rs232 gnd to about 2 or 3v with repsect to the
pic gnd this shld help with both propblems, this means you mustnt earth the
gnd of the pic. it worked fine with my desktop and pic16f88.

this link gives the same thing but with a few bells and whistles such as
providng 5v to the pic from the rs232 port and some protection diodes etc:-
http://www.qsl.net/dl4yhf/winpic/index.htm#simple_prog

Im going to try it on a dspic30 in a few days, however ive seen a circuit
wich duplicates the icd2 directly alowing debugging so i might build that or
if im feeling lazy i might just buy one, but where the fun ... it does
however require you to program a picf687 so its like pulling yourself up by
your shoelaces ! i might go for the usb version too as ive only got one
rs232 port.

Colin =^.^=
 
C

colin

Jan 1, 1970
0
Hey Colin, Since my Picstart died just today and my chip of choice is
just the 16f88, this is great news! Unfortunately my electronics
insight is quite limited and so I doubt I could work that out by
myself. Stating that it's "much like the com84 design" I assume there
are changes in your design. Would you mind sharing your wisdom? Or do
you even have an schematic off hand, that would be so cool ! Best,
Hannes

actually this was the link i got the simple idea from but to add some
resistors,
http://www.jdm.homepage.dk/easypic.htm

Colin =^.^=
 
C

colin

Jan 1, 1970
0
colin said:
The comm84 design is on the web somewhere, it realy is so simple though,
i just conected resistors from the various rs232 ports to the various pic
pins,

tx from the pc rs232 port =pin3 on a 9pin connector, goes to mclr|vpp via
4k7 resistor,
dtr =pin4 goes to pgdata|rb7 via 2k2 resistor,
cts =pin8 goes also to pgdata|rb7 but with no resistor,
rts =pin7 goes to pgclock|rb6 via 10k resistor,
gnd =pin5 goes to gnd.

its basicaly the absoulute minimum needed.

The only issue is that it relies on the pc port giving a good healthy +12v
output some laptops only give 8v wich isnt enough,
however you could use low voltage prgm mode, also the input threshold of the
rs232 must be slightly positive wich again on some laptops isnt, an
alternative is to conect the rs232 gnd to about 2 or 3v with repsect to the
pic gnd this shld help with both propblems, this means you mustnt earth the
gnd of the pic. it worked fine with my desktop and pic16f88.

this link gives the same thing but with a few bells and whistles such as
providng 5v to the pic from the rs232 port and some protection diodes etc:-
http://www.qsl.net/dl4yhf/winpic/index.htm#simple_prog

Im going to try it on a dspic30 in a few days, however ive seen a circuit
wich duplicates the icd2 directly alowing debugging so i might build that or
if im feeling lazy i might just buy one, but where the fun ... it does
however require you to program a picf687 so its like pulling yourself up by
your shoelaces ! i might go for the usb version too as ive only got one
rs232 port.

Wel ive just bought the PICKIT 2 STARTER KIT cos it seemed quite good value
considering the cost of the components to build one.

Colin =^.^=
 
Top