Continue to Site

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.

Flash memory in pic16f887

Status
Not open for further replies.

VRL_15

New Member
I need to write the data to the flash memory by I2C communication and then read the same.
If anyone has an idea, please let me know

Thanks
 
Assuming it has writeable program memory (and I expect an 887 has) then you do it the same way as any other write to program memory. However, why are you wanting to use I2C to do it? - it seems a bit obscure?.
 
the writing to flash memory code in the datasheet didn't work for me.

Is there any specific directive org command to access flash and EEPROM?

is there any another option or any useful tutorial that can help me out?

Thanks
 
Last edited:
i am trying to use an external memory and transfer the data from stored flash memory in PIC to it by I2C.

I think I am not going in the right direction.

Can you guide me in this.

I will start all over.

I need to record some data, write it to flash memory of PIC read it and also send it to external memory module by I2C communication.

I hope I made the question clear

please tell me the correct approach
 
Last edited:
Flash program memory may only be written to if the
destination address is in a segment of memory that is
not write-protected, as defined in bits WRT<1:0> of the
Configuration Word Register 2.

The datasheet of PIC16f887 states as above.

But how to access Configuration Word Register 2??????
 
Last edited:
Flash program memory may only be written to if the
destination address is in a segment of memory that is
not write-protected, as defined in bits WRT<1:0> of the
Configuration Word Register 2.

The datasheet of PIC16f887 states as above.

But how to access Configuration Word Register 2??????

Haven't you tried looking at the template in MPLAB for the chip?, here's the config settings for a 16F1827 which also has two config registers.

__CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_OFF & _MCLRE_ON & _CP_OFF & _CPD_OFF & _BOREN_OFF & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF
__CONFIG _CONFIG2, _WRT_OFF & _PLLEN_OFF & _STVREN_OFF & _BORV_19 & _LVP_OFF
 
Status
Not open for further replies.
Back
Top