Welcome! Log In Create A New Profile

Advanced

PowerComms + Programmer

Posted by ZachHoeken 
PowerComms + Programmer
June 08, 2007 04:11PM
I started this thread for discussion on the proposed addition of a PIC programmer to the PowerComms board.

Here is my suggestion for the process:

1. create the circuit diagram based on current design, and post it here for review. preferably in kicad, although just for discussion, a napkin drawing would probably work too.

2. create a breadboard / tester board. does it still function as a powercomms board? does it work as a programmer?

3. if so, do an order of test boards, distribute to developers to test. do they work?

4. if so, send it to production as v1.3 of the powercomms board.
Re: PowerComms + Programmer
June 09, 2007 09:07AM
I'd wonder what the utility of integrating a PIC programmer into the comms board would be. The cost of a good kit to do PIC programming is about zip these days. Take a look a this little jewel that I unearthed while looking for something entirely different.

[www.virtualvillage.com]

This damned thing even has a ZIF socket and plugs into your USB port instead of your serial. I can tell you that if you're doing PIC development not having to crawl under your PC table and swap Cannon connectors on your PC's serial port every time you want to reprogram a PIC chip is a real blessing.
Re: PowerComms + Programmer
June 09, 2007 04:51PM
well, let me list them:

1. you get a PIC programmer practically for free.
2. you dont have to switch cables... your reprap machine is already plugged in.
3. no need to buy a separate board
4. it will be more reliable as it will have an external power supply (JDM is notorious for being unreliable b/c it relies on serial port power)
Re: PowerComms + Programmer
June 09, 2007 05:18PM
Price a ZIF socket and then look at the cost of that virtual village programmer. You can't get a ZIF socket by itself for double the price of that board. You need a ZIF if you want to program a PIC more than a few times. Prying PIC's out with a small screwdriver or a bamboo wedge, which was what I used to do stresses the legs and eventually causes them to fail.
Re: PowerComms + Programmer
June 09, 2007 08:13PM
I really don't see any advantage either - surely a PIC programmer should connect to the ring in the same way the extruder/motors/etc do..?
Anonymous User
Re: PowerComms + Programmer
June 09, 2007 08:58PM
Forrest Higgs Wrote:
-------------------------------------------------------
> Price a ZIF socket and then look at the cost of
> that virtual village programmer. You can't get a
> ZIF socket by itself for double the price of that
> board.

The prices are pretty amazing. I've got their ICD2 clone which was very reasonable and has two ZIFs.

> You need a ZIF if you want to program a
> PIC more than a few times. Prying PIC's out with
> a small screwdriver or a bamboo wedge, which was
> what I used to do stresses the legs and eventually
> causes them to fail.

Probably the easiest and cheapest way to incorporate a programmer is to forget about the sockets entirely. Put the transistors, resistors, and diodes that make up the programmer on the powercomms board and add a 6-pin ICSP header. Put the same header on all the universal boards. If you want to use it as a socketed programmer, you just use one of your universal boards as a socket. This limits you to programming 18 pin chips in socket, but I guess the important thing is that the machine is able to program copies of itself, not that it's an ideal PIC programmer.
Anonymous User
Re: PowerComms + Programmer
June 09, 2007 09:10PM
randomdude Wrote:
-------------------------------------------------------
> I really don't see any advantage either - surely a
> PIC programmer should connect to the ring in the
> same way the extruder/motors/etc do..?

You *could* make a PIC programmer that would connect to the ring, but that has the chicken & egg problem. The only things that can talk on the ring are PICs that are programmed to understand the communications API. The JDM programmers don't have any parts that need programming.

There's also the issue of programming software. If we create a programmer that sits on the ring, we'll probably have to write the PC software to download programs to it. If we make something compatible with an existing design, we can use existing programming software.
Re: PowerComms + Programmer
June 09, 2007 10:13PM
I didn't understand before, but it came to me before I rolled out of bed this morning. The programmer would be a JDM compatible programmer built into the powercomms board. Sounds worthwhile and eliminates the development of an additional nontrivial device speaking SNAP. Then you can use it to program pics on that board for population in the others or use an ICSP cable to any universal board. Sounds like an ideal way to get past mommy chicken to baby egg. Was someone working on a modification to the original circuit? I'd settle on a scribbled on markup to review before you bother designing in the modifications. It should be easily testable too. I was too focused on a software solution 'cause I'm a programmer. And Forrest that programmer you pointed out is sweet. So my 18f2550's can be dedicated to just being an oscilloscope or other fancy interfaces smiling smiley
Re: PowerComms + Programmer
June 10, 2007 10:47AM
awesome! here is the basic idea on how it would work in an ideal world:

1. build powercomms + programmer
2. program inital chip(s) either directly on the board or via ICSP header
3. once chips are programmed, use the software method to update firmware

all 3 steps are important, and complimentary.

the nice thing about this is that it eliminates the chicken and egg problem. you can directly program the chips from the board w/ only a serial port. also, if the software method fails for some reason, then you have a backup plan to save the day.

wear and tear on the chips would be minimal, since ideally you'd either program in-place with ICSP (no removal), or only need to remove them once after the initial programming (1 removal).

also, i dont know how you're doing it, but once i learned not to jam the chip *all* the way into the socket, its much easier to program them. all you have to do is make sure they make the first contact.
Re: PowerComms + Programmer
June 10, 2007 11:03AM
I've been sniffing around some more on the Virtual Village website. Here's an assembled JDM PIC programmer with two ZIF sockets for $12.99.

[www.virtualvillage.com]

Guys, we can't make one for that even without the ZIF's. eye popping smiley
Re: PowerComms + Programmer
June 10, 2007 11:18AM
Surely the incremental cost of adding the JDM to the powercomms board is much less than $13. Sub $1 I would have thought.


[www.hydraraptor.blogspot.com]
Anonymous User
Re: PowerComms + Programmer
June 10, 2007 12:12PM
I think it'll be in the $1 range with an ICSP header. Add another buck for a socket if that's desired. It'll probably look something like this:

[img159.imageshack.us]

I was trying to find a clever way of using the unused MAX232 channels to our advantage, but I couldn't figure it out. I'll try breadboarding this up later today.

[edit] I guess this would save some components, but I'm not sure if it delivers enough current to Vpp
[img444.imageshack.us]

Edited 1 time(s). Last edit at 06/10/2007 01:14PM by emf.
Re: PowerComms + Programmer
June 10, 2007 07:21PM
VPP does not need current, the PIC develops it's own programming voltage internally. The applied vpp is only a reference voltage. This is from the 16f6(27/28/48)(a) specs. Yeah, I like circuit 2. Nice and simple. Now what I'm not sure of.. can we do ICSP on connected boards, and do we need any protection from running (programming software of choice) while reprap is powered up?
Re: PowerComms + Programmer
June 10, 2007 07:53PM
My (maybe too simple?) idea would be a power switch in the +12V line on each UCB. We already have a power/running LED. So you turn off a board, plug ICSP cable into it, program it, remove ICSP cable, power back on. Is that workable? Seems like a worthwhile improvment over the current way of doing it. If theres a simpler/cheaper way to protect the board from trying to run while being ICSP'ed, I'm interested -- I just don't know what it would be. Switches would increase the cost slightly, though.

Your whole SNAP network will effectively be down while you reprogram any one board, if you power that board down, of course... but do we *really* need/want a Reprap to try and continue to extrude while we are loading new firmware into one of its brains??! I think that would be asking rather a lot ... a bit like asking me to keep on posting in these forums while undergoing brain surgery :-)

Jonathan
Anonymous User
Re: PowerComms + Programmer
June 10, 2007 09:29PM
bartlee45 Wrote:
-------------------------------------------------------
> VPP does not need current, the PIC develops it's
> own programming voltage internally. The applied
> vpp is only a reference voltage. This is from the
> 16f6(27/28/48)(a) specs.

Thanks, I couldn't find that info.

> Now what I'm not sure of.. can we
> do ICSP on connected boards, and do we need any
> protection from running (programming software of
> choice) while reprap is powered up?

I'm not entirely sure. At first glance, it looks pretty safe. This programmer doesn't float ground like the normal JDM does, so there's no danger in having the power connected.

Assuming we protect the Vdd on the universal boards with the usual diode, the voltage on MCLR shouldn't be a problem for components on the board itself. MCLR is brought out to a header labeled "Max/Mat Out", I guess optical or mechanical sensors. Depending on what they are, I guess the sensors could be damaged or could prevent MCLR from rising enough to enter programming mode. Someone familiar with those boards would have to think about what a surprise 12V would do to them.

With this programmer design, the PGC/PGD lines can swing above 5V and below 0, I guess counting on the PICs internal diodes for protection. Right now I think these two pins are unused, so that should be safe, but we'll need to be careful if we want to use them on future boards.
Anonymous User
Re: PowerComms + Programmer
June 11, 2007 09:08AM
Yesterday's breadboard tests were not so promising. Neither circuit was able to read the 16F628A -- they read back all 0xff. I did have some success reading a few other chips -- 16f819, 18f1320, 18f2450. I didn't try programming those chips, but it looked like it was getting meaningful data back. For two of the three, it read back the chip id correctly.

I think this is the usual symptom of Vpp being too low. I checked my 12V rail this morning and it was at 11.73V, the 16F628A seems to specify the minimum programming voltage of 12V +/- 0.25V, so I was out of spec. Some of the other PICs only need 9V, which is probably why they worked.

So... I'll give it another try tonight with a different supply. It sounds like any of the simple options will be cutting it close. The second circuit is probably better than the first because it doesn't have a transistor lowering Vpp.
Re: PowerComms + Programmer
June 11, 2007 12:02PM
is there any way to kick the voltage up and/or add a 12v regulator? i dont know much about electronics, but figured i'd suggest it anyway angry smiley
Re: PowerComms + Programmer
June 11, 2007 12:20PM
Well, you can get DC-DC converters, but then our estimated $1 cost goes up :-(

Something like [www.v-infinity.com]

might work to get you 15V from our 12V rail, if you can handle the $$. If someone can find a source of these for maybe US$2 it would be worth a look. But at US$6 or so, I'm not so sure.

Jonathan
Re: PowerComms + Programmer
June 11, 2007 12:38PM
The trouble with using PC power supplies is that the rails are not individually regulated much. This means for example that if the 5V rail is very lightly loaded the whole PSU throttles back to keep it in range and the 12V rail tends to be too low.

You can usually get the 12V rail to pull in spec by adding a big power resistor accross the 5V rail to give it a significant load. Not sure where the 3.3V rails fits in as I have not played with a modern PC supply, only the old AT ones. You may have to load that instead of or as well as the 5V rail.


[www.hydraraptor.blogspot.com]
Anonymous User
Re: PowerComms + Programmer
June 11, 2007 01:35PM
I was testing this with the AT power supply I had connected to my breadboard. It's loaded with an old hard drive, but that may not be enough load... Usually I just use the 12V rail for 5V regulators so it didn't occur to me until this morning that it could be very far out-of-whack. I'll try tonight with the ATX supply I've got for the reprap, I'm pretty sure its 12V was good.

If a full 12V doesn't work, I don't like our remaining options -- none seem very simple. Shifting everything down to use the -5V supply for ground would probably be the cheapest, but I have a feeling it would be pretty ugly.

I don't suppose anyone thinks putting in a AA battery socket would be a clean solution? :-)
Anonymous User
Re: PowerComms + Programmer
June 11, 2007 02:52PM
Maybe I should just sit on my hands for a while. AP2k just noticed that the 16F628 doesn't support self-programming. That doesn't directly impact high-voltage programming, but that realization might push the project to upgrade to another chip. The obvious candidate of a 16F88 needs 13V +- 0.5V to program, so any design that depended on 12V being good enough would have to be abandoned.
Re: PowerComms + Programmer
June 11, 2007 03:15PM
Here is a relatively cheap way of stepping up voltages [www.romanblack.com] for PIC VPP.


[www.hydraraptor.blogspot.com]
Re: PowerComms + Programmer
June 11, 2007 04:09PM
nice, they even have a section on how to use it to program a PIC =)
Re: PowerComms + Programmer
June 11, 2007 07:32PM
emf,

Any changes to the PIC used will be delayed until after Reprap Darwin v1.0, for sure. We have working UCBs now, changing the PIC and significant board re-layout doesn't seem appropriate at this stage. Even just the small changes needed for ICSP could well need to wait for Reprap Darwin v1.2 or v1.3 or whatever. So ... please don't sit on your hands waiting for a change of PIC :-)

The romanblack.com 13V supply looks workable to me, and at a claimed "under 50 cents" component cost, (plus a 3K3 resistor and an NPN transistor for MCLR control), we can probably afford it!

Jonathan

Edited 1 time(s). Last edit at 06/11/2007 07:35PM by Jonathan Marsden.
Anonymous User
Re: PowerComms + Programmer
June 12, 2007 09:32AM
Nice voltage boost circuit, looks like it would come out a bit cheaper and smaller than a charge pump design.

I'm still hoping it's not needed. I messed around with it a little more last night and discovered:
- I had the jumper on my programming board in the debug position instead of program, so there was a resistor pulling the Vpp down to the 8V range. After switching that jumper, the chip was seeing the full 11.7ish volts my supply was putting out. Still out of spec, but only just. Still didn't work.
- I added an AA battery to boost the voltage to about 13.3V. Still didn't work.

So I'm starting to think the problem isn't the voltage after all. I've been testing with a laptop because I figured it was the worst-case we'd see. Perhaps the problem is on the clock or data lines. It's probably worth trying clamping diodes on those lines. If that fails, I'll try running on a desktop machine where I've successfully used a JDM programmer before.
Re: PowerComms + Programmer
June 12, 2007 11:58AM
excellent. i love reading the daily progress reports! =)
Anonymous User
Re: PowerComms + Programmer
June 15, 2007 12:43AM
Quick update -- clamping diodes didn't help. The plan is now to start at square one: get a desktop PC working with a standard JDM programmer to ensure the software's timing is correct, then try substituting one of our alternate programmer designs, then move on to testing with more difficult setups like a laptop. I'm away from the workbench until Monday, then I'll get started setting up an old PC to use as a programmer.
Anonymous User
Re: PowerComms + Programmer
June 22, 2007 12:34AM
Some confusing results. I needed to make a powercomms PCB, so I added the elements for the minimal programmer we were discussing earlier (NPN + 4 resistors, no voltage boost stuff). This didn't work in the breadboard, but you never know....

As you guessed, it didn't work on the laptop or PC. I fiddled around with it a bit, lowering a few resistor values, but no luck. So I added a AAA battery to boost the voltage. With the battery, it works great on the PC. On the laptop, it *usually* doesn't work. There were a few times where the stars aligned and I was able to program with the laptop. Usually when this happened I'd be able to keep going, programming & verifying successfully with different hex files. If I removed the PIC and then re-inserted it, it would fail to program or read, and I'd have to spend five minutes or so messing around with things to get it to start working again.

I'm not sure what to make of this. They're now using essentially the same power supply (laptop was about 13.35V, desktop just under 13.5V, both comfortably above the 12V required). The transistor is driven by the MAX232, so its response should be the same. I could believe that the CTS/RTS/DTR lines were too weak on the laptop, except that when it worked, it worked reliably (and when it didn't work, it reliably acted as if the PIC wasn't even there).

I don't yet know what to make of this, except maybe to think that it's a sign that I need to get a new laptop.
Re: PowerComms + Programmer
June 22, 2007 01:02AM
Grin... try two AAA batteries in series??? It would be an awful lot cheaper than a new laptop :-)

Jonathan
Re: PowerComms + Programmer
July 28, 2007 06:14PM
Kind of going way back to the beginning of this thread but wanted to pass on info to any fellow repstrappers in my shoes:

I bought the usb PIC programmer with ZIF from virtual village and just got it today, programmed up all the stepper chips like a charm. Only one trick which was the packaged installer is for 16-bit installshield (did not see linux support, hoorah for dual boot) so if you have XP it is likely the installer will not run.

I was able to find a 32-bit package though that not only works in XP but also added compatibilty for a few more pics - here is the link:

[kitsrus.com]

Only real downside to virtual village was the shipping took about 2 weeks from China, however it was registered mail and packaged nicely. Just wanted to share my experience.
Sorry, only registered users may post in this forum.

Click here to login