Jump to content
IGNORED

Create ICSP Programmer for Embedded Micro Controller Chips


mytek

Recommended Posts

Good to hear it worked :)

 

If you are a GIT user, you can do a pull-request to my repo at https://github.com/dmsc/atari-picprogwith the modified readhex.c, so the changes are added with proper attribution.

 

Thanks!

 

I've never worked with GIT, and am not a registered user of it. Is this something that is easily done?

 

- Michael

Link to comment
Share on other sites

Hi!

 

I've never worked with GIT, and am not a registered user of it. Is this something that is easily done?

 

- Michael

Well, it's not difficult, and you don't need a github account, but you probably need to be confortable with using a version control system first...

 

Basically, from the command line, (with GIT installed) you can do:

 

 # Setup git
 git config --global user.name "My Full Name"
 git config --global user.email name@example.com

 # Clone the repository
 git clone https://github.com/dmsc/atari-picprog.git

 # Edit, build, etc...
 cd atari-picprog
 gedit readhex.c
 make

 # Now, you are happy and want to commit... first, see the changes with diff:
 git diff

 # And now commit, specifying which files to commit:
 git commit readhex.c

 # You can repeat the edit, compile, commit cycle for each functional change that you want to do.
 # When you are ready, you can format the changes as patch-files:
 git format-patch origin

 # This will write in the same folder one file for each commit, named "0001-my-message.patch", etc.
 # You simply send that files by email.
There are IDEs with git support that make all those steps for you.

 

Using github instead the process can be streamlined a little, the web interface is really good.

- You need to sign-up using the "Join GitHub for free" link first.

- Then, you can fork the repository, so you have your own copy. This copy is yours, you can edit, commit to, etc.

- And next, you can create "pull-requests", those can be commented via a blog-like interface, edited and accepted or rejected.

 

Well, I can simply grab your changes and include them in the sources if you want :) .

Edited by dmsc
Link to comment
Share on other sites

Hi!

 

 

Well, it's not difficult, and you don't need a github account, but you probably need to be confortable with using a version control system first...

 

Basically, from the command line, (with GIT installed) you can do:

 

 # Setup git
 git config --global user.name "My Full Name"
 git config --global user.email name@example.com

 # Clone the repository
 git clone https://github.com/dmsc/atari-picprog.git

 # Edit, build, etc...
 cd atari-picprog
 gedit readhex.c
 make

 # Now, you are happy and want to commit... first, see the changes with diff:
 git diff

 # And now commit, specifying which files to commit:
 git commit readhex.c

 # You can repeat the edit, compile, commit cycle for each functional change that you want to do.
 # When you are ready, you can format the changes as patch-files:
 git format-patch origin

 # This will write in the same folder one file for each commit, named "0001-my-message.patch", etc.
 # You simply send that files by email.
There are IDEs with git support that make all those steps for you.

 

Using github instead the process can be streamlined a little, the web interface is really good.

- You need to sign-up using the "Join GitHub for free" link first.

- Then, you can fork the repository, so you have your own copy. This copy is yours, you can edit, commit to, etc.

- And next, you can create "pull-requests", those can be commented via a blog-like interface, edited and accepted or rejected.

 

Well, I can simply grab your changes and include them in the sources if you want :) .

 

 

Daniel thanks for the detailed explanation :thumbsup: Let me try to do it on my own first.

 

So far I have registered as a new user. Next I'll review the 'hello world' tutorial. Then I'll try to fork the repository as you suggested and make the changes.

 

It'll be good for me to know what's involved, and how to do it :)

 

- Michael

Link to comment
Share on other sites

  • 2 weeks later...

 

Daniel thanks for the detailed explanation :thumbsup: Let me try to do it on my own first.

 

So far I have registered as a new user. Next I'll review the 'hello world' tutorial. Then I'll try to fork the repository as you suggested and make the changes.

 

It'll be good for me to know what's involved, and how to do it :)

 

- Michael

 

Daniel,

 

Me bad :( I still haven't done this, but in my defense I have been pretty busy lately. In the meantime, I have expanded the number of PIC devices up to 11, including all three of the USB enabled devices that we talked about a while back (new C code: readhex_modified_11-18-2016.zip).

 

And I have finally created a JOY2PIC page on my site which has the latest and greatest stuff, including an order button for the PCB.

 

JOY2PIC webpage Link: ataribits.weebly.com/joy2pic.html

 

Maybe it's best until I get up to speed, to let you add the new source into your github page.

 

Thanks :)

 

- Michael

Edited by mytekcontrols
Link to comment
Share on other sites

There was a problem with that last readhex.c update. It appears that anything over 9 PIC device entries creates issues. So I removed 2 of my previous entries and now everything appears to be working properly.

Here is the new readhex.c source and readhex.com versions (readhex.com has been updated in picprog.atr): readhex_modified_11-21-2016.zip

The picprog app has also been updated on my website.

- Michael

Edited by mytekcontrols
Link to comment
Share on other sites

Hi!

 

There was a problem with that last readhex.c update. It appears that anything over 9 PIC device entries creates issues. So I removed 2 of my previous entries and now everything appears to be working properly.

 

Here is the new readhex.c source and readhex.com versions (readhex.com has been updated in picprog.atr): attachicon.gifreadhex_modified_11-21-2016.zip

 

The picprog app has also been updated on my website.

Thanks fo your contributions. I merged your changes to my sources over github, and fixed the problem with more than 9 entries in the table. You can download the result at https://github.com/dmsc/atari-picprog

 

Note that my sources include a make-file to compile all the sources and generate the "picprog.atr" disk image.

 

Please, if you can test the attached version picprog.atr, I can make a release over github including the compiled program.

  • Like 1
Link to comment
Share on other sites

Hi!

 

 

Thanks fo your contributions. I merged your changes to my sources over github, and fixed the problem with more than 9 entries in the table. You can download the result at https://github.com/dmsc/atari-picprog

 

Note that my sources include a make-file to compile all the sources and generate the "picprog.atr" disk image.

 

Please, if you can test the attached version attachicon.gifpicprog.atr, I can make a release over github including the compiled program.

 

Hi Daniel,

 

I'm away from any Atari's at the moment, but I'll be sure to test this out tomorrow and report back to you. Thank you for doing the update :)

 

When everything looks OK I'll also replace the copy at: ataribits.weebly.com/joy2pic.html

 

- Michael

Link to comment
Share on other sites

Hi!

 

 

Thanks fo your contributions. I merged your changes to my sources over github, and fixed the problem with more than 9 entries in the table. You can download the result at https://github.com/dmsc/atari-picprog

 

Note that my sources include a make-file to compile all the sources and generate the "picprog.atr" disk image.

 

Please, if you can test the attached version attachicon.gifpicprog.atr, I can make a release over github including the compiled program.

 

TESTED GOOD :-D

 

Updated on AtariBits site.

 

Thank you Daniel :)

 

- Michael

  • Like 1
Link to comment
Share on other sites

Ok, I made a release (v1.0), you can download the sources and generated ATR at https://github.com/dmsc/atari-picprog/releases/

 

And thank you also for all the testing!

 

Sounds good :) I updated my website with a button that accesses that link you just gave. Nice to have everything on a single page (OSH Park order button, Schematics, PCB files, and Programming app).

 

Those PICs should pretty much cover a fairly good spread of applications, so it is unlikely that another update will be required anytime soon.

 

Thanks a bunch for all your work!

 

- Michael

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
mytekcontrols, on 23 Nov 2016 - 10:52 PM, said:

 

Sounds good :) I updated my website with a button that accesses that link you just gave. Nice to have everything on a single page (OSH Park order button, Schematics, PCB files, and Programming app).

 

Those PICs should pretty much cover a fairly good spread of applications, so it is unlikely that another update will be required anytime soon.

 

Thanks a bunch for all your work!

 

- Michael

 

 

As far as the other tested PICs that required a different resistance, why not throw-in all the required resistances, in smd form, feeding into a DIP switch with all outputs going to the same place? Then you just select the switch connected to the resistance you need, and it would probably only need another 1cm in pcb length.

Link to comment
Share on other sites

As far as the other tested PICs that required a different resistance, why not throw-in all the required resistances, in smd form, feeding into a DIP switch with all outputs going to the same place? Then you just select the switch connected to the resistance you need, and it would probably only need another 1cm in pcb length.

 

I'm not sure if I'm following exactly what you mean. If you are referring to programming (VPP) voltages, we have that pretty well taken care of by using a very low current supply that kind of self regulates by the individual PIC's internally clamping. The current is low enough not to do any damage, but the voltage is high enough to trigger the PIC's programming mode, assuming it's a Flash device and not the older UV erase EPROM type devices.

 

- Michael

Link to comment
Share on other sites

DMSC said:

 

mytekcontrols, on 13 Jan 2016 - 7:09 PM, said:snapback.png

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.p

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.p post-18634-0-41168600-1452740227_thumb.p

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."

 

The DIP with different resistors would go on the CLK line for more compatibility.

Link to comment
Share on other sites

Hi Blake,

 

Yeah so far the existing solution seems to work well, and the number of PICs that can be programmed has increased. More can be added, but you get to a point where you have to ask yourself why? Unless you just need something that either the other PICs don't have, or you just happen to have an unsupported one that you like and you want to be able to use this programming solution. For most all of my development work I use a PICkit3, but once I have a finalized a version of code, then I transition it over to what the JOY2PIC can use. This makes it very easy for the DIY person that wishes to duplicate a project that requires a PIC chip.

 

And to more fully answer your questions, the limitations are not with the hardware, or for that matter the software. It's really more about adding additional devices which is actually relatively simple.

 

- Michael

Edited by mytekcontrols
Link to comment
Share on other sites

mytekcontrols, on 21 Jan 2017 - 11:17 PM, said:

Hi Blake,

 

Yeah so far the existing solution seems to work well, and the number of PICs that can be programmed has increased. More can be added, but you get to a point where you have to ask yourself why? Unless you just need something that either the other PICs don't have, or you just happen to have an unsupported one that you like and you want to be able to use this programming solution. For most all of my development work I use a PICkit3, but once I have a finalized a version of code, then I transition it over to what the JOY2PIC can use. This makes it very easy for the DIY person that wishes to duplicate a project that requires a PIC chip.

 

- Michael

 

I can't argue with that. I was only thinking of a compromise on compatibility, that seemed desireable at the begining of the project, I didn't know that the amount of chips that would be left out was so small, my apologies.

 

You guys have really done a great job making this happen though. It really shows the versatility of the early home computers. :thumbsup: :thumbsup:

Link to comment
Share on other sites

Thank you Blake.

 

The only thing that I would like to see in the future, would be an additional software program that would allow you to select a chip from a menu, let you load a hex file from a directory, and then by selecting GO or BURN directly re-flash the PIC chip. This would be good for firmware development. Because the existing software takes time to setup and create a unique flashing program for every iteration of firmware. For firmware distribution it's perfect, and I wouldn't change a thing. But for development, it's too much to go through each and every time.

 

- Michael

  • Like 1
Link to comment
Share on other sites

If I understand what you're saying. Essentially, you want to have a GUI that will select the proper pre-built program that the user would select based on their PIC. A "HyperSpin" for your (PIC) "rom collection" so to speak. Could probably do it using RespeQt/AspeQt by mounting a folder image to one of the empty drives, and have a separate small menu-based program, that is just there to eliminate several steps, and automate a few processes. The program would load the correct build without having to build it, so that you could do PIC flashing at the drop of a hat, and with little effort, you just drop in the chip, and then 2 clicks later, the chip is being programmed, or reprogrammed?

  • Like 1
Link to comment
Share on other sites

If I understand what you're saying. Essentially, you want to have a GUI that will select the proper pre-built program that the user would select based on their PIC. A "HyperSpin" for your (PIC) "rom collection" so to speak. Could probably do it using RespeQt/AspeQt by mounting a folder image to one of the empty drives, and have a separate small menu-based program, that is just there to eliminate several steps, and automate a few processes. The program would load the correct build without having to build it, so that you could do PIC flashing at the drop of a hat, and with little effort, you just drop in the chip, and then 2 clicks later, the chip is being programmed, or reprogrammed?

 

No doesn't necessarily need to be a GUI application, but yes to what you said in the last sentence. I'm not sure if you are familiar with the MPLAB IPE program, but essentially do what it does, which is to allow a selection of firmware.hex files via a file select box, allow a choice of PIC chip you wish to flash via a drop-down menu, and then a 'Program' button to actually flash the chip. This doesn't necessarily require a GUI to do these things, and can be accomplished via keyboard commands and arrow keys. But the end result is the same.

 

And just to be clear this 'new' program would not supplant what we have now, since that application creates a nicely packaged flash file which is great for distributing specific firmware.

 

- Michael

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

  • 9 months later...

NEW Version OF JOY2PIC is Coming

 

Because not every situation allows for an In Circuit Serial Programming (ICSP) port, which is especially true for the recently released 1088XEL, a new JOY2PIC Programmer was developed that allows 8 and 18 pin devices to be programmed on your A8 via the joystick port without the need for a separate cable or chip adapter board. It is called JOY2PIC-STIK, and will come with a built-in 18 pin ZIF socket, as well as the usual ICSP header. And even though the ZIF socket is limited to 8 or 18 pin devices, on the plus side it doesn't require any jumpers to be reconfigured when changing between the two chip sizes.

 

In all of my A8 upgrades, I have decided to stick with these two sizes of PIC chips (there are 3 PIC chips in the 1088XEL - one 8-pin, and two 18-pin devices). Which means that this new programmer will re-flash any chip that I currently use. However in the event that I change to another chip type in a future upgrade, then there is always the ICSP port to fall back on, and/or the use of a more sophisticated jumper configurable adapter board.

 

 

post-42561-0-94471200-1509148436_thumb.pngpost-42561-0-08716800-1509148451_thumb.pngpost-42561-0-41551200-1509148460_thumb.png

(Ground Plane Not Shown)

Note: the ICSP header is a right angle type that will need to be mounted on the bottom side of the board in order to provide clearance for the ZIF socket release lever. Or it can be left out if you never intend to do ICSP applications.

 

ZIF (Zero Insertion Force) Socket

post-42561-0-04829500-1509152547.jpg

 

Schematic

post-42561-0-33975800-1509152187_thumb.png

Download Schematic PDF: JOY2PIC-STIK_schema.pdf

 

I've bread boarded a prototype, and thus far all looks good when testing on various chips and code. I placed a test order with OSHpark today, but it'll be nearly 2 weeks before I can build and test the PCB layout in reality. But since the main JOY2PIC circuit is well proven I have decided to release the design today.

 

Download Gerber Manufacturing Files: JOY2PIC-STIK.zip

- OR -

CLICK HERE to order 3 bare boards from OSHpark at $15.65 ($5.22 each)

THIS IS STILL AN UNTESTED PCB LAYOUT, SO ORDER AT YOUR OWN RISK

 

- Michael

  • Like 4
Link to comment
Share on other sites

  • 3 weeks later...

It's done, tested, and can be gotten HERE. Also check out using this to program chips for the 1088XEL posted HERE.

 

post-42561-0-35704800-1510639586.png

This is now at version 1.1 due to the holes being too small for the ZIF chip in the beta build. Sorry if anyone already bought some of those, but I did warn you that it was risky due to the untested nature of the first version. A fix for that problem is to file down the ZIF socket's rectangular pins, making them square instead. This is what I had to do on the first ones I ordered as well. The problem has now been corrected, so no more filing necessary :) .

 

Also be sure to stop by the AtariBits website to get the latest version schematic as well, which incorporates the BOM. There was a change on one of the required components.

 

- Michael

  • Like 7
Link to comment
Share on other sites

Thx Michael. I've ordered my boards and components.

 

Sounds good. I've also got some on order as well so that I don't have to do anymore filing ;) .

 

Any problems finding the 18 pin ZIF? This was the best deal I found: https://www.ebay.com/itm/18-Pin-Universal-ZIF-DIP-Tester-IC-Test-Socket-CA-NEW-CA/141975824728?hash=item210e6b2958:g:M0oAAOxyVtxSLwDb

 

- Michael

Link to comment
Share on other sites

Thx Michael. I had an eBay seller refund me for reason he ran out of stock on the 18 pin ZIF. I used your suggested ebayer. Canada is closer than Hong Kong!

Mike

I'm afraid it still comes from China, but hopefully they still have plenty of them in stock.

 

- Michael

Link to comment
Share on other sites

Wow.....I just read each and every post in this thread. Not saying I understood everything 100% but....this is just awesome. Love the collaboration and adding some ideas from others.

 

Some things crossed my mind:

 

1) Probably not necessary anymore, but aren't the RC's in the joystick lines meant for debouncing the joystick switch contacts ? Or is this done inside POKEY ? If the RC's are for debouncing, cutting them out would probably cause problems when playing games with a joystick.

 

2) About creating the gerbers (and costing money ??) by/at OSHpark: I use Eagle CAD and this creates the gerbers for me....free....I sent those to www.elecrow.com and get nice PCBs back :)

 

I'm not encouraging anyone who had already worked with another electronics CAD program to switch to Eagle though....it's not an intuitive program and I have had to learn a lot from Youtube and other websites and you can "feel" that it's origins are WAYYYYYY back in time, but for now this works for me....I've now learned to work around/live with it's issues....but I'm sure there are easier/better programs. I like the Autorouter in Eagle though...it's pretty damn good....and yes I know everyone says you should hand-route...but I just can't commit the time with a pretty complicated 2 layer board....AND I get working boards with it so.....who cares. It's like the fable that you MUST NEVER use 90 degree angles in any circuit traces. Just for fun: have a good look at the 1050 PCB. It's full of them....and that board has proven itself over time IMHO.....

3) Those ZIF sockets......I remember back in the 80's they cost an arm and a leg.....and actually, the REAL ones still do....of course all these "Textool" and "3M" ones from China are fake as can be but even so I discovered quality varies between these. I recently bought 2 ZIF 40 pin sockets (because they were so cheap, and I needed one as fast as possible with shipping from China).

One was a "3M" ( https://nl.aliexpress.com/item/Narrow-Body-Gold-UNIVERSAL-Zif-Test-DIP-IC-40-Pin-3M-Socket/32670080551.html?spm=a2g0z.10010108.1000016.1.2a96619d5GQVo1&isOrigTitle=true )

 

It arrived earliest but the stupid seller had NO protection for the pins installed, so it arrived with all of them COMPLETELY bent....It rendered the unit useless, bending back all the pins didn't cut it....

The other was a "Textool" which arrived a bit later but DID have proper protection for the pins. Also: the construction of that one seems a bit better. The handle doesn't feel as "loose" as the "3M" one...

 

https://nl.aliexpress.com/item/Multifunction-Universal-40P-40-pin-ZIF-DIP-IC-PIN-Test-Tester-on-board-socket-Lake-Blue/32807139358.html?spm=a2g0z.10010108.1000016.1.73188251m8SnrS&isOrigTitle=true

 

This is the cheapest Textool 18 pin I can find....there are cheaper "3M"s....but I'd go for the "Textool"....
https://nl.aliexpress.com/item/1pcs-Test-IC-DIP-ZIF-ZIP-Socket-18-Pin-Pitch-2-54-mm-Press-Fit-Dual/32833031663.html?spm=a2g0z.10010108.1000016.1.4db0f7a463c4G&isOrigTitle=true

Edited by Level42
  • Like 2
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...