Jump to content
IGNORED

Create ICSP Programmer for Embedded Micro Controller Chips


mytek

Recommended Posts

 

After this, I tried adding a 2n2222 transistor at the output of CLOCK signal, as an emitter follower with a 1k resistor from emitter to ground and an 4.7nf capacitor in parallel, keeping the 2k2 resistor and LED in the DATA line. This worked in all my PICs:

 

This sounds good, and of course I'll want to test with a PIC16F1847, but I need to verify what the values of everything else is at this point. 2N2907's for VDD and VPP switches? 1K PIC CLK pull-up? And back to 2.2K PIC DATA pull-up with series LED, but now feeding into 2N2222 emiter-follower buffer with 1K impedance and parallel 4.7NF capacitor?

 

I will also try with 74HCT14 as well, and then decide which way makes the most sense.

 

Thanks for all the testing :)

 

- Michael

Link to comment
Share on other sites

Hi!,

 

This sounds good, and of course I'll want to test with a PIC16F1847, but I need to verify what the values of everything else is at this point. 2N2907's for VDD and VPP switches? 1K PIC CLK pull-up? And back to 2.2K PIC DATA pull-up with series LED, but now feeding into 2N2222 emiter-follower buffer with 1K impedance and parallel 4.7NF capacitor?

This is my current test circuit:

post-18634-0-38695100-1452651187_thumb.png

 

 

I will also try with 74HCT14 as well, and then decide which way makes the most sense.

 

Thanks for all the testing :)

Note that with an 74HCT14, as it is an inverter, you should use two in series or modify the program to invert the clock.

 

I should get some of those for myself, should be useful for interfacing to the Atari...

 

Good luck!

  • Like 1
Link to comment
Share on other sites

All solutions so far, and understand that I like them because of simplicity/low part count, are just trying to clean up a bad situation with switching wave forms. It may be a better design choice to use a latch. That is, when you want to set a data state you clock a latch to put it into proper state. If the right data is clocked a single time or a dozen times it shouldn't matter.

 

Just a FYI that doesn't matter much, I've driven J/S ports at a bit banged 19,200 baud and it worked reliably using an ST and IBM 286 clone as the receiver. If the built in delays and wait time to sample of RS232 can get it right IMO it is all about the switching.

Link to comment
Share on other sites

All solutions so far, and understand that I like them because of simplicity/low part count, are just trying to clean up a bad situation with switching wave forms. It may be a better design choice to use a latch. That is, when you want to set a data state you clock a latch to put it into proper state. If the right data is clocked a single time or a dozen times it shouldn't matter.

 

Good idea :idea:... However putting any IC (including the 74HCT14 as previously suggested) into the mix, perhaps unnecessarily complicates the design, as well as increases the PCB footprint. If I keep the PCB very small the OSH Park board cost remains cheap. And although I wouldn't normally recommend buying the parts from Radio Shack, the present design can probably be built from what they stock, or can likely be found in an electronic hobbyist's parts box.

 

Anyway the good news is that I tested the latest design changes by Daniel (V8) and it works perfectly with a PC16F1847. So that means the 4 currently supported PIC chips all work with this hardware. And since those chips cover a pretty good range of applications, I think we are getting close to finalizing this puppy. Not to say that more PIC's won't get added over time, but based on the results thus far and how the V8 hardware looked on the scope, I suspect that adding more devices should give good results as well.

 

As far as adding more devices, I might try my hand at adding a PIC18F14K50 which has a USB 2.0 compliant interface, a good amount of program space, and all the other usual bells and whistles. When looking at OctoPart the price per chip seems to be pretty consistent at $2.39 for PDIP and $2.10 for SMD. It would be nice to have a USB capable chip that the JOY2ICSP could program.

 

- Michael

Edited by mytekcontrols
Link to comment
Share on other sites

Hi!,

 

Good idea :idea:... However putting any IC (including the 74HCT14 as previously suggested) into the mix, perhaps unnecessarily complicates the design, as well as increases the PCB footprint. If I keep the PCB very small the OSH Park board cost remains cheap. And although I wouldn't normally recommend buying the parts from Radio Shack, the present design can probably be built from what they stock, or can likely be found in an electronic hobbyist's parts box.

 

Anyway the good news is that I tested the latest design changes by Daniel (V8) and it works perfectly with a PC16F1847. So that means the 4 currently supported PIC chips all work with this hardware. And since those chips cover a pretty good range of applications, I think we are getting close to finalizing this puppy. Not to say that more PIC's won't get added over time, but based on the results thus far and how the V8 hardware looked on the scope, I suspect that adding more devices should give good results as well.

Good, I think that this is the simplest circuit that will work across so many different PICs.

 

Today I tried adding an 74LVC14 to the clock line (it was the only schmidt triggered ID I had), and it was not so easy. The problem is that the 74LVC is *so* fast that it toggles with the noise in the Atari outputs, see this image (magenta is the Atari CLOCK output, cyan is the 74LVC14 output, yellow is the Atari DATA output):

post-18634-0-67534500-1452739762_thumb.png

 

The output is so noisy because in low state there is only the pull-up driving the line. Adding the 1k pull-up resistors attenuates the noise, but also attenuates the signal, so it does not always work.

 

My final solution was adding an 2k2 pull-up resistor plus the 4.7nF capacitor, this removes almost all the noise and makes the transitions smooth, see:

post-18634-0-04708500-1452740082_thumb.png post-18634-0-41168600-1452740227_thumb.png

 

With this setup, all my PICs work, but I think that the previous solution with the transistor is better. I think that newer PICs had problems before because the inputs are faster than old PICs, so are similar to the 74LVC inputs, my new measurements tend to support that.

 

As far as adding more devices, I might try my hand at adding a PIC18F14K50 which has a USB 2.0 compliant interface, a good amount of program space, and all the other usual bells and whistles. When looking at OctoPart the price per chip seems to be pretty consistent at $2.39 for PDIP and $2.10 for SMD. It would be nice to have a USB capable chip that the JOY2ICSP could program.

Programming a PIC18F is possible in theory, but the programming algorithm is different than in the PIC16F, so we will need to write new programming code in assembler.

 

Why not something like the PIC16F1454, that has clock recovery from USB, so it does not even needs a crystal to work?

 

I don't personally like PICs that much, mostly because the compilers are not very good (or non-free) and the architecture is really limited, I would prefer adding support for AVRs (but AVRs need one extra pin to program in low voltage mode and two extra pins in high voltage mode), or some cheap ARM 5V compatible micro like the MKE04Z8VWJ4 or the CY8C4013SXI :)

Edited by dmsc
  • Like 2
Link to comment
Share on other sites

Yes I totally agree that the PIC16F1454 is a far better choice for what has been done in the software already, and about a $1 cheaper as well (OctoPart Search).

 

Although you were able to squeeze some nice wave forms out of the 74LVC set-up, I also agree that we should just stick with the V8 transistor only circuit. So unless you see a reason not to, let's freeze the design at that version and consider it done. And since this hardware is really only usable for the PIC, I think I'll go with the name JOY2PIC instead of JOY2ICSP for the PCB. Later if you or someone else cares to take up the reins for an AVR or ARM version, we can just change the suffix to suit the new hardware.

 

If only history had gone differently, we could have had similar devices based on the 6502/65816 architecture and code base, now wouldn't that have been sweet :grin:

 

- Michael

Link to comment
Share on other sites

Here's the preliminary PCB layout based on the V8 schematic (Dimensions: 0.80" x 1.70")...

 

TOP - BOTTOM - GND PLANE

 

6S7OBIN.png

 

I still need to double check everything, but I believe this is real close to final.

 

- Michael

 

 

EDIT: The ICSP connection is the same as used on the PICKIT 2&3 programmers, so cabling and adapter boards will be interchangeable.

Edited by mytekcontrols
  • Like 4
Link to comment
Share on other sites

That looks great, but it looks to me that the ICSP connector should be soldered to the bottom of the board. is that correct?

 

Compare pinout here: http://www.sunrom.com/p/universal-device-programmer-autoelectric-tl866a

 

Edit: in other words, the standard pin 1 is on the left, and yours is on the right.

Edited by Kyle22
Link to comment
Share on other sites

Hi!,

 

That looks great, but it looks to me that the ICSP connector should be soldered to the bottom of the board. is that correct?

 

Compare pinout here: http://www.sunrom.com/p/universal-device-programmer-autoelectric-tl866a

 

Edit: in other words, the standard pin 1 is on the left, and yours is on the right.

Not really, the standard is pin 1 in the right, see:

post-18634-0-76720600-1453333491_thumb.jpg

 

I think that it is the TL866a that is inverted :)

  • Like 1
Link to comment
Share on other sites

What really matters is the little plastic tab on the connector. See it sticking out above the pins in the above pic? On the 866, it is below the pins. It only allows the cable to plug in one way, so we need to mount it correctly. Left or right makes no difference, but it needs to be clearly documented.

Link to comment
Share on other sites

Just for clarification...

 

Here's an image that shows the relationship of the pin #'s vs the pin assignments for the PICkit 2 (PICkit 3 is the same).

 

wp19aa28b4_05_06.jpg

 

 

And here is an example of an ICSP header on the target PCB (without the optional LV Programming pin 6).

 

Theremino_ICSP_Connector_MasterV4.jpg

 

 

And here is what a normal PICkit ICSP cable looks like.

ICSP%20cable1.JPG

Pin 1 being on the left or right really isn't an issue, since this is a single inline header connection and can be flipped to match. That is also why I labeled the pins with their actual function just to make it more fool proof.

 

- Michael

 

 

EDIT: although the PCB silkscreen shows a latched header, I would recommend using a non-latched version, and then just pay attention to the function labels.

 

 

And here is an example of how the D-Sub 9 joystick connector will be implemented, since there was some confusion about that earlier. I will strip down a standard solder cup version by eliminating its normal metal shell and mounting ears, and then apply a small drop of superglue to hold the two blue plastic halves together prior to soldering to the board. Essentially it gets treated like a surface mount connector.

 

CEUzFmy.jpg

Edited by mytekcontrols
  • Like 2
Link to comment
Share on other sites

Final PCB Layout (inserted missing trace, changed to a narrow un-keyed SIP header for the ICSP connection, and reduced the board length)...

 

TOP - BOTTOM - GND PLANE

 

Board Dimensions: 0.80" x 1.575"

vs0oJEE.png

Note: Silk Screen will only appear on top side of board.

 

Will be using Jameco P/N 153700 (or similar) for the ICSP SIP Header.

153700.jpg

Just about ready to send this off to OSH Park for fabrication.

 

- Michael

Edited by mytekcontrols
  • Like 2
Link to comment
Share on other sites

And here is the schematic that goes with that PCB layout, which also includes a simple B.O.M.

 

2GpNlai.png

 

I just sent the PCB file off to be gerber'ized. So by this weekend OSH Park should have it in their system. I'll post a link to the shared production file if anyone would like to have a few fabricated for their own use.

 

You know the cool thing about all this, is that this project started merely 2 months ago, and here we are already reaping the rewards. And it goes without saying that I could not have done this without Daniel's (dmsc) massive effort and creation of the application program, as well as developing much of the hardware design that I turned into a physical reality.

 

- Michael

Edited by mytekcontrols
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

hi Michael,

feel free to send me one. oshpark messed up my first prder so i wont be doing business with them again.

 

Ken

 

That's odd, I've never had any problems with OSH Park on any of my orders. Can you elaborate on what went wrong? Perhaps it was something incorrect on my link? And I hope you don't take offense, but not doing business with someone over one mistake seems a bit drastic, unless they refused to make it right.

 

Unfortunately the boards I have coming are already spoken for, plus I'll be keeping at least two for myself. However if I decide to order more, I'll keep you in mind.

 

- Michael

Link to comment
Share on other sites

you link was fine. the bourd house messed up and rotated pads.made for not to spec boards. a first order sets the tone for future orders. they did remake the boards and are sending correct ones now but my other supplier could have got them done and shipped sooner. i asked for you to send me a prommer board because the gerbers are not available, but it is a small circuit and i can replot the board easy enough.

 

Ken

Link to comment
Share on other sites

you link was fine. the bourd house messed up and rotated pads.made for not to spec boards. a first order sets the tone for future orders. they did remake the boards and are sending correct ones now but my other supplier could have got them done and shipped sooner. i asked for you to send me a prommer board because the gerbers are not available, but it is a small circuit and i can replot the board easy enough.

 

Ken

 

Interesting. I wonder how they made that kind of mistake??? Sorry to hear that things didn't go well for you, although I am surprised that you got your boards before me, since I was obviously the first to order and then post a link. If it's gerbers you wanted, all you had to do was ask. Although I was holding off on posting these files until I had tested a completed version (gerbers and design files attached).

 

- Michael

 

P.S. Just so you know, what I do within this community is as a hobbyist and not a product marketer. Primarily my creations are for my own curiosity first, and then if I think the community will benefit, the designs are released into the wild. As part of this creation process I sometimes find myself with extra boards, and these I will share with individuals that I feel added something of value to the project.

JOY-2-PIC_pcb.zip

Edited by mytekcontrols
  • Like 1
Link to comment
Share on other sites

Got my boards yesterday, and so far they look good. Although I haven't had a chance to assemble one and test it, so fingers crossed. I do see two small problems, one is my fault and that is I didn't precisely line up the pads to the D-Sub9 connector pins, but in reality this doesn't appear to be an issue. And the other problem relates to part of the silk screen image for the PN transistors failed to print (the rounded portion). This also won't be an issue, but it is strange considering that it did show up on their preview.

 

 

jYPG4zH.jpge86f62e3098f7023addf7d016ce6e5ef.png

 

 

Hopefully I'll get one of these assembled today and tested.

 

- Michael

 

EDIT: Might be the proximity to a pad that caused the silkscreen not to print. I see a similar affect on the ICSP header by pin 1.

Edited by mytekcontrols
  • Like 3
Link to comment
Share on other sites

Success! The new PCB version of the JOY2PIC programmer works :thumbsup:

 

But I did find one more error, and that was the LED silkscreen showed the 'flat' on the opposite side of where it should have been (incorrectly drawn component in the library). The image below shows it correctly installed. Also the capacitors and diodes are a bit too close together. So dependent on what type you are using it may require slightly raising one above the other to avaoid a squeeze like on my assembly. The 47NF I had laying around was very big due to the high voltage rating. A smaller capacitor with a much lower voltage rating would be preferred.

 

GDzHL6I.jpg

OfnrKEs.jpg

 

1IPrrN3.jpg

 

When testing I programmed 3 chips.

 

- Michael

  • Like 6
Link to comment
Share on other sites

I'll do some checking at Jameco and/or Digi-Key and see what parts will work best and then do up a BOM that reflects this. I also changed C1 to a 0.1uf same as C2-C5 which appears to work fine (had the same on my breadboard prototype as well, and it also worked fine). This will keep things simpler.

 

And I'll go in and make corrections on the silkscreen and the schematic, but unfortunately the silkscreen changes will not carry over to OSH Park, since I can't justify paying for another conversion to gerbers for something so trivial. Just remember to have the 'flat' side of the LED facing the ICSP header.

 

- Michael

 

P.S. Thank you Kyle :D

 

EDIT: Ohh and before I forget, make sure to glue the two plastic halves of the D-Sub-9 connector together, else the next time you go to unplug it everything will fall apart. Either superglue or maybe better yet some good 2-part expoxy. As for removing the original metal shrouding and ears, I just used tin snips to cut the ears off close to the main shroud, and then it simply pulled it apart.

Edited by mytekcontrols
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...