- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have one question about spi master Read access
I try to read 256 bytes of data from flash
all data come out of flash correctly
but spi madule does not read all the data
here is my code
SPIM_Flash_Write(0x06); //Write Enable
CyDelay(1000);
SPIM_Flash_Write(0x03); //Read data byte
SPIM_Flash_Write(0x05); //add 00 Add_Rd_Hi
SPIM_Flash_Write(0x01); //sectR Add_Rd_Lo
SPIM_Flash_Write(0x00);
for(j=0; j<240; j++){ //240
SPIM_Flash_Write(0x00); //to generat read clk
// SPIM_Flash_ReadArraybl(dbg_array_flashdata,240); did not work
dbg_array_flashdata
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a PSoC Creator project on Github at following URL.
GitHub - noritan/Design116_3p0_3: F-RAM test project using SPI
- Four F-RAMs are attached to PSoC 3.
- PSoC Creator 3.0 is used for development.
- DMAs are attached to the SPIM RX and TX.
- Polling model implementation is available in old commits.
- Source code: Design116_3p0_3/main.c at 837d9cd9aa25b8900eececfbeb10f19ab184842b · noritan/Design116_3p0_3 · GitHu...
- The PACKET_SIZE is set to 64 and the Buffer size is 80.
Anyway,
Which PSoC are you using?
Are you using any library accessing SPI Flash?
Regards,
Noriaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What did you set to the Rx Buffer Size?
When you want to read the array at once, the Rx Buffer Size must be larger than 240+6 bytes.
If you declare the integer variable j as 8-bit signed integer like int8, the program exits from the for loop when j becomes 0x80.
Regards,
Noriaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think you are right,
How you set to the Rx Buffer Size?
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
j is a int int j;
if you refer to buffer size 240 as I mention it did not works
SPIM_Flash_ReadArraybl(dbg_array_flashdata,240); did not work
Could you please just post correct code here
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a PSoC Creator project on Github at following URL.
GitHub - noritan/Design116_3p0_3: F-RAM test project using SPI
- Four F-RAMs are attached to PSoC 3.
- PSoC Creator 3.0 is used for development.
- DMAs are attached to the SPIM RX and TX.
- Polling model implementation is available in old commits.
- Source code: Design116_3p0_3/main.c at 837d9cd9aa25b8900eececfbeb10f19ab184842b · noritan/Design116_3p0_3 · GitHu...
- The PACKET_SIZE is set to 64 and the Buffer size is 80.
Anyway,
Which PSoC are you using?
Are you using any library accessing SPI Flash?
Regards,
Noriaki