Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 02:42 18 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 10 of 28    
Author Message
JTR0701
Regular Member

Joined: 10/07/2013
Location: Australia
Posts: 71
Posted: 07:56pm 15 Jun 2014
Copy link to clipboard 
Print this post

Where xxx = revision number.

Yes ripe_11_00301 is the latest revision and this is the droid you want.

Keep in mind that once there was only one PE for the PIC32 so a lot of older documentation simply refers to PE32 as if it was the only PIC32 PE. There are now three PIC32 PEs so there is a trap for the unwary. You can see the three different PEs in Serge's source code and work out what the difference is between them.

Getting the right information from microchip, especially for things like programming, has over the years (and I have been around and once was "almost famous")has been bit of an art. However in this case the links to the various PEs for the different PIC32s is actually included in the product page for each device. Surprisingly it is found under the category named "Programming Specifications." What were microchip thinking? How did they fluke this. Some years ago this stuff was impossible to find...






 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 08:22pm 15 Jun 2014
Copy link to clipboard 
Print this post

  jtr said  Surprisingly it is found under the category named "Programming Specifications."


Thanks for that - I suppose with a bit more searching I should have found it but I must confess that over the years I have found that Mchip tend to bury important data in obscure and only semi related places and even then in fine print or as an afterthought. So surprising to see it in an "obvious" place. It is about time they got their s..t in one pile so to speak. It is even possible I looked there a year or two ago but then, I wasn't serious about trying to programme a pic32, only curious. Thought it would be a bit like 8 bit pics - how wrong! When they started talking about PEs, I said "been there done that" and bought a PICKit3.

Do you know if the previous versions of PE for pic32 would work anyway?


David M.
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1314
Posted: 08:23pm 15 Jun 2014
Copy link to clipboard 
Print this post

  JTR0701 said  
Getting the right information from microchip, especially for things like programming, has over the years (and I have been around and once was "almost famous")has been bit of an art.


"almost famous"
That is sounding very much like a person I was involved with for many years, and the "JR" initials are correct. A google allows the full name to fall out.

Hi Jim, how's it going?
You still jumping out of perfectly good aircraft?

Cheers Don...

Edited by donmck 2014-06-17
https://www.dontronics.com
 
JTR0701
Regular Member

Joined: 10/07/2013
Location: Australia
Posts: 71
Posted: 10:05pm 15 Jun 2014
Copy link to clipboard 
Print this post

  donmck said  
  JTR0701 said  
Getting the right information from microchip, especially for things like programming, has over the years (and I have been around and once was "almost famous")has been bit of an art.


"almost famous"
That is sounding very much like a person I was involved with for many years, and the "JR" initials are correct. A google allows the full name to fall out.

Hi Jim, how's it going?
You still jumping out of perfectly good aircraft?

Cheers Don...



Ok, so I'm Busted! Next thing you know someone will be asking me about the TEC-1.

OMG, You still alive OD? Didn't know that cryogenics had advanced so much.

Well there is at least one person on this forum who *might* believe I know what I am talking about.

Still have all my gear but I haven't jumped for some years. Maybe again, maybe not. Not a cheap thing to do and since the "parting" any work I've done has been non paying, not always by choice either...

So you have shifted house. After 30 what? years you really turned out to be a fly-by-nighter. I knew it, I just knew it.

Don't get out much these days but if the car is pointing north-east and I have stolen enough fuel, then you better have a tea bag ready.

BTW, still have the "birthday present" you sent me in front of me. Have written three USB stacks for it in C, MIPS32 assy and MIPS16e assy just for kicks. (I also like sticking needles into my eyeballs for fun...) Was looking at getting a color maximite converter PCB but my MX460 version UBW has only has 32K RAM. No good for a color Maximite.

Anyway, won't let this get too OT but leave you with the threat that I might come calling one day.

Cheers, Jim


 
JTR0701
Regular Member

Joined: 10/07/2013
Location: Australia
Posts: 71
Posted: 10:12pm 15 Jun 2014
Copy link to clipboard 
Print this post

  MOBI said  
  jtr said  Surprisingly it is found under the category named "Programming Specifications."


Thanks for that - I suppose with a bit more searching I should have found it but I must confess that over the years I have found that Mchip tend to bury important data in obscure and only semi related places and even then in fine print or as an afterthought. So surprising to see it in an "obvious" place. It is about time they got their s..t in one pile so to speak. It is even possible I looked there a year or two ago but then, I wasn't serious about trying to programme a pic32, only curious. Thought it would be a bit like 8 bit pics - how wrong! When they started talking about PEs, I said "been there done that" and bought a PICKit3.

Do you know if the previous versions of PE for pic32 would work anyway?



You are right about microchip. I fought them hard for years for proper documentation and squashed many of their bugs in the programming specs. Now that they are semi organised, well that is a surprise indeed.

The older PE is much larger in size and has more commands (some undocumented) but as to whether it works with the MX1xxx and MX2xx or not is not something I can be sure about. The Row program size is different so they is a potential incompatibility there. Given you are working from scratch I could not recommend using the old PE. It is just another variable that is unknown.
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 11:45pm 15 Jun 2014
Copy link to clipboard 
Print this post

  Jim said  The older PE is much larger in size and has more commands (some undocumented) but as to whether it works with the MX1xxx and MX2xx or not is not something I can be sure about. The Row program size is different so they is a potential incompatibility there. Given you are working from scratch I could not recommend using the old PE. It is just another variable that is unknown.


When I get something happening in the programming department and have trialled the current PE, there's nothing to stop me from loading the earlier version and trying it. I've got to get that far yet as we'll be off to UK and Holland for about 7 weeks soon and I don't think my prepaid usb modem will work over seas (it is Telstra). I might just buy a cheap on whilst there, though a couple of the places I'll be staying have wifi.


David M.
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1314
Posted: 02:55am 16 Jun 2014
Copy link to clipboard 
Print this post

  JTR0701 said  
So you have shifted house. After 30 what? years you really turned out to be a fly-by-nighter. I knew it, I just knew it.

snip---

Anyway, won't let this get too OT but leave you with the threat that I might come calling one day.

Cheers, Jim


Shifted?, no same house for 40 years. I mask it on google street view for obvious privacy reasons.

You are welcome anytime.

Cheers Don...
https://www.dontronics.com
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4071
Posted: 06:44am 16 Jun 2014
Copy link to clipboard 
Print this post

Don - I'm surprised it took you so long, I did drop a hint a while back about USB stack(s).

But I figured he was happy being "unknown" (un-outed sounds iffy) so left it at that.

(Not that I knew you knew him.)

John
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1314
Posted: 11:43am 16 Jun 2014
Copy link to clipboard 
Print this post

  JohnS said   Don - I'm surprised it took you so long, I did drop a hint a while back about USB stack(s).
John


Obviously the hint didn't get me across the line John.

I must admit, I haven't spent much time on TBS in recent months, as I have a few people very close to me, in serious trouble with their health.

However I can tell you a little bit about Jim (JTR0701), as he can hardly blow his own trumpet here, can he.

Amongst many other projects credited to him, Jim was the designer, manufacturer, (and programmer) for the well known, and world class Warp-13 PIC programmer and its predecessors. I believe his knowledge was as good as any body that wasn't employed internally within Microchip. He lead the rest of the bunch for many years.

I am one person that was involved with, and followed PIC programming from the days when we used a free call modem connection all the way to Microchip's original BBS in Arizona, which mutated eventually into the PIClist when the real Internet came along. On this BBS you got involved with people like David Tait, the designer of the first home brew PIC programmer for the F84 family, which ran off a parallel printer port.

Cheers Don...
https://www.dontronics.com
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4071
Posted: 11:54am 16 Jun 2014
Copy link to clipboard 
Print this post

Sorry to hear about the health troubles.

That's a ton of stuff about PICs & Jim I didn't know. I "just" found some USB stuff and quite recently at that, then googled a bit to see if it was the same person when he appeared on TBS.

John
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4071
Posted: 10:53pm 26 Jun 2014
Copy link to clipboard 
Print this post

A bit of a thread revival...

I decided to use the FT232RL USB-serial board I bought and using it I can talk from PC to target PIC32 ICSP.

I have the rough equivalent of Keith's program working.

It's written in C, currently only tested on Linux but using a lib that is available on Windows so "should" recompile.

Now to figure out more of that Flash Programming spec and the PE, if needed/wanted.

If I get it working then it's a PIC32 programmer running on a PC for $whatever price you feel inclined to pay for a FT232RL board (mine was about $3.50).

I've ordered some CP2104 boards and if they also work then I'll probably move to those. (No idea if they're clones...)

John
 
Keith W.
Senior Member

Joined: 09/10/2011
Location: Australia
Posts: 118
Posted: 02:13am 27 Jun 2014
Copy link to clipboard 
Print this post

Well done John,

Although the original task was to use MMBAsic, that your method only requires a USB chip or module will be cost effective, and most all people have a PC anyway. Please continue with the FT232RL. As you are looking at this method I had best ‘fess up that I have discovered a similar method on the web, the link to which is here: - I hope the link works?

Programmer

The source code contained within the JTAG-you're-it - Aug 02 2012.zip downloadable directory found within the above will hopefully help you. That JTAG is used here can be expanded up to ICSP which you have already conquered.

In this project a MCP2200 USB chip is used and after loading the PE the author initially uses a UART interface and then after more development a USB interface to communicate to a Microchip PC bootloader application. In our Micromite case the chip does not support USB.

Manipulating the USB chip hardware to communicate with the subject chip JTAG initially is slow to get in the PE, as detailed in the discussion. It will likely be faster than ICSP.
Microchip document “AN1388” and “AN1388 source code” I think gives suitable PC Bootloaders.
To be investigated is perhaps the PE is placed into Flash, which may cause a problem due to the Micromites total Flash requirement?

Good luck.
Keith W.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4071
Posted: 05:45am 27 Jun 2014
Copy link to clipboard 
Print this post

D'oh! Might as well use that MCP2200.

Oh it's not that cheap so maybe not.

Interesting project and I'm disappointed my googling didn't find it - must try harder apparently.

I need to apologise to MOBI as I especially meant his (& your) work.

Anyway, thanks to everyone who's helped so far.

I imagine what I'm doing will be s-l-o-w due to the USB round-trip latencies. Oh well.

John
 
Keith W.
Senior Member

Joined: 09/10/2011
Location: Australia
Posts: 118
Posted: 03:56pm 27 Jun 2014
Copy link to clipboard 
Print this post

John,

Do not be despondent. I could not believe that others had not built a programmer and published. I searched hard but found surprisingly little. Your effort already has improved your understanding of the task the hard way. Working in ‘C’ I hope that the information found here aids you in pressing forward to load the PE.

And then the next task to tackle of communicating with the Loader to the PE, likely using the subject chips Uart as Microchip Loaders appear to offer this option. It seems very similar to the Loader used by Geoff for software updates with his VT100 Terminal project. But Geoff is communicating here via USB with a PE already in Flash, as I think is the eventual case in the above found method? Geoff’s Microchip Loader does/did have provision for serial connection. Perhaps Geoff could comment about this part of the process?

Keith W.
Edited by Keith W. 2014-06-29
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4071
Posted: 07:41pm 27 Jun 2014
Copy link to clipboard 
Print this post

I didn't know Geoff did anything related to this (all I know about the VT100 is what's been on TBS).

It looks like I just need to do the right XferInstruction calls and so on. It looks like it'll be a binary test: works or doesn't, but will try and see.

I hope to just stick to USB & PGC/PGD rather than have more wires. (I love the way "2-wire ICSP" uses 4 wires!! MCLR, PGC, PGD, GND.)

John
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 11:11pm 27 Jun 2014
Copy link to clipboard 
Print this post

@JohnS,

A bit more encouragement. I downloaded the latest MPLABX IPE and verified that the chip erase function is actually working on the MM and uM versions of the pic programmer. That means that all timing etc is good and that most of the "sendCommand", "xferData" functions are working.

Like you, I have a lot of "it works or it doesn't" occasions.

I like the tongue in cheek comment about the 2 wire being 4 wire but I suppose it you leave out the vss/vdd lines there are actually only 2 wires doing the programming. MCLR is a control line.

Anyway, the hope is that soon I'll be transferring to a new thread using just the MMite to do the programming in an effort to allow this one to be a "PC to programmer" variation such as was Rob's initial post.


David M.
 
Keith W.
Senior Member

Joined: 09/10/2011
Location: Australia
Posts: 118
Posted: 11:25pm 27 Jun 2014
Copy link to clipboard 
Print this post

John,

Why did I mention Geoff above?
Geoff has given a link to his Terminal page: - Geoff Terminal
At the bottom of this page you may download a file “Terminal Source” which includes a subdirectory “PC App” that contains a PC program “PIC32UBL.exe”of size 264 KB, also a PDF instruction.
When you run this application it looks similar to that found by downloading “AN1388 Source Code” from: -

AN1388 Code

Which when run expands to be a directory “PIC32_Bootloaders” that in turn contains “PC Application” containing PIC32UBL.exe size 264KB and same Icon. Also another directory containing I think its source code. I believe that this is probably the application used in the “JTAG You’re It” project to finally communicate with the PE to program the chip. From this page: -

“UART bootloader is working!

I can now use Microchip's PC bootloader application to connect to the device, erase-program-verify and run the program! Most of the time is taken up by the erase, which lasts about 3 seconds, and the actual flashing of a ~5k hello world app takes about half a second.”

Geoff’s method with the PC Application is to enable subsequent updates without a PicKit3 and works because the chip has been programmed using a PCKit3 to contain at least a Loader (PE?) plus the initial Terminal application. I am suggesting therefore that Geoff might know a little, more than me anyway, about Loaders/PE’s/PIC32UBL applications.

Keith W.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4071
Posted: 12:44am 28 Jun 2014
Copy link to clipboard 
Print this post

Ah. It looks to be a variant of the Mchp bootloader. That can interact with things like mphidflash (so, things like Pinguino) or indeed PIC32UBL.

I think programming the uC the first time still needs a PICkit3 or suitable replacement.

John
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3303
Posted: 05:05am 28 Jun 2014
Copy link to clipboard 
Print this post

The bootloader uses a completely different technique from a programmer- even though they both achieve a similar outcome. So it is not much help here.
Geoff Graham - http://geoffg.net
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 01:51am 30 Jun 2014
Copy link to clipboard 
Print this post

2014-06-30_113917_MMprog32.zip

I know you guys are working on a different approach to me but maybe you can help me with a little problem.

I am trying to get the XferInstruction function to work but for some reason, the 32 bit data read back from the XferData (hextobin$("0004c000")) is displaced one place to the left.

Sub xferInstruction (st$)
SendCommand (etap_control$)
Do
xferdata (hextobin$("0004c000"))
Loop Until Mid$(outdata$,14,1) = "1"
SendCommand (etap_data$)
XferData (hextobin$(st$))
sendcommand (etap_control$)
xferdata (hextobin$("0000c000"))
End Sub


The rest of the code is in the zip but I've pulled a lot out to make it easier to read until I can get this problem cured.

The programme is menu driven so that individual functions can be selected and tested.
Has anyone else got the XferInstruction working in another format? Just about run out of ideas. Getting square eyes.
David M.
 
     Page 10 of 28    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025