Setting LPSPI4 DMR0 / DMR1 registers...?

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

Setting LPSPI4 DMR0 / DMR1 registers...?

Jump to solution
841 Views
np
Contributor IV

Hi everyone,

I'm trying to use LPSPI4's DMR0 / DMR1 data match registers as transient storage, but it seems as though I'm missing something really obvious. Here's my startup test code (note that this deliberately doesn't trigger software reset (CR bit 1), because I want to see if DMR0 persists over reboot):

#define MYSPI LPSPI4

MYSPI->CR = 0x1 + 0x8; // enable module (but don't reset it!)
printf("DMR0 Persistence test: 0x%08x\r\n", (unsigned int)(MYSPI->DMR0));
MYSPI->DMR0 = 0x12345678;
printf("DMR0 Readback test: 0x%08x\r\n", (unsigned int)(MYSPI->DMR0));

This is outputting:

DMR0 Persistence test: 0x00000000
DMR0 Readback test: 0x00000000

What have I got wrong here?

Thanks, Nick

cc: @jeremyzhou

0 Kudos
Reply
1 Solution
826 Views
jeremyzhou
NXP Employee
NXP Employee

Hi @np ,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
It should configure the LPSPI clock and enable the lpspi4 clock prior to setting the LPSPI's registers.

jeremyzhou_0-1668146919778.pngjeremyzhou_1-1668146928621.png

TIC

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

View solution in original post

0 Kudos
Reply
2 Replies
815 Views
np
Contributor IV

Worked perfectly, thanks Jeremy!

0 Kudos
Reply
827 Views
jeremyzhou
NXP Employee
NXP Employee

Hi @np ,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
It should configure the LPSPI clock and enable the lpspi4 clock prior to setting the LPSPI's registers.

jeremyzhou_0-1668146919778.pngjeremyzhou_1-1668146928621.png

TIC

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 Kudos
Reply