Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : simplest 32MX150 ICSP
Page 2 of 28 | |||||
Author | Message | ||||
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2287 |
with the code written basic, that would open up a whole myriad of opportunities! not only being able to program a 32MX from any platform that supports maximite basic (including windows), but also having the algorithms sitting there in plain sight and able to be translated to other languages if needsbe. i'm still excited about the possibility of arriving at having programming hardware that itself doesn't need programming (avoiding the need to pick onself up by one's own bootstraps). if the windows version of maximite basic could be expanded to talk to an I/O device (serial flow control, or parallel port) that would accomplish this. rob :-) |
||||
MOBI Guru Joined: 02/12/2012 Location: AustraliaPosts: 819 |
Thanks Geoff, I just might at that. At the moment it will be translation of the 8 bit PIC assembler/programmer I built years ago. It didn't have any frills and occasionally needed manual entry of chip parameters such as flash and eeprom size etc. but it worked. Its main purpose was a learning experience. After the demise of the hardware comm ports, I built a 'simple' PIC interface to communicate with the PC via a USB to Serial cable. All done using serial command/data instructions. The PIC dongle did the instruction interpretation and manipulated the /MCLR, PGD and PGC lines as well as RTS, CTS etc. It worked much faster than using the serial flow control lines as PGC etc. First off, I think I will tackle the 4 wire programming protocol as it is much faster and will give an indication of programming time. If it looks ok, I will then go to 2 wire as that is what most prototype boards are set up for. I envisage that excluding the programming executive, programming will be quite slow. Going away for a couple of nights (wind farm respite) so development will be pen and paper for a while. I might still have mobile internet - depends where we and our home made active camper end up. cu when I back. David M. |
||||
MicroBlocks Guru Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Mobi, i have a Salae logic analyzer that probably can record a programming session. I am not sure about the voltages that are used and if they are within the limits of the logic analyzer. With a trace you would be able to see all the timings. Do you think that will be good to have or is that part already documented? Microblocks. Build with logic. |
||||
WhiteWizzard Guru Joined: 05/04/2013 Location: United KingdomPosts: 2794 |
I have played with building a low-cost programmer for the PIC32s. Started with the Salae logic monitoring the MClr, Clk & Data lines during a programming session. Then referenced this with the MicroChip PIC32 programming guide - got on ok seeing the documented signals but there was extra 'data' present that wasn't documented. Gave up at the time due to other 'things' having priority. As a note, I would not bother trying to record a 'session' and then play those signals back for two reasons: 1> The data is two way and I believe includes some built in unique ID within the PIC that is communicated with MPLab. Along with a checksum which would be based on this ID, this method would immediately fail on anything other than the unique PIC you recorded the signals from in the first place. 2> Even if the above point is solved (doubtful) then whenever a new .hex file is released, you need to get a new 'file' with the new 'captured signals' somehow into your 'playback programmer'. This would require a third party to do and then distribute (not an ideal solution). It would be far more useful to simply receive a .hex file directly and then 'blast' a converted file based on this .hex file into your blank PIC i.e. you are in total control. I have enquired with Olimex (via BigMik) about the source file for their device and then just copy the required (publicly available) part of the circuit. This is very doable and will be basically a PicKit3 clone. The thing is though, IMHO I believe the hardware needs to be non-SMD based and hence anyone can build it. A PIC + a handful of components to make a clone is a sensible approach as MPLab would recognise it. If it is based on SMD components, then some/most people would not be able to make it and hence have to by 'it' - not the aim here! Then to go full circle - why not just buy a cheap clone in the first place? Be cheaper than building your own. Then have a MicroMite control the Program-To-Go button. This last sentence gives a clue as to what I have successfully built and use to program all my MicroMite Modules - takes about 5seconds per Module I would love someone to make a PicKit3 clone based on a MicroMite - if someone is close, but not quite there yet, then I am more than willing to help them progress further. WW For everything Micromite visit micromite.org Direct Email: whitewizzard@micromite.o |
||||
MOBI Guru Joined: 02/12/2012 Location: AustraliaPosts: 819 |
@WW, What I am proposing (and have done in the past) is to simply use the MMite as an ICSP device. This doesn't need any other components, just three I/o pins. In the .HEX file, checksum can be ignored as lso device ID etc. All that is needed is data address and the data itself. There are no problems with failure due to id mismatch as the MPLAB will ONLY be used to create the .HEX file. The idea is to dump the .HEX file to a SD card which is then inserted into the MM and take it from there. All data processing is done in the MMite using MMite Basic. As long as you only want to programme the one version of PIC32 there are no problems. The PIC8 programmer I did was in VB6 and could menu select the type of pic I wanted. If I wanted to do other PICs, it was a 'simple' case of adding another algorithm and altering a few simple PIC parameters. The idea here is not to buy a PICKit3 (I already have one) but to see if the MMite is fast enough and has the capacity to do an acceptable job and for followers/participants to learn something along the way. And most importantly, to have a bit of FUN. David M. |
||||
Keith W. Senior Member Joined: 09/10/2011 Location: AustraliaPosts: 118 |
I am also hopeful about programming a PIC32MX via other than a PICkit-3. Via a Maximite would be great. In looking on the web I have found this site. https://code.google.com/p/ardupic32/ This is about using an Arduino to program a bootloader into a PIC via JTAG connection. From the list of devices included it is not too device specific. The listings maybe contains many clues to be pursued regarding programming. Likely many are applicable to ICSP also. The actual bootloader(s?) the designer used does not seem to be given here? Hope someone finds this useful. I am sure that some others will de-construct this quicker than me or even have an Arduino to try with. Keith W. |
||||
vasi Guru Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
It would be very useful to Arduino owners but not only, as there is more likely to build an Arduino than a Pickit3. Well, from my point of view. Otherwise, the official Arduino may be almost as expensive as a Pickit3 (didn't looked at prices). Anyway, the best alternative is to buy a mikroe board and start from there: MiniAT board But all goes down to David's C language knowledge and AVRs... Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
BobD Guru Joined: 07/12/2011 Location: AustraliaPosts: 935 |
It could only be an educational thing. At US$43 delivered that is US$10 more expensive than a Pickit3 delivered. |
||||
MOBI Guru Joined: 02/12/2012 Location: AustraliaPosts: 819 |
That is not a problem. A few years ago I converted my pic programmer interface to programming AVRs, then translated the PIC interface to AT328 and as a follow on, dumped in an Arduino code to a 328 thus creating as many arduinos as I wanted for the price of a blank 328 chip. I did have to be careful as I "bricked" most of my 328s by setting the wrong oscillator mode. Then I had to add high voltage programming circuitry (not difficult but annoying) to recover the 328s. Anyway, what I am going to do as I said before is to use MPLAB or what ever to create a PIC32 .HEX file (or download uMite .HEX file) to an SD card. Plug the SD card into a MaxiMite and use MMbasic to write the HEX data to a blank uMite PIC32MX. I am going to do it using 2 wire ICSP because most proto boards are purpose built to accommodate a PICKit3 type interface. Once running (if not first) I will alter the MMbasic software to programme using the 4 wire interface as it should be significantly faster. If anyone wants to tackle this project a different way, don't let me stop you - I am just as interested in other people's ideas. Rob floated the idea of doing it just using usb serial cable flow control lines - personally I think it will be too slow. My aim is to use a MaxiMite to programme a MicroMite. David M. |
||||
vasi Guru Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
Hi David, Something which may be even more familiar. Vasi Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2287 |
i'm fully behind MOBI's approach, as i can see it being easy to expand upon, later, in a number of different directions that will satisfy almost everyone: the basic code can be loaded into a maximite, or maximite basic for windows, or even gwbasic. while the hardware implementation of the 2-wire or 4-wire interface can be accomplished in several different ways depending upon the platform. personally, i don't see speed of programming being an issue in the hobbyist domain - if it takes 10 minutes (or even 30) to flash micromite basic, few will mind. MOBI is talking about the 2-wire approach being a step on the way to implementing 4-wire, so both methods will be available. i'd not mind seeing an arduino being used, but that is a different path again. an arduino mini (serial) can be had on ebay for nz$3.20 delivered, an arduino nano (usb) for just under nz$7 delivered - both dirt cheap. the problem is that the hobbyist then has to get the arduino IDE up and running, a set of coded compiled and loaded, making the chain of events leading up to a functioning micromite considerably longer. my own wishes are to see the length of the path, from unprogrammed 32MX150 to micromite running in a teraterm window, kept as short as is possible. MOBI's approach seems to be a good way of accomplishing this. rob :-) |
||||
vasi Guru Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
Making a PIC32 programmer considerations Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2287 |
interesting site. most of the author's concerns don't seem to apply - for creating a micromite one can assume a blank device (or one that has only ever been flashed with micromite basic), and use 2-wire mode without a programming executive. slow, but reliable it would seem. i'm also at a bit of a loss to figure out who the site author is. all i could find on the site is simonvav(at)gmail.com which didn't reveal much at all about him when searching with google. |
||||
vasi Guru Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
I found him on SparkFun forums where he have 6 posts but no information about him is given. And on velleman.eu with 28 posts but again, no user information. 5 posts on edaboard.com, and so on... who wants to continue, feel free It seems that it does not talk too much outside his site... and judging after the commercial links, it may be slovenian. Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
vasi Guru Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
Found it! His name is Simon Peter Vavpotic and writes articles on http://www.monitor.si http://www.monitor.si/clanek/kaksni-so-danasnji-mikroracunal niki/153251/ Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
kiiid Guru Joined: 11/05/2013 Location: United KingdomPosts: 671 |
A while ago I came up with this solution and used it in a few boards with PIC32 and PIC24, where (with a custom made programming cable) it gives me the option to program the device via the USB port and without a bootloader or extra programming header. Never seen it anywhere else, but it works just fine and could be of help to others. Of course the resistor value can vary as in this particular case it is 6.8k purely for BOM optimisation. http://rittle.org -------------- |
||||
MOBI Guru Joined: 02/12/2012 Location: AustraliaPosts: 819 |
Hi fellas, Thank you for all the info you have dug up. I can't do too much at the moment as we are out in the bush trying to get a couple of nights good sleep. This is the second night. Last night was peaceful and tonight (different place) should be the same. Anyway, much of the data published seems to be doom and gloom specifically about needing the programming executive etc. The Microchip pic32 programming instructions says that it can be done, with the PE being optional (but slower) and that all the instructions for doing so exist in the programming instruction PDF file. I can not imagine Microchip writing a programming document on how to programme a pic32 if it can not be done. I don't imagine it will be really easy but also, I don't think it will be too hard either. It is just a case of understanding the Microchip (written by an engineer, not an educator) documentation and taking the appropriate steps. I think I have read enough Microchip documentation by now to sort of understand how the mongrels think and when I can't, I use the principle "if it were me designing it, how would I do it?" and it generally works. sometimes I have the brick pattern in my forehead for a few days. When I first started to build my own pic8 programmers, the instructions looked like it couldn't be done, but after lots of brain ache, I figured it out for different PICs and consequently the different programming algorithms. We shall just have to wait and see. We will be having overseas visitors for a few days starting tomorrow so I will be a while getting back to doing things concrete, so please don't get too far ahead of me. David M. |
||||
WhiteWizzard Guru Joined: 05/04/2013 Location: United KingdomPosts: 2794 |
Hi Mobi, Is your overseas visitor from MicroChip by any chance? WW For everything Micromite visit micromite.org Direct Email: whitewizzard@micromite.o |
||||
MOBI Guru Joined: 02/12/2012 Location: AustraliaPosts: 819 |
No, more's the pity. They are the wife's cousins from the Netherlands - just getting ready to fly home after a few weeks out back in Oz. Got to log off now as the battery in the camper has to keep the refrigerator alive for the night. Fortunately it is going to be a cold night. Plenty of soft woolly bed covers and a hot water bottle. Nitey nite. David M. |
||||
atmega8 Guru Joined: 19/11/2013 Location: GermanyPosts: 712 |
Here A simple PIC 32mc Programmer with hard and Software. Link I think this code does what you want.....?! |
||||
Page 2 of 28 |
Print this page |