Setting LPSPI4 DMR0 / DMR1 registers...?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Setting LPSPI4 DMR0 / DMR1 registers...?

跳至解决方案
842 次查看
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 项奖励
回复
1 解答
827 次查看
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 项奖励
回复
2 回复数
816 次查看
np
Contributor IV

Worked perfectly, thanks Jeremy!

0 项奖励
回复
828 次查看
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 项奖励
回复