Writting to flash on PIC

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Writting to flash on PIC

Postby mikn » Wed Jun 25, 2014 1:09 pm

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?
FC 6.1.3.2 (18.02.2016)

User avatar
Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 494 times
Been thanked: 188 times

Re: Writting to flash on PIC

Postby Rudi » Wed Jun 25, 2014 1:34 pm

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:
viewtopic.php?f=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
;-)
These users thanked the author Rudi for the post:
mikn (Wed Jun 25, 2014 5:27 pm)
Rating: 5.26%
 

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Writting to flash on PIC

Postby mikn » Wed Jun 25, 2014 5:28 pm

Rudi, finally, did you get the working code?
FC 6.1.3.2 (18.02.2016)

User avatar
Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 494 times
Been thanked: 188 times

Re: Writting to flash on PIC

Postby Rudi » Wed Jun 25, 2014 6:04 pm

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
;-)
These users thanked the author Rudi for the post:
mikn (Thu Jun 26, 2014 9:06 am)
Rating: 5.26%
 

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Writting to flash on PIC

Postby mikn » Sun Jul 06, 2014 11:35 pm

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.
FC 6.1.3.2 (18.02.2016)

Kenrix2
Flowcode v5 User
Posts: 211
Joined: Tue Feb 19, 2013 9:51 pm
Has thanked: 72 times
Been thanked: 177 times
Contact:

Re: Writting to flash on PIC

Postby Kenrix2 » Mon Jul 07, 2014 10:45 pm

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.
Attachments
EE_PROM_Writer_v1.fcfx
Concept only, not a working program
(7.33 KiB) Downloaded 86 times

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Writting to flash on PIC

Postby mikn » Mon Jul 07, 2014 11:13 pm

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?
FC 6.1.3.2 (18.02.2016)

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Writting to flash on PIC

Postby mikn » Sat Jul 12, 2014 8:54 pm

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.
FC 6.1.3.2 (18.02.2016)

User avatar
Benj
Matrix Staff
Posts: 14361
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4443 times
Been thanked: 4143 times
Contact:

Re: Writting to flash on PIC

Postby Benj » Tue Jul 15, 2014 12:35 pm

Hello,

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

viewtopic.php?f=26&t=15067
These users thanked the author Benj for the post:
mikn (Wed Jul 16, 2014 8:47 pm)
Rating: 5.26%
 

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Writting to flash on PIC

Postby mikn » Wed Jul 16, 2014 8:33 pm

Reviewed the code. but C is not my "native" language, so I will need help anyway.
FC 6.1.3.2 (18.02.2016)

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Writting to flash on PIC

Postby mikn » Fri Aug 15, 2014 12:40 am

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.
FC 6.1.3.2 (18.02.2016)

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Writting to flash on PIC

Postby mikn » Sun Aug 31, 2014 10:29 pm

up. still actual. no one can do this? unbelievable :)
FC 6.1.3.2 (18.02.2016)

User avatar
Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 494 times
Been thanked: 188 times

Re: Writting to flash on PIC

Postby Rudi » Mon Sep 01, 2014 9:26 am

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 ;-) :-) ;-) ;-) ;-)

User avatar
Benj
Matrix Staff
Posts: 14361
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4443 times
Been thanked: 4143 times
Contact:

Re: Writting to flash on PIC

Postby Benj » Mon Sep 01, 2014 10:07 am

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.

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Writting to flash on PIC

Postby mikn » Mon Sep 01, 2014 3:45 pm

Benj, check pm
These users thanked the author mikn for the post:
Benj (Mon Sep 01, 2014 4:49 pm)
Rating: 5.26%
 
FC 6.1.3.2 (18.02.2016)

User avatar
Benj
Matrix Staff
Posts: 14361
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4443 times
Been thanked: 4143 times
Contact:

Re: Writting to flash on PIC

Postby Benj » Thu Sep 04, 2014 11:47 am

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.
These users thanked the author Benj for the post (total 2):
Rudi (Thu Sep 04, 2014 12:11 pm) • mikn (Thu Sep 04, 2014 7:38 pm)
Rating: 10.53%
 

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Writting to flash on PIC

Postby mikn » Thu Sep 04, 2014 7:35 pm

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.
These users thanked the author mikn for the post:
Rudi (Thu Sep 04, 2014 8:28 pm)
Rating: 5.26%
 
FC 6.1.3.2 (18.02.2016)

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Writting to flash on PIC

Postby mikn » Mon Sep 22, 2014 12:21 am

any updates? still waiting for the solution :(
FC 6.1.3.2 (18.02.2016)