Cannot change the value of SPI1->RSER

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot change the value of SPI1->RSER

Jump to solution
1,110 Views
Anonymous
Deactivated User

#define SPI_RSER_TFFF_DIRS_MASK                  0x1000000u

SPI1->RSER = SPI_RSER_TFFF_RE_MASK;

I try to activate the interrupt bit for TFFF RE in the SPI1 register RSER

When I write to this register it has no affect.  The register is always 0 (Checked with ULINK 2)

If I do the same to SPI0 it works.

Is there an issue for SPI1 that the interrupt do not work?

Finally I would like to use the SPI1 transmit by a DMA process.

Has anyone experience with DMA on SPI1 in transmit direction?

Labels (1)
0 Kudos
1 Solution
779 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

Could you let us know the Part Number? Thanks.


Have a great day,
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
8 Replies
780 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

Could you let us know the Part Number? Thanks.


Have a great day,
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
779 Views
Anonymous
Deactivated User

Hi

The part number is

  • K64FN1M0VLL12
  • Mask No. 1N83J
0 Kudos
779 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

1> First of all, it need to enable the SPI1 module clock at SIM_SCGC6[SPI1] bit. Then customer can set the SPI1 related register value.

I had tried, there without any problem to set SPI1_RSER[TFFF_RE] bit.

2> About SPI transmit DMA example, customer could refer Kinetis SDK software example, located at [dspi_edma_blocking] folder:

C:\Freescale\KSDK_1.2.0\examples\frdmk64f\driver_examples\dspi

KSDK V1.2 could be downloaded here.

Wish it helps.


Have a great day,
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
779 Views
Anonymous
Deactivated User

Hi Ma Hui

I am still not able to change the register for the SPI1

Here is the very simple code.

I use the Keil compiler.

If I have a look via the Keil ULINK2 into the unit I can see the conditions of the SPI registers.

After the clock is enabled I can change the registers in the SPI 0 and SPI 1.

But this is not possible for the RSER register of SPI 1. For SPI 0 this is possible.

Other registers of the SPI 1 like MCR CTAR0 can be changed without any problem.

Is there any side effect which is necessary to active the RSER register?

 

Best regards

Lothar Nawroth

/* ****************************** Initialisierung SPI0 and  1 *********** */

#define SIM_SCGC6_SPI0_MASK                      0x1000u

#define SIM_SCGC6_SPI1_MASK                      0x2000u

#define SPI_RSER_TFFF_DIRS_MASK              0x1000000u

#define SPI_RSER_TFFF_RE_MASK                  0x2000000u

   SIM->SCGC6   |= (SIM_SCGC6_SPI0_MASK);    /* Enable Clock for SPI0 */
   SIM->SCGC6   |= (SIM_SCGC6_SPI1_MASK);    /* Enable Clock for SPI1 */
 

   SPI0->RSER |=   SPI_RSER_TFFF_RE_MASK    |                //Transmit defintion
                               SPI_RSER_TFFF_DIRS_MASK;                //We use DMA

   SPI1->RSER |=   SPI_RSER_TFFF_RE_MASK    |                //Transmit defintion
                               SPI_RSER_TFFF_DIRS_MASK;                 //We use DMA

0 Kudos
779 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

We had tried with Keil Rev5.10.0.2 with FRDM-K64F board(using J-Link), there without any problem to change SPI1 RSER register [TFFF_RE] bit value.

If customer is using the same version of Keil software?

And if customer could try with other debugger tool, such as Segger J-Link tool.

Wish it helps.


Have a great day,
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
779 Views
Anonymous
Deactivated User

Hi

I have now also used the test board from freescale.

Also I have used 2 projects from freescale for the test.

With one of it, it is possible to change SPI RSER register, with the other not.

I have used out oftthe folder

  • C:\Freescale\KSDK_1.2.0\examples\frdmk64f\driver_examples\dspi\dspi_edma_
    blocking\master\mdk

Freescale project

  • dspi_edma_blocking_example_master.uvprojx

This project is written for the SPI 0 port but it can be used to check if SPI1 is working or not.

During the run I have stopped the program with the Debugger.

I have changed the SIM register manually Enable clock for SPI 1)

Afterwards I have tried to change the SPI register RSER.

It is not possible.

It is always 0.

Now I have just the non blocked project

  • C:\Freescale\KSDK_1.2.0\examples\frdmk64f\driver_examples\dspi\dspi_edma_non_blocking\master\mdk

Freescale project

  • dspi_edma_non_blocking_example_master.uvprojx

This project is also written for the SPI 0 port.

I did the same check as before.

During the run I have stopped the program with the Debugger.

I have changed the SIM register manually

Afterwards I have tried to change the SPI register RSER

Now it is possible to change the port.

I have tried to find the difference in the code for the configuration.

I cannot find any relevant difference.

Do you have any idea what the reason is for this different behaviour?

Best regards.

Lothar Nawroth

.

0 Kudos
779 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

I think the Keil's [System Viewer Windows] with problem, which could not reflect the SPI1 register actual value.

Please add below code to related test code and in Watch window to check "temp" value, which will be shows the SPI1_RSER register value as expected.

uint32_t temp = 0;

//small test start

    SIM_SCGC6 |= 0x2000;

    temp = SPI1_RSER;

    SPI1_RSER |= 0x2000000;

    temp = SPI1_RSER;

    SPI1_RSER = 0;

    temp = SPI1_RSER;

    //small test end

Wish it helps.


Have a great day,
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
779 Views
Anonymous
Deactivated User

Hi

You are right.

Strange is that in the non_blocked project, the contends of the register is shown correctly.

I will contact Keil.

Thank you very much

Lothar Nawroth

0 Kudos