Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Writing to Prg flash memory

Status
Not open for further replies.

Mosaic

Well-Known Member
16f886 is the chip.

The datasheet has me a bit confused.

On the same page it says:

When accessing the program memory block of the
PIC16F886/PIC16F887 devices, the EEDAT and
EEDATH registers form a 2-byte word that holds the
14-bit data for read/write, and the EEADR and
EEADRH registers form a 2-byte word that holds the
12-bit address of the EEPROM location being read.
The EEPROM data memory allows byte read and write.
A byte write automatically erases the location and
writes the new data (erase before write).
The write time is controlled by an on-chip timer. The
write/erase voltages are generated by an on-chip
charge pump rated to operate over the voltage range of
the device for byte or word operations.

Then it says:

EECON1 is the control register for EE memory
accesses.
Control bit EEPGD determines if the access will be a program
or data memory access. When clear, as it is when
reset, any subsequent operations will operate on the data
memory. When set, any subsequent operations will operate
on the program memory. Program memory can only
be read
.

So which is it...or what am I missing here?
 

Pommie

Well-Known Member
Most Helpful Member
I can only assume it's a typo because the flash program memory can definitely be written to.

Mike.
 

Mosaic

Well-Known Member
Then it worx like EEPROm, except for the EEPGD bit setting and the high address?
 

Pommie

Well-Known Member
Most Helpful Member
Then it worx like EEPROm, except for the EEPGD bit setting and the high address?

Plus you have to write a block of data each time. Writing to a single location requires that you read the surrounding locations and write the block.

Mike.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top