![]() |
Forum Index : Microcontroller and PC projects : simplest 32MX150 ICSP
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
Keith W. Senior Member ![]() Joined: 09/10/2011 Location: AustraliaPosts: 118 |
John only the board layout is taxing, after that it is easy to load and solder 4 dip chips to reproduce a unit. OK to build on a strip board as I would try first. But then I am more hardware and you a programmer. It IS only 4 chips. I considered using a simple PIC Chip; I bought some PIC16F628A as more than suitable to start. My favorite 68HC9xx are too expensive. But I have never yet written a program for a PIC although I have built a good programmer and have burnt them using others Hex. I wish to learn how to do it but as a longer learning project. I lost the urgency when backshedites expressed the desire to build a programmer that did not depend upon having a programmer. With intelligence in the sequencer programming can be speeded up by for instance transferring bytes of code at a time. Keith. |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4071 |
If I were able to design something I suppose I'd find the cheapest & simplest possible uC that needed no external components at all (are there any?), then hook the (laptop/desktop) USB serial port board's Tx & Rx to it and from that uC connect to MCLR/, PGC, PGD & GND. Then the simplest program for the uC and get the PC to tell it what to do at the highest baud rate (say 1Mbps) the uC can do. Is there a uC that doesn't need caps etc? Just power. I suppose 3V3 rather than 5V would be better for PIC32 targets since the PIC32 drives PGD at 3V3 levels and doesn't really want 5V-type signals. John |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2447 |
a couple of thoughts: 1. page 13 of the FT232R datasheet refers to the signal "BitBangWR" that can be generated on any of the first 4 CBUS lines (CBUS0..3) which seems to be a strobe signal for whenever a write occurs to the device. could this be useful as an alternative to having the PC control PGC directly? 2. instead of generating a single PGC output, could you generate two at half-rate, which are 180 degrees out of phase? with a few passive components you could then turn the leading edges into a pair of short pulses that when combined together yields a single train of PGC pulses. rob :-) |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4071 |
Thanks, Rob. 1. so, something like: writing the TDI (or TMS) bit not only causes it to appear on the associated pin (now DTR for 5-wire i.e. with the 3K3 resistor) but also creates a pulse (hi then lo strobe) for PGC? yes, maybe, though I don't see how to do it (and the timing must be "not too short a strobe") (It probably wouldn't be doable with the 4-wire i.e. no 3K3, but no matter.) 2. er, probably, but nothing springs to mind! John |
||||
Keith W. Senior Member ![]() Joined: 09/10/2011 Location: AustraliaPosts: 118 |
John, Lesser PICs require no or very few external components, the more powerful chip in the Micromite does not require much. That is why I was interested in the PIC16F628 that I can program with my simple programmer from a serial port. Maybe just a bypass capacitor is required in the application circuit. Similar PICs are used to make PICAXE components for instance. The PIC16F628s cost me about A$6 each from my local Jaycar store. They can run without an external clock and do not require the tantalum capacitor as does the PIC 32MX used for the Micromite. My PIC16F628 chips are 18 pin dual in line but PICs are available with just 8 pins. I use an 8 pin PIC in my Frequency Meter to divide the reference 10 MHz oscillator down to 1 second, a divide by 10^6 in one little chip where the 10 MHz provides the PIC clock. It could be that using a serial port will not be as fast as the USB port when used for normal bulk serial comms, and most computers no longer have a serial port other than through USB. Of course following this to the end one could use a USB capable PIC32MX250 chip as does Geoff’s ASCII Terminal, which chip costs about $6. Something similar to a PicKit3 although I think it has more than 1 chip to offer other features. Keith. |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4071 |
Keith, Yes, that's good but I managed to leave off an extra feature wanted: that the uC has something like an in-built download mode / bootloader. E.g. STM32 chips have a factory-programmed bootloader. Otherwise, one needs a separate programmer to program the uC that's to be used to program the PIC32. And we're sort of back to square one. The PIC32 sort of has what's needed, in that the ICSP 2-wire mode can inject any instructions and thus program a blank (or non-blank) chip. Sadly it's slow over USB (not that Mchp ever expected it to be done this way). (I don't actually know the minimum component count for STM32 nor the cheapest chip price but going via STM32 is no better than an ATMEGA/USBASP.) I suppose there may be a PIC with (almost) zero external components and still able to be low voltage programmed through ICSP or the like. (I gather with the low-ESR etc caps that it's not a PIC32.) If it's then to program 128KB or so into a PIC32 it needs a decent speed uart if it's to be connected to a laptop/desktop PC since it'll be via a USB serial port board most likely. As you say, PCs tend not to have a serial port any more. If there's a PIC16 (or 18) along those lines then it may be an attractive way to go, and it would allow any USB serial port board not just an FTDI one. Then, one would program the PIC16 using ICSP along the lines I now do but it would be a tiny program so quick to do, and then attach it in between the USB serial port board and the target PIC32. John |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2447 |
i had in mind something like this: ![]() the pulses should be somewhere in the region of 0.1ms wide. the two diodes and 15k resistor form a simple OR gate. adding a small capacitor across the 15k resistor will delay the pulses slightly, though i suspect this will not be needed. i am assuming that you can set the state of PGD, PGC1 and PGC2 all in the same usb packet? rob :-) |
||||
elproducts![]() Senior Member ![]() Joined: 19/06/2011 Location: United StatesPosts: 282 |
Not sure if it completely fits your needs but the PIC16F1455 has USB built in and also an internal 48 Mhz clock for the USB operation, so you don't even need a external crystal. www.elproducts.com |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4071 |
elproducts - probably don't want a USB one because the PIC18 (in this case) has to be programmed via ICSP, so USB would not get used. Rob - yes I can set them, so that looks like I'd set: PGC1 to 1, PGC2 to 0 then (in the next USB packet): PGC1 to 0, PGC2 to 1 which is 2 USB packets (I can set PGD in each packet as well). Ah, and it made 2 pulses which now take me 4 packets. hmm, interesting... Might be a snag in that I can't control the time between the packets, although it's a very relaxed (almost fully async) protocol so I think it doesn't matter. John |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4071 |
Follow up... Is the idea that it would go as below and if so what would the overall waveform be on PGC? PGC1 0 1 0 1 PGC2 1 0 1 0 Each PGC1 & PGC2 pair will occur together. There will be varying times between each pair and the next pair. Would it make 4 pulses (and with gaps between them, doesn't matter how big)? John |
||||
bigmik![]() Guru ![]() Joined: 20/06/2011 Location: AustraliaPosts: 2956 |
John, All, I thought this process was to avoid having to buy a PicKit3 and thus avoid spending $20 or so.. All these ideas are great, in principal, but in reality it wont help someone who just wants to burn their own uMite unless they are really doing it on the cheap and dont mind doing a bit of breadboarding.. They would still have to program the PIC chip to do the code.. Dont let me distract you from this if you wish to pursue it for your own satisfaction but I feel it is morphing into the impractical, given the reason this idea was broached in the first place. After all using a $5 FT board that can still be used to control the uMite is basically costing nothing. Regards, Mick Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4071 |
I'm thinking to leave it as it is but still curious to know what might be done simply, if it makes a major speed up. Although I'm curious, I'd like to keep it very simple so multiple diodes, caps, resistors etc... not keen. A single PIC16 or PIC18 and program it via ICSP as a sort of bootstrapping process... maybe :) I can't wait for my USB3 card to arrive as I'm happy to have USB3 in any case. Generally I'm thinking someone is either programming one 'mite occasionally or else several. In the first case what I've done is OK but in the latter they want MOBI's way or mine except with one 'mite programming the others. Circuits with more components aren't really my interest although I'm happy to try to get them working out of curiosity (time permitting). John |
||||
donmck![]() Guru ![]() Joined: 09/06/2011 Location: AustraliaPosts: 1314 |
I have to endorse what Mick is saying here, but I also understand your curiosity desires John. Bear in mind that you can get what Mick and I ended up with for about $40, and this included 3 universal ZIF sockets to suit most configurations of PIC chips. This is the Sure electronics programmer: http://x2t.com/pickit3 ![]() Cheers Don... https://www.dontronics.com |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2447 |
you've got it exactly - in theory you would see 4 short pulses, at each of the 0->1 transitions of PGC1 and PGC2. the widths of the pulses are determined by the 0.1uF caps and 1k resistors. if the pulses are too long, just decrease the values of the 0.1uF capacitors. i'm picking the pulses could be very short and still work, but have no feel of how many usb transactions you're achieving per second. while it is a few more components, i do believe it should be well within the abilities of most to build with just twisted together component leads. at the same time, in the 'final version' of your software you could look at accommodating the two different designs (single-resistor and 8-part versions) to cater for the widest audience. rob :-) |
||||
Keith W. Senior Member ![]() Joined: 09/10/2011 Location: AustraliaPosts: 118 |
John To answer your question about chips with a preloaded bootloader, see link about chipKIT here: - http://www.microchip.com/DevelopmentTools/ProductDetails.asp x?PartNO=TCHIP-USB-MX250F128B As usual remove the space from the link. USB capable but requires a crystal to support this. USD $3.80 for single units from Microchip. Your mention of bootloaders reminds me that you should be able to load just a bootloader much quicker than the full application, which may be OK for Maximites and Ascii Terminal chips although they may use different bootloaders. This could be an option with your programmer. Not OK for the Micromite of course which uses the normal bootloader space also for the application. However you could bootstrap yourself up by loading a bootloader into a chip to enable you to load a ICSP programmer program to create a programmer. I agree that this is all interesting however for the basic very simple programmer required I think you have achieved it now to about the optimum complexity and cost vs. speed tradeoff. Keith. |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4071 |
Thanks All, I think my goal now is to clean up and release the code. It's got really messy as I hacked it to speed it up. There are a few TODO things, too. John |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2447 |
john: while speed it a nice thing, there is also great virtue in simplicity and elegance. the 1-resistor solution achieves these goals and provides a means for almost anyone to get their 32MX150 turned into a micromite for just a few dollars. you have done a remarkable job, and achieved what many naysayers said was impossible. i look forward, as will many others, to seeing the release code. with it, a micromite will be achievable (from scratch) for less than $10 total outlay. this is a big step forward, and hopefully just the beginning of a series of on-the-cheap programming solutions. rob :-) |
||||
MOBI Guru ![]() Joined: 02/12/2012 Location: AustraliaPosts: 819 |
Hello all, I have been following this thread jealously and congratulate JohnS. I am still based in the UK for another week, then a week in Holland again before heading home. I can do little more than write a few routines for the PE etc as my MMite etc is home and no way to test the code. Never mind, I will get there. Meanwhile, keep up the good work. I don't think my version will be as fast as the USB based unit but hopefully won't need any additional resistors or interface chips. We'll see. David M. |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4071 |
The Basic version should be LOTS faster. At a guess 100 times but maybe only 10. (C is fast but USB abused this way is slow.) John |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4071 |
Well, my USB 3.0 PCIe board arrived. Under Linux (which already had the driver and "just worked"), programming a umite went from 30 mins to 25 mins. Under Win7 (I had to use a driver CD, then a newer driver, and so on) it's much slower than using any other USB port :( Pah. I've tried updating the drivers (it's a NEC/Renesas uPD720200) but not tried changing its firmware yet so I suppose I should give that a go. Now jealous of bigmik's 15 mins!! John |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |