DSPI Configuration to access external flash

cancel
Showing results for 
Search instead for 
Did you mean: 

DSPI Configuration to access external flash

278 Views
vignesh_v
Contributor III

Hi,

    My clarifications query regarding accessing external flash in MPC5777C. I had reffered MPC5676R accessing with spansion flash dspiF129C. ineed to do similar way with another flash (cypress SPI NOR flash)

The configuration mentioned below i used as master  and i understand  following configuration for 8 bit read write with frame size 7 with some slow configuration.

DSPI_B.CTAR[1].R = DSPI_CTAR_FMSZ(0x7) |
DSPI_CTAR_PCSSCK(4) |
DSPI_CTAR_DT(4) |
DSPI_CTAR_ASC(4) |
DSPI_CTAR_CSSCK(4) |
DSPI_CTAR_PASC_7CLK |
DSPI_CTAR_PDT_7CLK |
DSPI_CTAR_PBR_7CLK |
DSPI_CTAR_BR(0x8) ;

1. What needs to be done (register settings) if there should be an optimum speed  is achieved .

2.InCase of 16 bit read/wtite is this configuration fine.

DSPI_B.CTAR[1].R = DSPI_CTAR_FMSZ(0xF) |
DSPI_CTAR_PCSSCK(4) |
DSPI_CTAR_DT(4) |
DSPI_CTAR_ASC(4) |
DSPI_CTAR_CSSCK(4) |
DSPI_CTAR_PASC_7CLK |
DSPI_CTAR_PDT_7CLK |
DSPI_CTAR_PBR_7CLK |
DSPI_CTAR_BR(0x10) ;

3. How can be the write and read macros  be modified best to do a16 bit read and write 

#define PUSH(n) DSPI_B.PUSHR.R = continuous_command_for_PUSH(n)

#define POP(n) n = (uint8_t) (DSPI_B.POPR.R); \
DSPI_B.SR.R = DSPI_SR_RFDF

Could any one guide me on the above mentioned queries?

Thanks In Advance,

Vignesh

Labels (1)
0 Kudos
2 Replies

108 Views
vignesh_v
Contributor III

Hi,

   Thanks. Yes i was referring to the same. I shall look into it

Regards,

Vignesh

0 Kudos

108 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, I guess it refers to example I have shared here:

Example MPC5676R DSPI-ext_SPI_memory-S25FL129P CW210 

1) It does not deal with timing at all, it just sets configuration as slow as possible (as SPI is synchronous communication where master drives the clock, it is possible). For maximum throughput, please follow timing defined in the particular memory datasheet to find out proper timing values for CTAR configuration.

2) Yes, it is possible.

3) Change variable type, otherwise I guess it is the same

#define POP(n) n = (uint16_t) (DSPI_B.POPR.R); \
               DSPI_B.SR.R = DSPI_SR_RFDF

0 Kudos