Hello,
Is there any example FC programs using the 23LCV1024 SPI memory chip?
@Ben, i did mention this chip before in another thread and you said it exists
on the EB006 ghost board, do you have any example code using this
device? I did look at the ghost board page but there is nothing
about any code to look at....
Thanx
Mark
Serial Static Memory 23LCV1024
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Serial Static Memory 23LCV1024
Hi Mark,
Here is a simplified version of the code we use on the EB006 / EB091 boards. Hopefully this should be enough to help you create the Flowcode macros using an SPI component.
Once you have set up the Read or Write command you can keep reading or writing bytes to increase the data throughput. We read and write in bursts of 64 bytes.
Here is a simplified version of the code we use on the EB006 / EB091 boards. Hopefully this should be enough to help you create the Flowcode macros using an SPI component.
Code: Select all
void SRAM_Init(void)
{
SPI_Initialise();
mSPI_Mem_CS_En(); //Chip Select Enabled - Output 0
SPI_1_SPI_Master_Byte(0x01); //Write Mode Command
SPI_1_SPI_Master_Byte(0x40); //Sequential Mode
mSPI_Mem_CS_Dis(); //Chip Select Disabled - Output 1
}
void SRAM_Write(unsigned long address, unsigned char data)
{
mSPI_Mem_CS_En(); //Chip Select Enabled - Output 0
SPI_1_SPI_Master_Byte(0x02); //Write Data Command
SPI_1_SPI_Master_Byte(address >> 16); //24-bit Address
SPI_1_SPI_Master_Byte(address >> 8);
SPI_1_SPI_Master_Byte(address);
SPI_1_SPI_Master_Byte(data);
mSPI_Mem_CS_Dis(); //Chip Select Disabled - Output 1
}
unsigned char SRAM_Read(unsigned long address)
{
unsigned char retval;
mSPI_Mem_CS_En(); //Chip Select Enabled - Output 0
SPI_1_SPI_Master_Byte(0x03); //Read Data Command
SPI_1_SPI_Master_Byte(address >> 16); //24-bit Address
SPI_1_SPI_Master_Byte(address >> 8);
SPI_1_SPI_Master_Byte(address);
retval = SPI_1_SPI_Master_Byte(0xFF);
mSPI_Mem_CS_Dis(); //Chip Select Disabled - Output 1
return (retval);
}
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel