Component: Serial Flash (W25) (EEPROM)

From Flowcode Help
Jump to navigationJump to search
Author Matrix TSL
Version 1.0
Category EEPROM


Serial Flash (W25) component

Component to allow support for the Winbond W25 range of SPI Flash devices. Compatible with various sizes of Flash including: 2Mb, 4Mb, 8Mb, 32Mb, 64Mb, 128Mb.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_SerialFlash_W25Q.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_SerialFlash_W25Q.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples







Macro reference

EraseBlock

Fc9-comp-macro.png EraseBlock
Erases a block of data stored on the chip. Erase takes between 45 milliseconds and 2000 milliseconds to complete. Blocking mode is recommended to ensure write cycle is complete. 
Fc9-u8-icon.png - BYTE EraseMode
0=4KB / 1=32KB / 2=64KB 
Fc9-u16-icon.png - UINT PageAddress
Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF 
Fc9-bool-icon.png - BOOL Blocking
Controls if the macro blocks until the erase cycle is complete. 0 = Don't Wait, 1 = Wait 
Fc9-void-icon.png - VOID Return


EraseChip

Fc9-comp-macro.png EraseChip
Erases all data stored on the chip. Chip erase takes between 20 seconds and 100 seconds to complete. Blocking mode is recommended to ensure write cycle is complete. 
Fc9-bool-icon.png - BOOL Blocking
Controls if the macro blocks until the erase cycle is complete. 0 = Don't Wait, 1 = Wait 
Fc9-void-icon.png - VOID Return


Initialise

Fc9-comp-macro.png Initialise
Initialises the SPI bus ready for communications. 
Fc9-void-icon.png - VOID Return


ReadDataArray

Fc9-comp-macro.png ReadDataArray
Reads up to 256 data bytes starting from the specified address. Note that all bytes will be read from the same page. 
Fc9-u16-icon.png - UINT PageAddress
Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF 
Fc9-u8-icon.png - BYTE ByteAddress
A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF 
Fc9-u8-icon.png - BYTE Count
Number of bytes to read. 
Fc9-u8-icon.png - BYTE Data
Byta array to store the incoming read data. 
Fc9-void-icon.png - VOID Return


ReadDataByte

Fc9-comp-macro.png ReadDataByte
Reads a single data byte from the specified address. 
Fc9-u16-icon.png - UINT PageAddress
Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF 
Fc9-u8-icon.png - BYTE ByteAddress
A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF 
Fc9-u8-icon.png - BYTE Return


ReadStatus

Fc9-comp-macro.png ReadStatus
Reads one of the internal status registers on the device 
Fc9-u8-icon.png - BYTE Reg
Selects which status register to read, 0 = Status or 1 = Status 2. 
Fc9-u8-icon.png - BYTE Return


ReadUniqueID

Fc9-comp-macro.png ReadUniqueID
Reads the 8-byte unique identifier from the IC. Useful if you need each board to have it's own guarenteed unique address or identifier. 
Fc9-u8-icon.png - BYTE ID
8-Byte data array to store the unique ID read back from the IC. 
Fc9-void-icon.png - VOID Return


WriteControl

Fc9-comp-macro.png WriteControl
Enables or disables writing for things like erasing and programming. Writes must be enabled after a power on reset and again after an erase command. 
Fc9-bool-icon.png - BOOL Status
1 = Write Enabled, 0 = Write Protected 
Fc9-void-icon.png - VOID Return


WriteDataArray

Fc9-comp-macro.png WriteDataArray
Writes an array of data bytes atarting at the specified address. Writes must be enabled and memory locations must be erased for data writes to function correctly. Note that all bytes will be written to the same page. 
Fc9-u16-icon.png - UINT PageAddress
Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF 
Fc9-u8-icon.png - BYTE ByteAddress
A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF 
Fc9-u8-icon.png - BYTE Count
Number of bytes to write. 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


WriteDataByte

Fc9-comp-macro.png WriteDataByte
Writes a single data byte to the specified address. Writes must be enabled and memory locations must be erased for data writes to function correctly. 
Fc9-u16-icon.png - UINT PageAddress
Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF 
Fc9-u8-icon.png - BYTE ByteAddress
A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF 
Fc9-u8-icon.png - BYTE Data
Data byte to write 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Flash Properties
Fc9-type-16-icon.png Memory Size
Sets the size of the flash memory available on the chip. 
Fc9-type-21-icon.png Number Bytes
 
Fc9-type-21-icon.png Number Pages
 
Fc9-conn-icon.png SPI Properties
Fc9-type-16-icon.png Channel
SPI Channel selector 
Fc9-type-16-icon.png Prescale
Prescale option selector 
Fc9-type-5-icon.png MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
Fc9-type-5-icon.png MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
Fc9-type-5-icon.png CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
Fc9-type-5-icon.png CS / SS
Chip Select / Slave Select Pin Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device.  
Fc9-conn-icon.png Simulation
Fc9-type-7-icon.png Simulate Comms
Decides how the simulation handles the data. No - Do no SPI simulation and allow all simulation data to come from a local text file. Yes - Use SPI simulation for use with Injector components etc. 
Fc9-conn-icon.png File Simulation
Fc9-type-10-icon.png Simulation File
Name of file to use to hold the contents of the simulated flash memory. $(srcdir) assigns the file to the same folder as the Flowcode project file. 
Fc9-type-21-icon.png Unique ID Lower 32-bit
 
Fc9-type-21-icon.png Unique ID Upper 32-bit