Jump to content

Photo

Create ICSP Programmer for Embedded Micro Controller Chips

PIC Atmel AVR Arduino Micro Controllers ICSP

177 replies to this topic

#51 mytekcontrols ONLINE  

mytekcontrols

    River Patroller

  • Topic Starter
  • 2,190 posts
  • Location:Santa Rosa, CA

Posted Fri Jan 8, 2016 1:50 PM

Hi Bob,

 

 

You might want to measure Vpp with a scope rather than a meter. Measure it while it is programming, since that is when the Vpp would be loaded.

 

Actually that is where the new SETVPP.COM program comes into play. It allows for a continuous Vpp voltage to be generated whether or not a chip is in circuit, whereas the programming app will abort without the presence of a chip. And since there is a filter cap on Vpp, a meter should still give a good indication of actual voltage level.

 

 

 

More likely the junction breaking down.

 

Good point, but the current available probably just isn't there to do any damage. As a test I placed a resistor across Vpp to GND, while measuring the Vpp voltage. So open circuit = 13.6 V, and when using 45 K as the load resistor this drops to 9 V. That looks like a pretty minuscule amount of potential current available from the voltage tripler circuit.

 

However I do appreciate your concern.

 

- Michael



#52 mytekcontrols ONLINE  

mytekcontrols

    River Patroller

  • Topic Starter
  • 2,190 posts
  • Location:Santa Rosa, CA

Posted Fri Jan 8, 2016 5:44 PM

Just thinking...

 

For actual in-circuit programming, it might be nice to be able to program the chip at a faster rate. I know that the present speed relates to overcoming the delays imposed by the capacitors on the stock joystick port. And this is the best way to go for most people, since it involves no internal modifications of the Atari. However for those that are willing to cut-out the capacitors, it would be great to have a 'turbo' mode, kinda like what is done for SIO speed-up. Could such a high speed mode be implemented down the road? It could be a toggled function maybe using the OPTION key.

 

Having this quick programming feature would be desirable when doing actual PIC firmware development, where multiple changes are being tried and those changes need to be tested quickly.

 

-------------------------------

 

And now on a separate subject. Upon looking at schematics for all the Atari series joystick ports, they all utilize 220 ohm resistors in series with the PIA I/O lines. This resistor is perfectly good for directly driving the Vdd and Vpp switching transistors. So I propose that the 1 K series resistors be eliminated. I was also thinking of putting a green LED inline with the Vdd transistor drive as an indicator that the chip is being programmed. I know some will say this is silly since the screen flashes when in this mode, but I just love blinky lights and LED's  :grin: . So here's an updated schematic which I'll call Version 5, since the last one posted by Daniel was V4. This also includes the added pull-up resistor for the PIC CLK line.

 

 

Proposed Version 5 Programmer Hardware

 

BgXIoLM.png

 

 

I have tested this already and it works fine. Of course the use of the LED is strictly optional. Connect PORTA2 directly to the 2N2907 base lead if no LED is desired.

 

 

- Michael


Edited by mytekcontrols, Fri Jan 8, 2016 5:47 PM.


#53 mytekcontrols ONLINE  

mytekcontrols

    River Patroller

  • Topic Starter
  • 2,190 posts
  • Location:Santa Rosa, CA

Posted Fri Jan 8, 2016 8:52 PM

Now that you succeeded programming a PIC16F1847, I'm confident that we can add support for more "midrange" PICs, to do that you need to edit the C source "readpic.c", adding at line 44 new lines with:
- name : the device name,
- device_id : the device id as HEX, this is from the programming datasheet.
- max_addr : the amount of program memory words in the chip.
- id_addr : the address of the "configuration memory" in the PIC, this is 0x2000 for the old PICs and 0x8000 for the "enhanced midrange" PICs
- last_addr : the last address of configuration memory.

Attached is a new version of the C program with my new test PIC added

 

Yes I'll have to try this at some point. Although to tell you the truth you've already covered all the PIC's I would likely use. I know there are 100's of variants, but the 4 chips you have supported thus far really cover a lot of possible applications very well. But it's good to know that other devices can be added fairly easy  :thumbsup:

 

- Michael



#54 _The Doctor__ ONLINE  

_The Doctor__

    River Patroller

  • 2,612 posts
  • Location:10-0-11-00:02

Posted Fri Jan 8, 2016 9:55 PM

I prefer not to tear apart and mess with the joy ports on my Atari(s) because of other things that rely on how it is and are already taking in to account whats on the ports.... I do like the reliable, possibly, slightly slower programming circuit that you have been creating. Can we make sure to keep this still working on stock unmodified Atari. I love it in it's simplest form!


Edited by _The Doctor__, Fri Jan 8, 2016 10:02 PM.


#55 dmsc ONLINE  

dmsc

    Moonsweeper

  • 275 posts
  • Location:Viņa del Mar, Chile

Posted Fri Jan 8, 2016 10:00 PM

Hi!
 

My SETVPP results:
 
No Chip (no load) = 13.55 V
w/PIC16F1847 Chip = 9.0V
 
These results really lead me to believe that the chip internally clamps the voltage (perhaps internal zener). What do you see with the PIC16F1936, 12F675, or PIC16F690?


I measured the voltages with all my PICs :-)

16F1936: 8.48V (no VDD), 8.47V (5V VDD)
16F690: 9,73V (no VDD), 9.47V (5V VDD)
12F675: 12.0V (no VDD), 11.6V (5V VDD)
 

If this is the case, then no hardware configuration such as in switching in or out zeners will be required (which would be great).


I think this is reasonable. Looking at the datasheets, the only relevant parameter is the specified "Clamp current" for out-of-range voltages in pins, this is 20mA in all the chips that I have. So, 13V/20mA = 650ohms, an output resistance in VPP of more than 650ohms should be safe. Current output resistance (in my test circuit) is about 20k, so it should be safe.

About your circuit modifications, I agree, the resistors should not be needed, specially the one in the input of the NPN transistor, as the NMOS outputs of the port don't supply a lot of current. I also simply placed a LED in series with the 2k2 pull-up resistor on the DATA pin, and I see the LED flashing on reading/writing to the PIC, try it!

And last, about quick programming, the speed is currently slower than needed, there are 3 limitations:
- Using WSYNC for delays is the easiest in the Atari, but produces delays that are bigger than actually needed.
- The PIC programming could be made faster by using the "multiple words" programming algorithm instead of the current "single word" in supported PICs. In fact, your PIC has 32 latches, so it is capable of programming 32 words at a time. This would need the parser program to write different type of scripts for each PIC model.
- The word programming delays are fixed, but different PICs have different needed delays. The parsing program could modify the delay routine to the correct amount.

So, there is still room for improvement, you (or anyone) could try modifying current programs.

#56 mytekcontrols ONLINE  

mytekcontrols

    River Patroller

  • Topic Starter
  • 2,190 posts
  • Location:Santa Rosa, CA

Posted Sat Jan 9, 2016 12:55 AM

I prefer not to tear apart and mess with the joy ports on my Atari(s) because of other things that rely on how it is and are already taking in to account whats on the ports.... I do like the reliable, possibly, slightly slower programming circuit that you have been creating. Can we make sure to keep this still working on stock unmodified Atari. I love it in it's simplest form!

 
Not to worry, I was only suggesting a possibility of an additional fast mode, not a replacement for how its working now. And I totally agree with you that being able to use an unmodified Atari is the best way to go.
 
 

I measured the voltages with all my PICs :-)

16F1936: 8.48V (no VDD), 8.47V (5V VDD)
16F690: 9,73V (no VDD), 9.47V (5V VDD)
12F675: 12.0V (no VDD), 11.6V (5V VDD)
 

I think this is reasonable. Looking at the datasheets, the only relevant parameter is the specified "Clamp current" for out-of-range voltages in pins, this is 20mA in all the chips that I have. So, 13V/20mA = 650ohms, an output resistance in VPP of more than 650ohms should be safe. Current output resistance (in my test circuit) is about 20k, so it should be safe.


I concur, no damage should be possible at such a low amount of current. I think the reason this method isn't used more often, is that many programmers were/are built with the ability to program very early chips, many of which have PROM or EPROM based program memory which requires the higher voltage, but at far greater current. As FLASH took over the scene, the external HV power was no longer needed as an actual part of the programming requirements, and is simply 'sensed' to activate the internal HV programming mode.

 

 

 

About your circuit modifications, I agree, the resistors should not be needed, specially the one in the input of the NPN transistor, as the NMOS outputs of the port don't supply a lot of current. I also simply placed a LED in series with the 2k2 pull-up resistor on the DATA pin, and I see the LED flashing on reading/writing to the PIC, try it!

 

I will definitely have to try that!

 

 

 

 

And last, about quick programming, the speed is currently slower than needed, there are 3 limitations:
- Using WSYNC for delays is the easiest in the Atari, but produces delays that are bigger than actually needed.
- The PIC programming could be made faster by using the "multiple words" programming algorithm instead of the current "single word" in supported PICs. In fact, your PIC has 32 latches, so it is capable of programming 32 words at a time. This would need the parser program to write different type of scripts for each PIC model.
- The word programming delays are fixed, but different PICs have different needed delays. The parsing program could modify the delay routine to the correct amount.

 

So, there is still room for improvement, you (or anyone) could try modifying current programs.

 

Yes you have done more than enough already, and it is greatly appreciated. The high speed suggestion was just pie in the sky thinking, and not really anything that is truly needed. But thank you for delving into how the delays have been created, and also for the explanation of how it could be sped up  ;-) .

 

 

One last thing... you mentioned earlier having to use a 4.7NF capacitor on the PIC CLK line for a particular PIC chip (I think the most recently added) to get reliable operation. Did you ever try using a pull-up resistor instead, as I have done?

 

- Michael



#57 dmsc ONLINE  

dmsc

    Moonsweeper

  • 275 posts
  • Location:Viņa del Mar, Chile

Posted Sat Jan 9, 2016 8:32 AM

Hi!
 

One last thing... you mentioned earlier having to use a 4.7NF capacitor on the PIC CLK line for a particular PIC chip (I think the most recently added) to get reliable operation. Did you ever try using a pull-up resistor instead, as I have done?


Just tried with my 16F1936, I could not get it to work with a 2k resistor, but a 1k made it work (programmed 8k reliably). So, for my combination (800XL + PIC16F1936) I need a 1k pull-up resistor or a 4.7nF capacitor to ground.

Note that my 800XL is one of the old ones, fully socketed and with the individual keyboard switches.

#58 morelenmir OFFLINE  

morelenmir

    Stargunner

  • 1,457 posts
  • Location:West Yorkshire, Great Britain

Posted Sat Jan 9, 2016 8:49 AM

My post here is off-topic and I will start a new thread to discuss it more fully.  However I wanted to ensure mytekcontrols that I had read and very much enjoyed his work here - especially as it touches directly on my allied topic.

 

So - my slightly parallel question is:  In the past I am fairly sure there was a thread, or at least couple of posts that described how to modify the 'TL866CS' so that it would work to do this same process of ICSP?  I think some versions of the 'xx866xx' device do so out of the box so it may just be a matter of soldering on a new header to an otherwise identical circuit board.

 

Again, apologies for a mostly off-topic response.



#59 Kyle22 ONLINE  

Kyle22

    River Patroller

  • 3,135 posts
  • Location:McKees Rocks (Pittsburgh), PA

Posted Sat Jan 9, 2016 9:21 AM

Here are the TL866 instructions: http://atariage.com/...s/#entry3383742

 

But, even a TL866A doesn't have the PIC16F1847 on its list.  Hopefully the next software update they make for it will add new devices.

 

Edit: It's more than simply adding the pin header, as you still need the proper firmware.  Follow the steps in the above link to replace the firmware with the TL866A version.


Edited by Kyle22, Sat Jan 9, 2016 9:23 AM.


#60 mytekcontrols ONLINE  

mytekcontrols

    River Patroller

  • Topic Starter
  • 2,190 posts
  • Location:Santa Rosa, CA

Posted Sat Jan 9, 2016 9:29 AM

Just tried with my 16F1936, I could not get it to work with a 2k resistor, but a 1k made it work (programmed 8k reliably). So, for my combination (800XL + PIC16F1936) I need a 1k pull-up resistor or a 4.7nF capacitor to ground.

Note that my 800XL is one of the old ones, fully socketed and with the individual keyboard switches.

 

I'll try this today and see if using 1K is a problem for the PIC16F1847. If it works, I'll try this same value for the other pull-ups, so as to keep it simple.

 

- Michael

 

 

 

Kyle thanks for answering morelenmer's question. I was just about to post the same link but you beat me to it.


Edited by mytekcontrols, Sat Jan 9, 2016 9:31 AM.


#61 mytekcontrols ONLINE  

mytekcontrols

    River Patroller

  • Topic Starter
  • 2,190 posts
  • Location:Santa Rosa, CA

Posted Sat Jan 9, 2016 1:28 PM

OK so I tried changing both the PIC DATA and PIC CLK pull-up resistors from 2.2K to 1K, and did not experience any problems with programming a PIC16F1847. Although when I looked up the specs for the I/O lines on a R6520 (PIA), it states that they can only sink 1.6 ma. 1K from 5 V to GND would be 5 ma. Because my shop is still in disarray, my scope is not accessible right now, but I think it would be great to get a scope on this to see how far of a swing we are getting. I suspect that the Schmitt Trigger inputs on the PIC respond better to a higher voltage ON state which probably better overcomes the delay imposed by the capacitors on the joystick lines. So even though the OFF state is also likely higher, the overall effect of the Schmitt Trigger hysteresis is able to create a proper DATA and CLK state.

 

Daniel can you run tests on the other 3 PICs to see if using 1K's for both CLK and DATA works OK?

 

So here is where the hardware is presently at...

 

 

Proposed Version 6 Programmer Hardware

 

BsnwLKy.png

 

 

I tried changing the 2N2222A pull-up to 1K as well, but this boosted the current output of the VPP causing the voltage to be nearly 11 V, which was way excessive for the PIC16F1847 chip. So it looks like 2.2K is our best option for now.

 

 

Daniel I also tried your suggestion of placing the LED inline with the PIC DATA pull-up, but noticed it tended to remain dimly lit when a PIC was present while not being programmed. Personally I like it better as I have shown above, but that's just me  ;) .

 

- Michael


Edited by mytekcontrols, Sat Jan 9, 2016 1:30 PM.


#62 ricortes OFFLINE  

ricortes

    Dragonstomper

  • 606 posts

Posted Sat Jan 9, 2016 3:16 PM

A thought occurred to me but it died of loneliness. :)

 

I don't always like it when people distract me so please ignore me if I am off base here. Just musing more then anything else.

 

IIRC: The Paddle ports are a time to charge resistor/capacitor circuit that has the charge dumped by a transistor 60x a second<NTSC> during the VBI. I'm guessing that this would/could produce a 60 hz signal on the pin which could be used as the signal for the charge pump to make programming a little easier and free up an I/O pin of the 6520. Something like a 10k resistor to 5V to the base of the transistor which is also tied to a Paddle input. Further or additionally, if you want to go for cute and foolproof, you could use the second paddle with a suitable resistor network to test for voltage output of the charge pump.

 

To keep it simple, couldn't you use a 2907 in the charge pump too vs. a 2n2222? Cuts down on parts list and I have a fondness for NPN transistors!



#63 mytekcontrols ONLINE  

mytekcontrols

    River Patroller

  • Topic Starter
  • 2,190 posts
  • Location:Santa Rosa, CA

Posted Sat Jan 9, 2016 5:13 PM

A thought occurred to me but it died of loneliness. :)

 

I don't always like it when people distract me so please ignore me if I am off base here. Just musing more then anything else.

 

IIRC: The Paddle ports are a time to charge resistor/capacitor circuit that has the charge dumped by a transistor 60x a second<NTSC> during the VBI. I'm guessing that this would/could produce a 60 hz signal on the pin which could be used as the signal for the charge pump to make programming a little easier and free up an I/O pin of the 6520. Something like a 10k resistor to 5V to the base of the transistor which is also tied to a Paddle input. Further or additionally, if you want to go for cute and foolproof, you could use the second paddle with a suitable resistor network to test for voltage output of the charge pump.

 

To keep it simple, couldn't you use a 2907 in the charge pump too vs. a 2n2222? Cuts down on parts list and I have a fondness for NPN transistors!

 

Great stuff  :thumbsup:  I'm not sure if the paddle charging circuit would work or not (I could sure use that scope right now), but it certainly is a creative approach. However I did test out your idea of going with another 2N2907 which is actually a PNP, in place of the 2N2222. It worked right out of the box with no software changes required and as you said simplifies the parts list. I also decided to go with Daniel's LED placement on the PIC CLK line after letting it grow on me for awhile. So here is where we are at now...

 

 

Proposed Version 7 Programmer Hardware

 

Ffhve7s.png

 

 

 

Thanks for the suggestions.

 

- Michael



#64 Kyle22 ONLINE  

Kyle22

    River Patroller

  • 3,135 posts
  • Location:McKees Rocks (Pittsburgh), PA

Posted Sat Jan 9, 2016 7:50 PM

It looks like your LED is on the DATA line.



#65 mytekcontrols ONLINE  

mytekcontrols

    River Patroller

  • Topic Starter
  • 2,190 posts
  • Location:Santa Rosa, CA

Posted Sat Jan 9, 2016 8:34 PM

It looks like your LED is on the DATA line.

 

Opps that is what I meant to say (and now it's too late to edit that entry). Anyway suffice it to say that the schematic is correct. Thanks for catching that.

 

- Michael



#66 ricortes OFFLINE  

ricortes

    Dragonstomper

  • 606 posts

Posted Sun Jan 10, 2016 11:02 AM

 

Great stuff  :thumbsup:  I'm not sure if the paddle charging circuit would work or not (I could sure use that scope right now), but it certainly is a creative approach. However I did test out your idea of going with another 2N2907 which is actually a PNP, in place of the 2N2222. It worked right out of the box with no software changes required and as you said simplifies the parts list. I also decided to go with Daniel's LED placement on the PIC CLK line after letting it grow on me for awhile. So here is where we are at now...

 

 

DOH! Chalk it up to a senior moment. Thanks for the correction on the transistor. I wouldn't want that glaring of a mistake to be left uncorrected.

 

Great work. I really like the way you guys have cornered the problems to get clean signals and the "keep it simple" design. 



#67 mytekcontrols ONLINE  

mytekcontrols

    River Patroller

  • Topic Starter
  • 2,190 posts
  • Location:Santa Rosa, CA

Posted Sun Jan 10, 2016 12:10 PM

DOH! Chalk it up to a senior moment. Thanks for the correction on the transistor. I wouldn't want that glaring of a mistake to be left uncorrected.

 

Great work. I really like the way you guys have cornered the problems to get clean signals and the "keep it simple" design. 

 

Actually most of this can be contributed to Daniel's (dmsc) efforts. I simply presented the idea, but he's the one that grabbed a hold of it and really made it happen (and in a relatively short time). My Atari coding skills were no where near good enough to pull something like this off (I've been away for far too long, and have gotten very rusty). But at least I can help keep the project going in my small way, by tweaking the hardware and ultimately transitioning it from bread board to PCB.

 

I've been thinking more about the ideas you presented, and I like the voltage feedback aspect of using one paddle input, but I suspect that the idea of using the other paddle for the charge pump might not buy us anything since we need a way to turn VPP on and off. So unless we can deactivate it via some register in Pokey, we would still need a control bit. Although I'm talking off the top of my head, since I haven't checked the Pokey specification to know either way.

 

Our 'low current' approach to applying the VPP does seem to work well, and solves the problem of having to have a variable voltage for different devices. But this 'feature' was accidental  :grin:  (many discoveries are made in this way).

 

So now that we have a way to program PIC's what's next? Hmmm... Maybe a PIC macro assembler that'll also run on the A8??? This is probably just a pipe dream, since there are some very powerful and free PIC programming tools already available to run on the MAC, PC, and Linux. But you can't stop a guy from dreaming  ;) . However if it were to ever happen, I would vote for an 8051 style cross assembler (similar to Parallax's CVASM developed years ago and was taken over by TechTools), instead of having to work with the limited RISC instruction set. Or better yet, maybe something that acts more like Basic, but compiles to PIC code.

 

- Michael



#68 MacRorie OFFLINE  

MacRorie

    Dragonstomper

  • 726 posts
  • No matter where you go, there you are.
  • Location:NorCal!

Posted Sun Jan 10, 2016 9:05 PM

This looks great!  When do we get to see the PCB and BOM?  BTW, thanks to you, Michael, I now have an XEGS in my room and a stack of components to build about 3-4 models of your keyboard adaptors!  Now, I just need the time!  I might as well add this to the list!



#69 mytekcontrols ONLINE  

mytekcontrols

    River Patroller

  • Topic Starter
  • 2,190 posts
  • Location:Santa Rosa, CA

Posted Sun Jan 10, 2016 10:33 PM

This looks great!  When do we get to see the PCB and BOM?  BTW, thanks to you, Michael, I now have an XEGS in my room and a stack of components to build about 3-4 models of your keyboard adaptors!  Now, I just need the time!  I might as well add this to the list!

 
No official BOM yet, but you can pretty much see what would be required in the latest schematic diagram. And keeping in mind that it'll have an ICSP header for connection, factor in a 6 pin (0.1" pitch) SIP male header as well. Speaking of keyboard adapters, I've programmed the last half dozen PIC's for the TK-II's using this programmer. Works great!
 
PIC-ICSP-2.jpg
 
Note: example shows a 'latched' SIP header, I will likely layout the board using a non-latched version.
 
 
As far as connection of the ICSP to a chip, this can be handled in various ways. One would be to simply use a small protoboard with another similar connector and flat cable, make the 5 required connections (PIN 6 not used), and just pop a chip into the protoboard, or buy one of those premade adapters off of Ebay that I referenced earlier.
 
ICSP%20cable1.JPG

On yeah almost forgot, order one D-Sub 9 female solder cup style connector for the joystick connection. This will get modified (details to come) so that it can fit the 1200XL or XEGS recessed ports. Basically the board will slide in between the two rows of pins, and be soldered top and bottom.
 
- Michael
 
EDIT: I haven't even started the PCB layout yet, kinda waiting to be sure the design is locked in first.

Edited by mytekcontrols, Sun Jan 10, 2016 10:57 PM.


#70 David_P OFFLINE  

David_P

    Dragonstomper

  • 832 posts
  • Location:Canada

Posted Mon Jan 11, 2016 10:09 AM

Why not use a D9 female on the board, and connect with a joystick extension cable?

Sent from my SM-G530W using Tapatalk

#71 mytekcontrols ONLINE  

mytekcontrols

    River Patroller

  • Topic Starter
  • 2,190 posts
  • Location:Santa Rosa, CA

Posted Mon Jan 11, 2016 4:32 PM

Why not use a D9 female on the board, and connect with a joystick extension cable?

Sent from my SM-G530W using Tapatalk

 

My description probably didn't describe what I meant very well so here is example of what I was talking about. The PCB has been slid in-between the two rows of pins on that D-Sub 9 connector in the photo. 

image2.jpg

 

 

Essentially I would be using this same method for the JOY2ICSP board that I am proposing to build. The only difference is that I either need to cut-off the mounting ears or bend them back, so that it would also work for an 1200XL or XEGS. Actually the more I think about it, the bending the ears back sounds more feasible, and could be done only when required (not a necessity for 400, 800, 600XL, 800XL). And although the situation looks better on a 65 or 130XE, I would have to see one in the flesh to be sure.

 

- Michael


Edited by mytekcontrols, Mon Jan 11, 2016 4:34 PM.


#72 Van OFFLINE  

Van

    Moonsweeper

  • 285 posts
  • Location:Maryland

Posted Mon Jan 11, 2016 5:20 PM

Why not use a D9 female on the board, and connect with a joystick extension cable?

Sent from my SM-G530W using Tapatalk

Would need to keep the length as short as possible to minimize noise and voltage drop across it. Guessing not longer then 12"; and Joy extension cables are usually 4' to 6'. Could cut a short length with the female end and direct wire it to the board but all this would add extra expense if the board can be fitted with just a connector also. 

Yogi



#73 bob1200xl OFFLINE  

bob1200xl

    River Patroller

  • 2,485 posts

Posted Mon Jan 11, 2016 5:45 PM

I usually just remove the whole metal cover. Yes - the PCB fits nice and tight between the pins of the connector.

 

What IC is that?

 

Bob



#74 mytekcontrols ONLINE  

mytekcontrols

    River Patroller

  • Topic Starter
  • 2,190 posts
  • Location:Santa Rosa, CA

Posted Mon Jan 11, 2016 6:37 PM

Would need to keep the length as short as possible to minimize noise and voltage drop across it. Guessing not longer then 12"; and Joy extension cables are usually 4' to 6'. Could cut a short length with the female end and direct wire it to the board but all this would add extra expense if the board can be fitted with just a connector also. 

Yogi

 

I like to keep things simple. One of the things I have always hated with a passion is making wire harnesses and/or soldering them to a PCB. So whenever possible I try to either eliminate cables or utilize something off the shelf unmodified. So keeping that in mind, the photo was only an example of how the D-Sub 9 connector would be implemented, imagine on the opposite end will be the 6-pin SIP header. Connected to this header would be an off-the-shelf flat ICSP cable (one side to the JOY2ICSP board, and the other side to the ICSP adapter board).

 

 

I usually just remove the whole metal cover. Yes - the PCB fits nice and tight between the pins of the connector.

 

What IC is that?

 

Bob

 

I'll have to test that idea out (got some connectors at work I can dissect).

 

Not sure what IC that is in the picture. I borrowed the photo from the PeST (PS2-to-ST Mouse adapter) website, since it represented what I was thinking about connector wise. Most likely my board will need to be just slightly wider and a tiny bit longer.

 

- Michael


Edited by mytekcontrols, Mon Jan 11, 2016 6:38 PM.


#75 dmsc ONLINE  

dmsc

    Moonsweeper

  • 275 posts
  • Location:Viņa del Mar, Chile

Posted Tue Jan 12, 2016 6:53 PM

Daniel can you run tests on the other 3 PICs to see if using 1K's for both CLK and DATA works OK?


I finally run many tests with different combinations of pull-up resistors, sadly could not find one that worked with all my PICs. I used your last circuit version, with two 2n2907 transistors.

TL/DR: it is really difficult to do a simple circuit that can program any of my PICs reliably, the best circuit varies between PIC models.

Now, my measurements. You can see at the bottom of each screenshot 4 values:
- Cyan Max: maximum voltage in CLOCK line, this is the voltage of the "HI" state of clock.
- Cyan Min: minimum voltage in CLOCK line, this is the voltage of the "LOW" state of clock.
- Yellow Base: base voltage of the DATA line, this is the voltage of the LOW state of Atari (DATA as output)
- Yellow Min: minimum voltage of the DATA line, this is the voltage of the LOW state of PIC (DATA as input), only valid if there is actually data from the PIC.

------

This is a PIC16F690, with 2k2 resitors in DATA and CLOCK, works OK:
DS1Z_QuickPrint22.png DS1Z_QuickPrint23.png

PIC16F690, without pull-up resistors, works OK, but signals are less clean than before:
DS1Z_QuickPrint18.png

PIC16F690, with 1k resistor in DATA, 2k2 resitor in CLOCK, does not work (bad reply from PIC):
DS1Z_QuickPrint21.png

PIC16F690, with 1k resitors in DATA and CLOCK, PIC does not acknowledges data:
DS1Z_QuickPrint19.png

PIC16F690, with 1k resitor in DATA, 4.7nF capacitor in CLOCK, PIC does not acknowledges data:
DS1Z_QuickPrint20.png

----

This is a PIC16F1936, with no resistors, does not work:
DS1Z_QuickPrint24.png

PIC16F1936, 2k2 resistors in DATA and CLOCK, works, but not reliable:
DS1Z_QuickPrint25.png

PIC16F1936, 1k resistors in DATA and CLOCK, works, but not reliable:
DS1Z_QuickPrint26.png

PIC16F1936, 1k resistors in DATA and CLOCK, plus red LED in DATA, works, but not reliable:
DS1Z_QuickPrint28.png

PIC16F1936, 2k2 resistor in DATA, 4.7nF capacitor in CLOCK, plus red LED in DATA, works OK, note that the data from the PIC is delayed because clock transitions happens later in the clock cycle (see the zoom-in):
DS1Z_QuickPrint29.png DS1Z_QuickPrint30.png

As my program reads data from PIC after the falling clock line, and the PIC also reads the data in the falling clock edge, the delay should not affect the reading, but gives more time to the DATA signal to stabilize... perhaps this is the main difference.

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:
DS1Z_QuickPrint33.png

As you see in this zoom-in, now the clock signal is symmetric, unlike the data line that shows the typical output from a NMOS transistor:
DS1Z_QuickPrint35.png

At last, I measured the transition voltages detected by the PIC16F1936 and PIC16F690 by measuring the clock voltage when the data line from the PIC transitioned, shown bellow:
DS1Z_QuickPrint36.png DS1Z_QuickPrint37.png

The result is that the threshold voltage is 2.32V in my PIC16F1936 and 2.8V in the PIC16F690, this explains why the same resistors don't work in both PIC.


My recommendations: if you want a simple programmer adapted to your own Atari/PIC combination, simply test resistors from 1k to 4k7 until it works. If you want to design a reliable programmer that works in any Atari/PIC, you should use an 74HCT14 as buffer to the CLOCK line, to translate the "TTL-like" signals from the Atari to CMOS inputs in the PIC.

If you think of any other combination to test, say so :)





Also tagged with one or more of these keywords: PIC, Atmel, AVR, Arduino, Micro Controllers, ICSP

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users