picprojects.net Forum

picprojects.net Forum
It is currently Thu Jun 21, 2018 3:54 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: 2-transistor programmer circuit
PostPosted: Thu Dec 25, 2014 10:37 am 
Offline

Joined: Thu Dec 25, 2014 9:44 am
Posts: 2
Location: christchurch, new zealand
hi,
an earlier post i put up seems to have been wiped, so i'm reposting the essentials.

i've come up with a new design for a serial PIC16 (etc) programmer that connects via any USB to TTL serial bridge. it uses just a couple of transistors and a few resistors, and although not blindingly fast, represents a way to get a low- or mid-range PIC programmed from scratch. below is the schematic:

Attachment:
USB PIC16F6xxA programmer schematic v2.gif
USB PIC16F6xxA programmer schematic v2.gif [ 19.14 KiB | Viewed 7544 times ]


this uses TxD to create PGC pulses, so an output pin is freed up, with PGD and -MCLR under software control. PGM is monitored, with the user instructed to insert a programming jumper (or close switch) at the required point.

there are no timing delays involved during programming, everything is interlocked with feedback from the serial port - RxD monitors TxD, DSR monitors DTR. with a PIC16F628A i reckon it should be possible to program a device in a couple of minutes (based on 1mS USB packet boundaries).

this design is not compatible with any existing programming software.

christian: would you be interested in adding support to PICpgm? in principal it will be relatively easy, and i am available to work through the details of communications with the programmer. it is all done through the standard windows APIs, no need for hitting the hardware directly or using external DLLs.

please do pm or email me, or post a reply here.


cheers,
rob :-)


Top
 Profile  
 
 
 Post subject: Re: 2-transistor programmer circuit
PostPosted: Mon Dec 29, 2014 4:50 pm 
Offline

Joined: Fri Oct 28, 2011 5:18 pm
Posts: 223
Hi Rob,

interesting design :)
It is similar to my FTDI base USB PIC programmer, but there I use the FTDI library instead of the standard Windows APIs for the COM port.
But the only problem will be the programming speed, it will be very, very slow.

For my FTDI based USB PIC programmer, I have done several optimizations to improve the speed (i.e. I send a burst of operations at once which are clocked out by the FTDI chip afterwards), but still it is slow. Before I used this buffered mode, the concept was similar to your concept as I already said, and it was very slow. But it also depends on the usage. If you just want to program a PIC with a small HEX file only once (or twice ;)) it might be good enough.

Let me see if I find some time to prepare a prototype SW for you. If you support in testing, it would help.

Thanks & Regards,
Christian


Top
 Profile  
 
 Post subject: Re: 2-transistor programmer circuit
PostPosted: Tue Dec 30, 2014 2:11 pm 
Offline

Joined: Thu Dec 25, 2014 9:44 am
Posts: 2
Location: christchurch, new zealand
hi,
i'm more than happy to help out with testing. i'll crank up the soldering iron over the next few days and solder together a prototype.

i expect speed to be somewhere in the region of 20 words per second, which is fine for downloading firmware once, or for a hobbyist. making a few assumptions about how the USB driver is implemented for a given bridge may enable this speed to be considerably improved upon, but that is getting a bit ahead of things.

the basic algorithm for writing a single bit will look something like:
1. set DTR to desired state (bit value inverted) using 'EscapeCommFunction'
2. wait for DSR to reflect the new state by checking with 'GetCommModemStatus'
3. send out character 0xFF over TxD using 'WriteFile'
4. wait for character 0xFF to be looped back on RxD using 'ReadFile'
5. ... go back to step 1. for the next bit

for consecutive bits of the same value, steps 1 and 2 do not need to be repeated and multiples of character 0xFF can be sent out at step 3 and read back in at step 4. this will effectively double the throughput.

if it can be assumed that order of events will be preserved when changing the state of DTR and sending a character out TxD, then steps 2 and 4 can be skipped while writing a string of bits, at the end of the string then reading back the n character 0xFF's with a single ReadFile. this assumption may only hold true for certain drivers.

the dotted connections in the schematic allow, once the PIC16 device has been programmed, for the serial port to be used to communicate with the just uploaded firmware. this firmware, itself, could then implement a 'stage-2' device programmer - my own specific application is for a firmware that assists in programming PIC32 devices (using a modified branch of pic32prog that i have already got up and running over the last few months).


cheers,
rob :-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group