Searching \ for '[PIC] RE: Read Flash of PIC16F916' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page:
Search entire site for: 'RE: Read Flash of PIC16F916'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] RE: Read Flash of PIC16F916'
2012\04\10@145128 by AdiCH


Hi Mike

Thanks you very much for your answer.
Here is the c function that works now for me:

unsigned int ReadFlash( unsigned int address ) {
   EEADRL = address%256;
   EEADRH = address/256;
   EEPGD = 1; // program memory
   RD = 1;    // read
   return EEDATH*256 + EEDATL;

It was the point that only a semicolon is not a nop in the compiled code. So
it worked during debugging but not during the normal release version.

I used a lot of time to solve this now and I got also a wrong answer from
the microchip support that sad that the current compiler does not support
this functions.

Many thanks again you helped me a lot.


-- View this message in context:
Sent from the PIC - [PIC] mailing list archive at

2012\04\10@150521 by Jan-Erik Soderholm

face picon face
> ...that the current compiler does not support this functions...

What is "this functions" more specificaly ?

Since it's all done through direct access to the SFR's,
I do not see how it can't be supported. The compiler
have no idea what the different SFR's does.

It's a bit hard to comment on the reply from support when
we don't have the question they replied to.


AdiCH wrote 2012-04-10 20:51:
{Quote hidden}

2012\04\10@154252 by Isaac Marino Bavaresco

Just out of curiosity, from where did you get the idea that a semicolon
alone would produce a NOP?


Em 10/4/2012 15:51, AdiCH escreveu:
{Quote hidden}


2012\04\10@162637 by Michael Rigby-Jones


{Quote hidden}

I think the point is that the compiler could/should have built in support for reading program memory.  Certainly this was the case in the older versions of PICC I used to use where any data type defined as 'const' would be located in program memory and the compiler would automatically use the appropriate method for accessing the data so there was no need to mess around with SFR's.  I'm a bit surprised that functionality doesn't exist in the current version however; perhaps the OP is using an old version of the compiler on a much newer device?.



This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or

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