Searching \ for '[EE] The limited usefullness of RTP of the PIC32 P' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'The limited usefullness of RTP of the PIC32 P'.

Exact match. Not showing close matches.
PICList Thread
'[EE] The limited usefullness of RTP of the PIC32 P'
2012\05\30@104449 by Electron

flavicon
face

Hi!
it is my understanding that runtime programming of the non-volatile memory
of the PIC32 is much less useful than it used to be on the dsPIC:

not only the PIC32 has no EEPROM memory but also, unlike the dsPIC which
allowed erase and programming of very small Program Flash memory regions,
on the PIC32 you must erase 4KB (!) of Program Flash memory in order to
re-program it, even just to update a single variable!

Even worse, if you just want to updated e.g. a non-volatile counter, not
only you must erase 4KB of Program Memory and reprogram it from scratch,
but you clear also need a 4KB temporary RAM buffer to hold the original
data, modify it in RAM, and then erase and program the whole 4KB chunk (!).

Is it really like this or I'm dreaming (incubus..)?

For example this completely rules out the PIC32MX110F016B, as it only has
4KB of RAM.. having that extra boot flash memory doesn't help here, when
the limiting factor is the RAM.

With kind regards,
Mario

2012\05\30@110655 by Ariel Rocholl

picon face
Mario,

I think this topic has been discussed here a number of times. For instance
PIC24 has pretty much the same limitation.

The way you may want to work is not re-writting the whole 4KB block
everytime, but with a bit more ellaborated algorithm, update your variable
in a subset of the region with increasing address, and always read from the
last one you sign in any particular way is useful in your application (e.g.
one byte for actual data, next byte for marking "data used" with anything
different than 0xFF). That increase flash lifetime as reduce erase cycles,
but also reduce the number of times you need to go to the expensive whole
block erase/rewrite.

Another option is to alternatively use 2 blocks of flash, 4KB each, one
will swap into the other once is full, and act as a backup so you can
freely erase one block and keep the other one, with basically no use of RAM
for that.

Also note you need to use 4KB of RAM if all the memory positions are
actually useful (real data) otherwise you need only a fraction of that to
maintain your real data only, not the whole block.

Welcome to the non-EEPROM MCU world, anyway ;)

Hope this helps.
-- Ariel Rocholl
http://www.rf-explorer.com

On Wed, May 30, 2012 at 4:44 PM, Electron <spam_OUTelectron2k4TakeThisOuTspaminfinito.it> wrote:

{Quote hidden}

>

2012\05\30@121045 by Isaac Marino Bavaresco

flavicon
face
Microchip has an application note that does exactly what you describe here.
I don't know if it was updated for the PIC32 yet.

Isaac


Em 30/5/2012 12:06, Ariel Rocholl escreveu:
{Quote hidden}

> Hope this helps.

2012\05\30@225814 by Matt Bennett

flavicon
face
On Wed, May 30, 2012 9:44 am, Electron wrote:
{Quote hidden}

You really need to dig deep into Section 5 of the PIC32 family reference
manual.  I haven't done a PIC32 bootloader, but the process isn't all that
different between parts. The PIC32 (like all PICs) when doing
self-programming, must erase a full page (at least)- in the case of the
PIC32- 4KBytes. But when programming, you can program a single word (4
Bytes) or a row, 128 words (512 Bytes).

Don't forget that "erasing" a flash cell is really setting the value to
"1" While I haven't done it on a PIC32, you can do some tricks on other
PICs, such as telling it to program a "1" to a cell that is already zero-
in that case (on the PIC18s I remember most clearly, I suspect that PIC32
will act the same way), nothing happens- programming will only set a flash
cell low- you have to do a full page erase to set any cell high.

Regards,

Matt Bennett
Just outside of Austin, TX
30.51,-97.91

The views I express are my own, not that of my employer, a large
multinational corporation that you are familiar with

2012\05\31@083747 by Electron

flavicon
face

Dear Ariel,


At 17.06 2012.05.30, you wrote:
{Quote hidden}

Yes, it is my understanding that programming "0"'s in FLASH memory can be
done any time, the problem is when you need to program "1"'s, in which case
you must erase the whole page. Is this correct?

So it is actually the erase the "consumes the life" of the FLASH memory,
not the program ("set bit to 0") phase?


>Another option is to alternatively use 2 blocks of flash, 4KB each, one
>will swap into the other once is full, and act as a backup so you can
>freely erase one block and keep the other one, with basically no use of RAM
>for that.
>
>Also note you need to use 4KB of RAM if all the memory positions are
>actually useful (real data) otherwise you need only a fraction of that to
>maintain your real data only, not the whole block.

Yes, of course, and I even thought about compressing/inflating the data,
but you don't have a guarantee about compression ratios, and anyway in the
MPU world we already tend to fit as much as possible into memory so.. ;)


>Welcome to the non-EEPROM MCU world, anyway ;)

:D


>Hope this helps.

Thanks.

Cheers,
MarI/O


{Quote hidden}

>> -

2012\05\31@092735 by Electron

flavicon
face

Dear Matt,

Thanks, all is more clear now.

Speaking about boot loaders, I was much interested in the following but the link
is broken, and extensive googling didn't help at all.. as you work for "a large
multinational corporation that we are familiar with" ;) could you help to fix
that broken link please?

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en025788

If I click on the file to download it, the following link results broken:

http://ww1.microchip.com/downloads/en/studioresource/en002814.zip

As I wrote, there was no way for me to find en002814.zip anywhere on the Net.

It's a serial bootloader for PIC32.. just what I need! Although I'm writing my
own, that may be a good reference anyway for me to peek at.

Cheers,
Mario


At 04.58 2012.05.31, you wrote:
{Quote hidden}

>

2012\05\31@093510 by Isaac Bavaresco

flavicon
face


It seems that my first post was lost.

Microchip's AN1095 solves exactly this problem.

Isaac



------------------------------
Em qui, 31 de mai de 2012 09:27 BRT Electron escreveu:

{Quote hidden}

>> -

2012\05\31@105428 by Matt Bennett

flavicon
face
On Thu, May 31, 2012 8:27 am, Electron wrote:
{Quote hidden}

I have absolutely no idea what you are talking about. I speak only for
myself, of course. And the voices in my head, but they are part of me,
right?

Just doing a little poking around of the Microchip website- There is an
app note that talks about various ways to bootload, including UART- it has
some pretty recent updates- could be that the old file was superseded. The
app note is AN1388:
<http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en554836>

Regards,

Matt Bennett
Just outside of Austin, TX
30.51,-97.91

The views I express are my own, not that of my employer, a large
multinational corporation that you are familiar with

2012\05\31@114556 by Electron

flavicon
face

Dear Isaac,

At 15.35 2012.05.31, you wrote:
>
>
>It seems that my first post was lost.
>
>Microchip's AN1095 solves exactly this problem.

Thanks, going to take a look at it now.

With kind regards,
Mario

{Quote hidden}

>>> --

2012\05\31@114600 by Electron

flavicon
face


PS: by the way just found this very interesting application note, about a PIC32 bootloader:
http://ww1.microchip.com/downloads/en/AppNotes/01388B.pdf


At 15.35 2012.05.31, you wrote:
{Quote hidden}

>>> --

2012\05\31@115253 by Electron
flavicon
face

Ouch.. thank you, I had just stumbled upon it too. I just printed it, it looks
very interesting, now I've taken a full liter of laxative as I have a rule:
these papers must be read during toilet time only. :)

Jokes apart, I have two 1 bln$ questions, if you don't mind:

1) is there a HEX to BIN converter for the PIC32? I know the HEX format is
standard, and I even tried to write my own converter, but on some things like
configuration registers I don't seem to be able to decodify correctly the HEX.

2) I have just upgraded to MPLAB v8.85: XC32 is just a new name for C32 compiler?

Thanks!

Cheers,
MarI/O


At 16.54 2012.05.31, you wrote:
{Quote hidden}

>

2012\05\31@120610 by alan.b.pearce

face picon face
> 2) I have just upgraded to MPLAB v8.85: XC32 is just a new name for C32 compiler?

The XC series compilers (there are also XC8 and XC30) seem to be designed for use with MPLAB-X across multiple platforms --- and appear to use a new licensing model, no longer the buy it once, update forever for free.

I believe the XC series are developed from the Hi-Tech range, which already had a multi-platform development model, and is hence the reason Microchip bought Hi-Tech.
-- Scanned by iCritical.

2012\05\31@145545 by Matt Bennett

flavicon
face
On Thu, May 31, 2012 10:52 am, Electron wrote:

> 1) is there a HEX to BIN converter for the PIC32? I know the HEX format is
> standard, and I even tried to write my own converter, but on some things
> like
> configuration registers I don't seem to be able to decodify correctly the
> HEX.

I am not aware of one. I'd be a little afraid of something like that,
particularly over a UART connection- considering the chance of sending
special characters that could break your character stream.

> 2) I have just upgraded to MPLAB v8.85: XC32 is just a new name for C32
> compiler?

As far as I am aware, yes, but it is also part of a larger effort- to just
have 3 Microchip compilers- an 8 bit (XC8) a 16 bit (XC16) and 32 bit
(XC32). The 8 bit compilers are mostly derived from hi-tech, the 16 and 32
bit mostly from gcc. I think the biggest change in appearance is that
there is just one (*1*) 8 bit compiler (from Microchip)- no
differentiation (at least to the user) between PIC10, PIC12, PIC16, and
PIC18(*)(**).


*Do not talk of PIC17.

**Or licensing. Like I said, these are just the rumblings of the voices in
my head, and are not connected to reality or any company I have been, am
now, or will associate with.(***)

*** or my grammar.  I'm an engineer.(****)

**** I also like KITTIES! I'm always ready to talk about kitties!

Matt Bennett
Just outside of Austin, TX
30.51,-97.91

The views I express are my own, not that of my employer, a large
multinational corporation that you are familiar with

More... (looser matching)
- Last day of these posts
- In 2012 , 2013 only
- Today
- New search...