Difference between revisions of "Component: Serial Flash (W25) (W25) (Storage)"

From Flowcode Help
Jump to navigationJump to search
(XML import)
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix TSL
 
| Matrix TSL
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
+
| 1.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| Storage
 
| Storage
 
|}
 
|}
  
  
 +
==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.
  
==[[File:Component Icon c8b6350e_b89a_4ad0_8669_e9387e24599e.png|Image]] Serial Flash (W25) (W25) component==
+
==Component Pack==
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.
 
  
 +
STORAGE
  
==Examples==
+
==Detailed description==
''<span style="color:red;">No additional examples</span>''
 
  
  
==Downloadable macro reference==
 
  
===<span style="font-weight: normal;"><u><tt>WriteControl</tt></u></span>===
 
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.
 
  
'''Parameters'''
 
  
:[[Variable Types|BOOL]] ''Status''
 
::1 = Write Enabled, 0 = Write Protected
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
 
  
  
===<span style="font-weight: normal;"><u><tt>ReadStatus</tt></u></span>===
+
''No detailed description exists yet for this component''
Reads one of the internal status registers on the device
 
  
'''Parameters'''
+
==Examples==
  
:[[Variable Types|BYTE]] ''Reg''
 
::Selects which status register to read, 0 = Status or 1 = Status 2.
 
  
  
'''Return value'''
 
  
:[[Variable Types|BYTE]]
 
  
  
===<span style="font-weight: normal;"><u><tt>ReadDataByte</tt></u></span>===
 
Reads a single data byte from the specified address.
 
  
'''Parameters'''
 
  
:[[Variable Types|UINT]] ''PageAddress''
 
::Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF
 
  
:[[Variable Types|BYTE]] ''ByteAddress''
 
::A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF
 
  
  
'''Return value'''
 
  
:[[Variable Types|BYTE]]
+
''<span style="color:red;">No additional examples</span>''
  
  
===<span style="font-weight: normal;"><u><tt>ReadUniqueID</tt></u></span>===
+
==Downloadable macro reference==
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.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteControl'''
 +
|-
 +
| colspan="2" | 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 +
| width="90%" | Status
 +
|-
 +
| colspan="2" | 1 = Write Enabled, 0 = Write Protected&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''ID''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::8-Byte data array to store the unique ID read back from the IC.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadStatus'''
 +
|-
 +
| colspan="2" | Reads one of the internal status registers on the device&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Reg
 +
|-
 +
| colspan="2" | Selects which status register to read, 0 = Status or 1 = Status 2.&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Return value'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadDataByte'''
 +
|-
 +
| colspan="2" | Reads a single data byte from the specified address.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | PageAddress
 +
|-
 +
| colspan="2" | Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | ByteAddress
 +
|-
 +
| colspan="2" | A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:''This call does not return a value''
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadUniqueID'''
 +
|-
 +
| colspan="2" | 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | ID
 +
|-
 +
| colspan="2" | 8-Byte data array to store the unique ID read back from the IC.&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>WriteDataArray</tt></u></span>===
 
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.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteDataArray'''
 +
|-
 +
| colspan="2" | 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | PageAddress
 +
|-
 +
| colspan="2" | Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | ByteAddress
 +
|-
 +
| colspan="2" | A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Count
 +
|-
 +
| colspan="2" | Number of bytes to write.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
Note that all bytes will be written to the same page.
 
  
'''Parameters'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EraseChip'''
 +
|-
 +
| colspan="2" | 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 +
| width="90%" | Blocking
 +
|-
 +
| colspan="2" | Controls if the macro blocks until the erase cycle is complete. 0 = Don't Wait, 1 = Wait&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|UINT]] ''PageAddress''
 
::Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF
 
  
:[[Variable Types|BYTE]] ''ByteAddress''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteDataByte'''
 +
|-
 +
| colspan="2" | 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | PageAddress
 +
|-
 +
| colspan="2" | Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | ByteAddress
 +
|-
 +
| colspan="2" | A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | Data byte to write&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|BYTE]] ''Count''
 
::Number of bytes to write.
 
  
:[[Variable Types|BYTE]] ''Data''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EraseBlock'''
 +
|-
 +
| colspan="2" | 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | EraseMode
 +
|-
 +
| colspan="2" | 0=4KB / 1=32KB / 2=64KB&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | PageAddress
 +
|-
 +
| colspan="2" | Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 +
| width="90%" | Blocking
 +
|-
 +
| colspan="2" | Controls if the macro blocks until the erase cycle is complete. 0 = Don't Wait, 1 = Wait&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Return value'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadDataArray'''
 +
|-
 +
| colspan="2" | Reads up to 256 data bytes starting from the specified address. Note that all bytes will be read from the same page.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | PageAddress
 +
|-
 +
| colspan="2" | Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | ByteAddress
 +
|-
 +
| colspan="2" | A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Count
 +
|-
 +
| colspan="2" | Number of bytes to read.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | Byta array to store the incoming read data.&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>EraseChip</tt></u></span>===
 
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.
 
 
'''Parameters'''
 
 
:[[Variable Types|BOOL]] ''Blocking''
 
::Controls if the macro blocks until the erase cycle is complete. 0 = Don't Wait, 1 = Wait
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>WriteDataByte</tt></u></span>===
 
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.
 
 
'''Parameters'''
 
 
:[[Variable Types|UINT]] ''PageAddress''
 
::Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF
 
 
:[[Variable Types|BYTE]] ''ByteAddress''
 
::A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF
 
 
:[[Variable Types|BYTE]] ''Data''
 
::Data byte to write
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Initialises the SPI bus ready for communications.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>EraseBlock</tt></u></span>===
 
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.
 
 
'''Parameters'''
 
 
:[[Variable Types|BYTE]] ''EraseMode''
 
::0=4KB / 1=32KB / 2=64KB
 
 
:[[Variable Types|UINT]] ''PageAddress''
 
::Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF
 
 
:[[Variable Types|BOOL]] ''Blocking''
 
::Controls if the macro blocks until the erase cycle is complete. 0 = Don't Wait, 1 = Wait
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>ReadDataArray</tt></u></span>===
 
Reads up to 256 data bytes starting from the specified address.
 
 
Note that all bytes will be read from the same page.
 
 
'''Parameters'''
 
 
:[[Variable Types|UINT]] ''PageAddress''
 
::Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF
 
 
:[[Variable Types|BYTE]] ''ByteAddress''
 
::A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF
 
 
:[[Variable Types|BYTE]] ''Count''
 
::Number of bytes to read.
 
 
:[[Variable Types|BYTE]] ''Data''
 
::Byta array to store the incoming read data.
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 
Initialises the SPI bus ready for communications.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
 
==Simulation macro reference==
 
 
''This component does not contain any simulation macros''
 
  
  
 
==Property reference==
 
==Property reference==
<span style="font-weight: normal;"><u>Memory Size</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''MemSize''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
Sets the size of the flash memory available on the chip.
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
<span style="font-weight: normal;"><u>Number Bytes</u></span>
+
|-
 
+
|-
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''NumBytes''.
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Flash Properties
''<span style="color:red;">No additional information</span>''
+
|-
 
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Memory Size
<span style="font-weight: normal;"><u>Number Pages</u></span>
+
|-
 
+
| colspan="2" | Sets the size of the flash memory available on the chip.&nbsp;
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''NumPages''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
''<span style="color:red;">No additional information</span>''
+
| width="90%" | Number Bytes
 
+
|-
 
+
| colspan="2" | &nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Channel</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
+
| width="90%" | Number Pages
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi1::CHANNEL''.
+
|-
 
+
| colspan="2" | &nbsp;
SPI Channel selector
+
|-
 
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
<span style="font-weight: normal;"><u>Prescale</u></span>
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | SPI Properties
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi1::PR_SCALE''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
Prescale option selector
+
| width="90%" | Channel
 
+
|-
<span style="font-weight: normal;"><u>MOSI</u></span>
+
| colspan="2" | SPI Channel selector&nbsp;
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::MOSI''.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Prescale
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.
+
|-
 
+
| colspan="2" | Prescale option selector&nbsp;
<span style="font-weight: normal;"><u>MISO</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::MISO''.
+
| width="90%" | MOSI
 
+
|-
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.
+
| colspan="2" | SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>CLK</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | MISO
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::CLK''.
+
|-
 
+
| colspan="2" | SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.&nbsp;
SPI Clock Pin CLK - The Clock signal is driven by the SPI master.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
<span style="font-weight: normal;"><u>CS / SS</u></span>
+
| width="90%" | CLK
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::SS''.
+
| colspan="2" | SPI Clock Pin CLK - The Clock signal is driven by the SPI master.&nbsp;
 
+
|-
Chip Select / Slave Select Pin  
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | CS / SS
Master Mode: General purpose output pin used to select the remote SPI device.
+
|-
 
+
| colspan="2" | 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. &nbsp;
Slave Mode: Hardware chip select pin input used to select the SPI device.
+
|-
 
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
<span style="font-weight: normal;"><u>Simulate Comms</u></span>
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
 
+
|-
This property is of type ''True or false'' and can be referenced with the variable name ''SimComms''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
Decides how the simulation handles the data.
+
| width="90%" | Simulate Comms
 
+
|-
No - Do no SPI simulation and allow all simulation data to come from a local text file.
+
| colspan="2" | 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.&nbsp;
 
+
|-
Yes - Use SPI simulation for use with Injector components etc.
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | File Simulation
<span style="font-weight: normal;"><u>Simulation File</u></span>
+
|-
 
+
|-
This property is of type ''Line of text'' and can be referenced with the variable name ''SimFile''.
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Simulation File
Name of file to use to hold the contents of the simulated flash memory.
+
|-
 
+
| colspan="2" | 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.&nbsp;
$(srcdir) assigns the file to the same folder as the Flowcode project file.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
<span style="font-weight: normal;"><u>Unique ID Lower 32-bit</u></span>
+
| width="90%" | Unique ID Lower 32-bit
 
+
|-
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''UniqueID''.
+
| colspan="2" | &nbsp;
 
+
|-
''<span style="color:red;">No additional information</span>''
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
+
| width="90%" | Unique ID Upper 32-bit
 
+
|-
 
+
| colspan="2" | &nbsp;
<span style="font-weight: normal;"><u>Unique ID Upper 32-bit</u></span>
+
|}
 
 
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''UniqueID2''.
 
 
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
<span style="font-weight: normal;"><u>Scope Traces</u></span>
 
 
 
This property is of type ''True or false'' and can be referenced with the variable name ''cal_spi1::ScopeTraces''.
 
 
 
Selects if the scope traces are automatically generated or not
 
 
 
<span style="font-weight: normal;"><u>Console Data</u></span>
 
 
 
This property is of type ''True or false'' and can be referenced with the variable name ''cal_spi1::ConsoleData''.
 
 
 
Selects if the console data is automatically generated or not
 
 
 
<span style="font-weight: normal;"><u>Injector</u></span>
 
 
 
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi1::Injector''.
 
 
 
''<span style="color:red;">No additional information</span>''
 

Latest revision as of 17:24, 9 November 2022

Author Matrix TSL
Version 1.0
Category Storage


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 Pack

STORAGE

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Downloadable macro reference

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


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


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


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


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


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


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


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


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


Fc9-comp-macro.png Initialise
Initialises the SPI bus ready for communications. 
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