i have one spi master question

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
mekoc_1223776
Level 1
Level 1
Welcome! First question asked First reply posted

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 = SPIM_Flash_Read();// this only read up to 0x7f it does not read the rest

0 Likes
1 Solution

I have a PSoC Creator project on Github at following URL.

GitHub - noritan/Design116_3p0_3: F-RAM test project using SPI

Anyway,

Which PSoC are you using?

Are you using any library accessing SPI Flash?

Regards,

Noriaki

View solution in original post

0 Likes
4 Replies
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

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

0 Likes

I think you are right,

How you set to the Rx Buffer Size?

thanks

0 Likes

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

0 Likes

I have a PSoC Creator project on Github at following URL.

GitHub - noritan/Design116_3p0_3: F-RAM test project using SPI

Anyway,

Which PSoC are you using?

Are you using any library accessing SPI Flash?

Regards,

Noriaki

0 Likes