1
\$\begingroup\$

After reading Manoj's Work about how to program some PICs with USB to Serial Adapter, I decided to try myself to program the 16F84A with my CH340 USB-SERIAL adapter
Materials :
Software : Cygwin + K8048 Pic Programming software designed by Darron Broad & used with Velleman PIC programmers. I wrote a Configuration file .k8048 with this parameters relating to my hardware:

DEVICE = /dev/ttyS0
SLEEP = 6000
BITRULES = PGD_IN_FLIP | PGC_OUT_FLIP | PGD_IN_PULLUP
BUSY=0

My Custom hardware: enter image description here


CH340 USB to Serial Adapter : Support BREAK + CMOS levels (0v - 3.5V) -->for this reason I used a bidirectional level shifter on DATA (DTR) line.

Problem: When I use this with 16F84A the software returns Device not detected.
I checked all the pins one by one separately, all work fine.

\$\endgroup\$
1
\$\begingroup\$

Q5 is wired in Emitter Follower configuration, so the logic high voltage it sends to RB6 (PIC programming clock) will be about 0.6V less than the CH340's output (3.3v?). Also you don't have a pull-down resistor on RB6, so the clock input will float high.

Try connecting the Emitter of Q5 to ground, and wire the Collector to RB6. This will invert the clock signal, so you should set the BITRULES parameters accordingly. You might also consider lowering the value of R7 to around 1~2k, to ensure that the clock has a fast rise time and is not sensitive to noise.

The CH340 produces 5V logic levels when powered by 5V. If your USB to Serial adapter has +5V connected to pin 19 of the CH340 then it is already producing 5V logic levels and you shouldn't need level shifting circuits.

\$\endgroup\$
  • \$\begingroup\$ For The Q5 i made a mistake in the schematic, sorry for that.[The CH340 Adapter ](aliexpress.com/item/…). is powered from the USB laptop.i'll try to make a hack. Thanks alots Bruce. \$\endgroup\$ – smainoo Feb 21 '15 at 1:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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