Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 13:41 17 Sep 2025 Privacy Policy
Jump to

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 4 of 28    
Author Message
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 02:29am 29 Apr 2014
Copy link to clipboard 
Print this post

  Quote  Using mmbasic still needs a way to program the first chip with mmbasic, whereas OpenOCD+dongle would do everything.


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 Kingdom
Posts: 4071
Posted: 03:46am 29 Apr 2014
Copy link to clipboard 
Print this post

  vasi said   Here is a great open source programmer, actively developed. Can do PIC and AVR, 24x memories, 1wire devices, and soon a lot of great features:
[quote="Alberto Maccioni"]increase support for PIC and ATMEL micros (as soon as I can get free samples); add ST72, JTAG, parallel memories; expand ICD support; compile firmware also with SDCC [/quote]

Definitely, something to keep an eye on.


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: Romania
Posts: 1697
Posted: 05:17am 29 Apr 2014
Copy link to clipboard 
Print this post

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 States
Posts: 282
Posted: 10:44am 29 Apr 2014
Copy link to clipboard 
Print this post

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: Romania
Posts: 1697
Posted: 01:14pm 29 Apr 2014
Copy link to clipboard 
Print this post

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?Edited by vasi 2014-04-30
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
JTR0701
Regular Member

Joined: 10/07/2013
Location: Australia
Posts: 71
Posted: 07:40pm 29 Apr 2014
Copy link to clipboard 
Print this post

  robert.rozee said   it occurs to me that programming the interpreter into a 32MX150 (aka micromite) is relatively straight forward from the electrical perspective.
why hasn't anyone done this yet? better still, someone might care to take up the challenge. a solution quite specific to the 32MX150.

yes, i am aware that general-purpose pic programmers are available at a price, but i am asking this question specifically in relation to not using one of these.


rob :-)


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: Australia
Posts: 819
Posted: 09:04pm 29 Apr 2014
Copy link to clipboard 
Print this post

  Quote  JTR0701



robert.rozee wrote:


it occurs to me that programming the interpreter into a 32MX150 (aka micromite) is relatively straight forward from the electrical perspective.
why hasn't anyone done this yet? better still, someone might care to take up the challenge. a solution quite specific to the 32MX150.

yes, i am aware that general-purpose pic programmers are available at a price, but i am asking this question specifically in relation to not using one of these.


rob :-)

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.



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: Australia
Posts: 819
Posted: 04:31pm 30 Apr 2014
Copy link to clipboard 
Print this post



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.


Edited by MOBI 2014-05-02
David M.
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 07:42pm 30 Apr 2014
Copy link to clipboard 
Print this post

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: Australia
Posts: 819
Posted: 08:08pm 30 Apr 2014
Copy link to clipboard 
Print this post

  TZA said  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


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: Australia
Posts: 819
Posted: 02:07am 04 May 2014
Copy link to clipboard 
Print this post

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 Zealand
Posts: 2447
Posted: 03:04am 04 May 2014
Copy link to clipboard 
Print this post

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 :-)Edited by robert.rozee 2014-05-05
 
JTR0701
Regular Member

Joined: 10/07/2013
Location: Australia
Posts: 71
Posted: 05:48am 04 May 2014
Copy link to clipboard 
Print this post

  MOBI said   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.


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: Australia
Posts: 819
Posted: 12:33pm 04 May 2014
Copy link to clipboard 
Print this post

  Quote  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.


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: Australia
Posts: 3303
Posted: 01:00pm 04 May 2014
Copy link to clipboard 
Print this post

  Quote  We have Adelaide University acoustics team coming to conduct another sonic profile of our home

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 States
Posts: 83
Posted: 01:52pm 04 May 2014
Copy link to clipboard 
Print this post

  Geoffg said  
  Quote  We have Adelaide University acoustics team coming to conduct another sonic profile of our home

What on earth is that about (I just had to ask)?

He's a borrower and he lives in a grand piano.
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 02:07pm 04 May 2014
Copy link to clipboard 
Print this post

  psergiu said  
  Geoffg said  
  Quote  We have Adelaide University acoustics team coming to conduct another sonic profile of our home

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: Australia
Posts: 819
Posted: 02:41pm 04 May 2014
Copy link to clipboard 
Print this post

  geoff said  What on earth is that about (I just had to ask)?


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: Australia
Posts: 3303
Posted: 04:24pm 04 May 2014
Copy link to clipboard 
Print this post

  MOBI said  the more I progress with the MM based programmer, the more I think it will be impossibly slow but not impossible. Time will tell.

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: Germany
Posts: 727
Posted: 05:38am 05 May 2014
Copy link to clipboard 
Print this post

Time doesn' t really matter.

 
     Page 4 of 28    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025