Flash Eprom
-
- Posts: 145
- http://meble-kuchenne.info.pl
- Joined: Fri Dec 04, 2020 2:29 pm
- Has thanked: 26 times
- Been thanked: 7 times
Flash Eprom
Does anyone have a nice method of populating 150 locations in a flash eprom as initialization values rather than hand loading into the "properties" window?
-
- Valued Contributor
- Posts: 1628
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 142 times
- Been thanked: 761 times
Re: Flash Eprom
What are you actually trying to achieve?
ie Write data to flash in hardware (initialise the memory) or for simulation only. Which MCU etc.
I'm working with a EEPROM component where there is a file set as initial contents (binary data in this case) - this works in simulation, and if the hardware is connected via SCADA - then I'm working on writing the data to the EEPROM. Hopefully providing an easy way to intialise the memory chip (with any amount of data). Note that I'm currently working with a SPI eeprom rather than on chip flash - but the idea should be fairly easy to work with this too. It does require that the hardware can work as a SCADA slave however.
Martin
ie Write data to flash in hardware (initialise the memory) or for simulation only. Which MCU etc.
I'm working with a EEPROM component where there is a file set as initial contents (binary data in this case) - this works in simulation, and if the hardware is connected via SCADA - then I'm working on writing the data to the EEPROM. Hopefully providing an easy way to intialise the memory chip (with any amount of data). Note that I'm currently working with a SPI eeprom rather than on chip flash - but the idea should be fairly easy to work with this too. It does require that the hardware can work as a SCADA slave however.
Martin
Re: Flash Eprom
Thanks Martin - Not really up to speed with your stuff. I can use flash eprom to store numbers etc. currently, I have a calculation box which puts a set of numbers (150) into an array, and I would like those numbers to reside in the flash eprom instead (So I may change them at run time).
Is it the case that I have to enter all 150 numbers in the eprom parameters window to achieve that goal?
Currently the parameters window suggests initial numbers of 1,2,3,4
The simulation for flash eprom does not work, so that's out. I have requested a fix for that in the past. I'm not sure how anyone can test software with this unless they happen to have the hardware present and running. I have that luxury so I know that the flash is working. It does require build/program/test steps in order to determine.
Is it the case that I have to enter all 150 numbers in the eprom parameters window to achieve that goal?
Currently the parameters window suggests initial numbers of 1,2,3,4
The simulation for flash eprom does not work, so that's out. I have requested a fix for that in the past. I'm not sure how anyone can test software with this unless they happen to have the hardware present and running. I have that luxury so I know that the flash is working. It does require build/program/test steps in order to determine.
-
- Valued Contributor
- Posts: 1628
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 142 times
- Been thanked: 761 times
Re: Flash Eprom
I had a look at the initialisation data - and couldn't see that it would be written to EEPROM at any time...
So I modified a bit of the code - here there is a 'sender' that runs under 'debug' on the PC - and a receiver that runs on the MCU (which needs to be connected via UART / USB)
In this case I used an Arduino UNO and comms worked well at 115200 baud.
The receiver program 'watches' for a byte length (this could be modded to a 16 bit value with a larger buffer) - and then waits until it has read that many bytes (here <= 100) It then writes these bytes to EEPROM (actually disabled) - before sending a 'X' to indicate ready for the next block.
This would probably run as a one-off or occasionally (set data values - and could be triggered by a button etc if needed) You probably don't want to rewrite the EEPROM every time ?
The sender has a 'file' that it opens and sends to UART in blocks of upto 100 bytes. There is no error checking anywhere - and it seems to struggle with some locations for the data file.
The receiver also allows for blocks of up to 128 bytes - but the sender uses a block of 100 bytes...
The receiver 'stores' the data length as the first byte of the buffer - but would probably be clearer using a variable for this (block_length) - which would remove the need to offset the data by 1.
This allows the flash to be pre-programmed with 'binary' data from a file - if the file is in a different format (CSV for example) - some pre-processing by the sender would be needed.
The final block transmitted has 0 length - to let the receiver know the file is done...
Please ask if anything is not clear...
Martin
https://www.flowcodexchange.com/
So I modified a bit of the code - here there is a 'sender' that runs under 'debug' on the PC - and a receiver that runs on the MCU (which needs to be connected via UART / USB)
In this case I used an Arduino UNO and comms worked well at 115200 baud.
The receiver program 'watches' for a byte length (this could be modded to a 16 bit value with a larger buffer) - and then waits until it has read that many bytes (here <= 100) It then writes these bytes to EEPROM (actually disabled) - before sending a 'X' to indicate ready for the next block.
This would probably run as a one-off or occasionally (set data values - and could be triggered by a button etc if needed) You probably don't want to rewrite the EEPROM every time ?
The sender has a 'file' that it opens and sends to UART in blocks of upto 100 bytes. There is no error checking anywhere - and it seems to struggle with some locations for the data file.
The receiver also allows for blocks of up to 128 bytes - but the sender uses a block of 100 bytes...
The receiver 'stores' the data length as the first byte of the buffer - but would probably be clearer using a variable for this (block_length) - which would remove the need to offset the data by 1.
This allows the flash to be pre-programmed with 'binary' data from a file - if the file is in a different format (CSV for example) - some pre-processing by the sender would be needed.
The final block transmitted has 0 length - to let the receiver know the file is done...
Please ask if anything is not clear...
Martin
https://www.flowcodexchange.com/
-
- Matrix Staff
- Posts: 1952
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 510 times
- Been thanked: 698 times
Re: Flash Eprom
Hello,
Is this the type of thing you're after?
Is this the type of thing you're after?
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Re: Flash Eprom
Thank you Ben (I don't know how to do the formal "Thanks" button on this board!)
What you have pointed out to me is the built in function which populates a string of data "10,10,10,etc" and populates the eprom properties.
I have not been clear on using the built in function block.
That will work for me.
What you have pointed out to me is the built in function which populates a string of data "10,10,10,etc" and populates the eprom properties.
I have not been clear on using the built in function block.
That will work for me.