![]() |
Forum Index : Microcontroller and PC projects : simplest 32MX150 ICSP
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
MOBI Guru ![]() Joined: 02/12/2012 Location: AustraliaPosts: 819 |
Its a bit like the chicken and the egg. @Vasi, definitely something to keep an eye on. The main challenge for me is to get something working from Microchip's technical data sheet and first principles. David M. |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4071 |
Reminds me of a stripped-down (reduced feature) BusBlaster - which can also program chips, including via OpenOCD. Neither is especially cheap and partly because they offer lots of features not needed if all that's wanted is PIC32 programming. John |
||||
vasi![]() Guru ![]() Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
That project is great for Lab. Especially for those programming both PICs and AVRs (considering that any Pickit2 clone has the Microchip interdiction to program anything different than PICs). It has a hidden gem - MPLAB C18 programmers may be able to discover it. But yes, it is too much for PIC32, considering that it does not support it yet and JTAG feature is yet to come. Those interested will keep an eye on the project. Anyway, along with usbpicprog, is an excellent alternative to the discontinued Pickit2 programmer. Easy to build. Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
elproducts![]() Senior Member ![]() Joined: 19/06/2011 Location: United StatesPosts: 282 |
Vasi, Though the software is not being updated by Microchip, its not discontinued. PICkit 2 is still being sold by Microchip and is supported in MPLAB X. And the open source nature of it allows anyone to update the device file for the command line and GUI software. I'm trying to keep it up to date for the 8-bit crowd with my own PK2 open source project at my website http://www.elproducts.com/build-your-own-pickit-2.html It integrates so well with the GCB@SYN IDE for Great Cow Basic, I can't imagine using any other programmer. And the integrated UART tool and Logic Analyzer are an awesome option for the beginner just getting started. So don't call it discontinued, its still around. www.elproducts.com |
||||
vasi![]() Guru ![]() Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
As I remember, the Pickit2 firmware was never open-sourced, but I may be wrong. I also archived everything related to it. It still supports much more AVRs than the OpenProgrammer and I know how useful it is as I'm using it. But is fading away from the main scene. It is already useless for Micromite. _____________ A member (@scasis) of Microchip forums started modding the PC GUI software ver.2.61, I asked him to share it... ![]() I wonder what will happen when Microchip will decide to close it for good... will start hunting down all sites around the globe? Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
JTR0701 Regular Member ![]() Joined: 10/07/2013 Location: AustraliaPosts: 71 |
Well, I have, did it a few months ago when I first saw the micromite and realized this could be a neat companion chip and bit of a fun challenge to mock-up and get working. In front of me is a 14-pin 16F1455 that is both a PIC32MX programmer and a USB - RS232 bridge. The beauty of this chip is that it is available in a DIP package and that is what I am using. ![]() The micromite is on a dangerous prototypes breakout board and yes, those two pins are meant to be out of the socket. (Troubleshooting the programmer.) The other board(s) are my own 8/14/20-pin [USB] PIC dev boards. There are two still v-grooved joined. What you cannot see is the 3.3V voltage regulator and 3.3V/5V switch under the board. While I have a basic programmer and a rather trick USB-RS232 bridge working, as always getting the guts of it done is only half the battle. The software for the programmer needs to be rewritten for cross platform support (Currently it is written in VB6) and then there is the documentation and support etc. Really not sure if the idea is worth going any further with at this time. I am looking to sell of the small stock of these boards but I probably will kit them up with a 18F14K50 and bootloader. |
||||
MOBI Guru ![]() Joined: 02/12/2012 Location: AustraliaPosts: 819 |
All this gives me the desire to carry on in the current vein. If nothing else, some of us (including me) will have a better understanding of how the various programming methods work. Those who want to follow or help are welcome. I had a look at the data sheet a few posts back and yes, it seems that P17 has been replaced with unlimited P19 timing. Kind of backs up my confidence Microchip documentation (not). David M. |
||||
MOBI Guru ![]() Joined: 02/12/2012 Location: AustraliaPosts: 819 |
It is probably better to download 60001145M.pdf from MicroChip - much clearer. Programming PIC32 flash memory is achieved using four signals: TCK clock input - supplied by the programmer TDI data input TMS mode select TDO data output The "T" stands for "Test" The device being programmed is often referred to as "TAP" (Test Access Port). The Pic32 supports two programming methods - 4 wire and 2 wire. In the four wire mode, each of the above signals from the programmer connect to the PIC32. However, in the two wire mode (ICSP), we only have a "data" and a "clock" line so the PIC32 has to be able to decode serial data and send it to the appropriate register. In ICSP mode, four clock pulses (TCK) are used to clock in the three control values in the sequence: TDI + TCK, TMS + TCK, TCK, TDO + TCK. TDO is an output and is clocked on the positive edge of TCK. The other two signals are inputs and are clocked on the negative transition of TCK. All programming commands are achieved using the TDI and TMS signals, and always in the sequence shown above. If data needs to be read from the PIC32, each bit is read at the TDO period by setting the PGD (data) pin on the programmer to input and reading its digital value. To read in an 8 bit byte will take 32 TCK pulses. It all looks rather complicated. Next section will endeavour to produce a simple MMbasic code to achieve a programmer command. David M. |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
I think the 2-wire is the best to use. Those TDI,TDO,TMS,TCK are often wired into a circuit forcing the user to remove the chip for programming. Most boards will provide an ICSP with the correct circuit to allow in place programming. Microblocks. Build with logic. |
||||
MOBI Guru ![]() Joined: 02/12/2012 Location: AustraliaPosts: 819 |
Zackly! That's the only reason I am sticking with ICSP. 4 wire Jtag would be much easier and faster. I am writing the MMBasic routines to perform the various commands at the moment. But they'll need refining. I wonder did anyone notice on my post of "entering programming mode" that the routine printed the bit pattern to screen rather that sending to PGMData? It was only to show how 4 bytes could be converted to 32 individual bits MSB first. All will be tidied up in the working programme. Overseas visitors left today so I have a little more time on my hands again. David M. |
||||
MOBI Guru ![]() Joined: 02/12/2012 Location: AustraliaPosts: 819 |
I've struck a snag. I need a 32 bit word but uMBasic limits &hFFFFFFFF to 7FFFFFFF. (pity!) I can work around the problem by splitting the 32 bits into two 16 bit words both for data sent to the target pic32 and received back from the target pic. A right PITA. The system is going to be slow enough as it is. The raw PIC allows for data shift left or right including the carry bit. Wouldn't it be nice...... Ah well, unless someone has an immediate solution, I may as well stop grizzling and get on with the work around. David M. |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2447 |
you could always look at holding 32-bit values in 8-character long strings. although this might sound inefficient at first, the big gain would be that you would then avoid the ->real and real-> conversions that would otherwise be done unseen by the interpreter. someone remind me: is it possible to set the length of a single string? as opposed to setting the length of an array of strings? addendum: even better, the .hex files are already plain text containing ascii hex digits. this makes things even easier. rob :-) |
||||
JTR0701 Regular Member ![]() Joined: 10/07/2013 Location: AustraliaPosts: 71 |
Well, it is not as bad as it seems. In truth you really need to be able to shift anything from 1 bit up to 33 bits so two operations of variable bit count was something that you were going to find useful anyway. BTW, there is absolutely no carry bit in the PIC32 ISA so you are no worst off over assembler using your HLL in this regard. However those native bit field instructions... ![]() |
||||
MOBI Guru ![]() Joined: 02/12/2012 Location: AustraliaPosts: 819 |
The data I/O to/from the target PIC is in serial form, so for that I can change to using a couple of arrays which I can "shift" using for/next loops. Most of the programming routines have been written, so in a few days I should be able at least to erase a PIC. We have Adelaide University acoustics team coming to conduct another sonic profile of our home on Tuesday for 5 days, so I will only be able to do software development, not hardware tests as the team requires the house to be unoccupied for the duration. David M. |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3303 |
What on earth is that about (I just had to ask)? Geoff Graham - http://geoffg.net |
||||
psergiu![]() Regular Member ![]() Joined: 09/02/2013 Location: United StatesPosts: 83 |
He's a borrower and he lives in a grand piano. ![]() |
||||
vasi![]() Guru ![]() Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
What on earth is that about (I just had to ask)? He's a borrower and he lives in a grand piano. ![]() And who can do better than Japanese? Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
MOBI Guru ![]() Joined: 02/12/2012 Location: AustraliaPosts: 819 |
Just explaining why my progress might be a little slow. I don't live in a grand piano, but my old faithful guitar and button accordion help to maintain a modicum of sanity. Back on topic, the more I progress with the MM based programmer, the more I think it will be impossibly slow but not impossible. Time will tell. David M. |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3303 |
I don't think that speed will be important given the original intent was to just program a Micromite. It is a one off, and if it takes half an hour, who cares? For someone who has a Maximite and wants to play with the Micromite this will be invaluable. Geoff Geoff Graham - http://geoffg.net |
||||
atmega8![]() Guru ![]() Joined: 19/11/2013 Location: GermanyPosts: 727 |
Time doesn' t really matter. |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |