Page 1 of 1

Writting to flash on PIC

Posted: Wed Jun 25, 2014 1:09 pm
by mikn
Are there any way to write my data to flash program memory on PIC24? It does not have EEPROM so I want to use free flash space. Can this be done via FC or should I implement C/ASM code?

Re: Writting to flash on PIC

Posted: Wed Jun 25, 2014 1:34 pm
by Rudi
mikn wrote:Are there any way to write my data to flash program memory on PIC24? It does not have EEPROM so I want to use free flash space. Can this be done via FC or should I implement C/ASM code?
hi mikn,
PIC24FJ256 Family EEprom that not have eeprom can emulation capable..
perhabs the same:
http://www.matrixtsl.com/mmforums/viewt ... 54&t=14980
from microchips are files in the postings added, examples and app note links.
the eeprom icon is for chips that have eeprom.
perhabs it helps you.

bw
rudi
;-)

Re: Writting to flash on PIC

Posted: Wed Jun 25, 2014 5:28 pm
by mikn
Rudi, finally, did you get the working code?

Re: Writting to flash on PIC

Posted: Wed Jun 25, 2014 6:04 pm
by Rudi
mikn wrote:Rudi, finally, did you get the working code?
Hi Mikn, not just at time, but Benj wrote in the named post, that eeprom icon "then this is currently not supported but in the pipeline"..
so i think with the microchip examples in the named post, this must / can be done.
I will try this comming weekend too.
In APP Note i read, it must be reserve a adress range for emulate eeprom in code
then it can be used as eeprom.
The things i mean can done as 16 bit/pointer in the adress
so if you reserve "nonstop" example 20 byte ( 1 byte = 8 Bit ..2 byte = 16 Bit ) it can be 10 * 16 bit ( = 160 Bit / 8 = 20 byte )
i hope i have calculate right ;-) ;-)
The examples are in the named post mikn.
bw
Rudi
;-)

Re: Writting to flash on PIC

Posted: Sun Jul 06, 2014 11:35 pm
by mikn
Found documentation about EEPROM emulating in PIC24.
http://www.microchip.com/stellent/idcpl ... e=en530593
Who can help me to integrate that example into FC project correctly? We can chat over icq or skype.

Re: Writting to flash on PIC

Posted: Mon Jul 07, 2014 10:45 pm
by Kenrix2
To answer your original question, yes it can be done but your right, asm or 'c' code will have to be used. Below is a conceptual program (no asm or 'c' code included) on how the write portion might be done using Flowcode. There are probably errors in it. There also may be enough information in the device data sheet to add the asm or 'c' code. The flash read portion looks like it would be a lot easier. I wish I could help you further but, I only have the 'free' PIC16 Chip Pack and I do not have any hardware to proceed.

Re: Writting to flash on PIC

Posted: Mon Jul 07, 2014 11:13 pm
by mikn
your example seems to be for external memory with i2c interface, doesn't it?

still looking for someone to help me with writting to flash. as a result i need two macros read and write from and to flash. data to store: several variables (50-100 bytes of data). maybe someone can offer payable support?

Re: Writting to flash on PIC

Posted: Sat Jul 12, 2014 8:54 pm
by mikn
still looking for someone who can create two macros to write and read from pic24 flash memory. I am ready to pay some money for the work time, if necessary.

Re: Writting to flash on PIC

Posted: Tue Jul 15, 2014 12:35 pm
by Benj
Hello,

Have you seen this topic, not specifically for the PIC24 but might help to get you on the right track.

http://www.matrixtsl.com/mmforums/viewt ... 26&t=15067

Re: Writting to flash on PIC

Posted: Wed Jul 16, 2014 8:33 pm
by mikn
Reviewed the code. but C is not my "native" language, so I will need help anyway.

Re: Writting to flash on PIC

Posted: Fri Aug 15, 2014 12:40 am
by mikn
still looking for someone who can create two macros to read and write to program memory of pic24.
I need to store 300 bytes of data (settings and so on). So macro must read and write byte by byte or by whole block (so I could read 300 bytes buffer, modify and write back).
Can pay some money for the work if necessary.
Please PM.

Re: Writting to flash on PIC

Posted: Sun Aug 31, 2014 10:29 pm
by mikn
up. still actual. no one can do this? unbelievable :)

Re: Writting to flash on PIC

Posted: Mon Sep 01, 2014 9:26 am
by Rudi
the weather is to pretty for thinking about how this must go on with pic24 ;-) ;-) ;-)
i wait for a raining cold autum day for this doing .. and then goes on ;-) ;-) ;-)
..
..
;-) ;-) ;-)
Best wishes!
Rudi
:-)

;-) "unbelievable" :-)
but true ;-) :-) ;-) ;-) ;-)

Re: Writting to flash on PIC

Posted: Mon Sep 01, 2014 10:07 am
by Benj
Hello Mikn,

Do you have a specific chip in mind.

I can have a go at creating a set of macros that should work for you but it's pointless without specifics as the PIC24 range varies quite a bit from device to device.

Re: Writting to flash on PIC

Posted: Mon Sep 01, 2014 3:45 pm
by mikn
Benj, check pm

Re: Writting to flash on PIC

Posted: Thu Sep 04, 2014 11:47 am
by Benj
Hello Mikn,

I was chatting to Jac Kersing and he said he is currently looking into this functionality for you so I have left it to him for now. To be honest it's been a crazy busy week so far.

I'll keep checking back and if your still waiting in a week or two then I will dig in and see if I can do the component code.

The code itself to read/write is quite easy but to do things properly you need to allow for a way of storing bytes in a page while you do a page erase.

Re: Writting to flash on PIC

Posted: Thu Sep 04, 2014 7:35 pm
by mikn
I see that the code is simple, according to the example from microchip. But C is not my "native" language :) and I have troubles with correct injecting this code into Flowcode project. That's why I am asking for help. If you tell me that it will be done, I can wait for a week, of course.

Re: Writting to flash on PIC

Posted: Mon Sep 22, 2014 12:21 am
by mikn
any updates? still waiting for the solution :(