PDA

View Full Version : READCODE and WRITECODE for a PIC16F727



rsocor01
- 28th June 2010, 04:10
Hi all,

I am using a PIC16F727 for one of my projects. This chip doesn't have EEPROM memory in it. So, instead of using external EEPROM memory I would like to know if I can use the READCODE and WRITECODE in this chip.

One of the requirements to use these commands is that the chip must be able to access their own Flash memory. But, where do I find this info in the datasheet? How do I know if I can use these two commands in a PIC by reading the datasheet?

Thank you all for your help,

Robert

ScaleRobotics
- 28th June 2010, 05:25
Some of the 16F's do, but not your 16F727. Look for something like this in the data sheet:



• Self-Programmability: These devices can write to
their own program memory spaces under internal
software control. By using a bootloader routine,
located in the protected Boot Block at the top of
program memory, it becomes possible to create an
application that can update itself in the field.
You can also use the old MAPS utility, and highlight your chip, and look at the Self Write Flash option to see if there is a yes by it:

http://www.picbasic.co.uk/forum/attachment.php?attachmentid=4577&d=1277699117

rsocor01
- 29th June 2010, 21:58
scalerobotics,

Thank you for your answer. In what section of the datasheet would you find this note? Did you find it in "Device Overview" or maybe in "Special Features of the CPU"?


• Self-Programmability: These devices can write to
their own program memory spaces under internal
software control. By using a bootloader routine,
located in the protected Boot Block at the top of
program memory, it becomes possible to create an
application that can update itself in the field.

I am currently using external EEPROM memory, and I was hoping to get rid of this extra component by using the READCODE and WRITECODE commands. But, now I know I can't get rid of this external EEPROM memory. Thank you again.

Robert

ScaleRobotics
- 30th June 2010, 01:12
No problem. On the PIC18F2520 it is located in section 1.2. But on the PIC16F887, I just see a short reference in section 10.0
Depending on the setting of the Flash Program
Memory Self Write Enable bits WRT<1:0> of the
Configuration Word Register 2, the device may or may
not be able to write certain blocks of the program
memory.

So, no, its not real clear.

rsocor01
- 30th June 2010, 03:57
Scalerobotics,

Thank you for your help. Your response is really helpfull.

Robert