MPC5606 复位源判断

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

MPC5606 复位源判断

跳至解决方案
3,898 次查看
yangyulong
Contributor II

我想判断5606是否是由于看门狗(SWT)触发复位,尝试读取了不同情况下的RGM_*相关寄存器,各标志位没有明显变化。5606是否支持复位源判断,有相关示例代码可以参考一下吗。

标记 (1)
0 项奖励
回复
1 解答
3,791 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

There are two reference manuals:

One covering MPC5605BK and MPC5606BK (you have obviously this one):

https://www.nxp.com/webapp/Download?colCode=MPC5606BRM

And second one is covering MPC5605B, MPC5606B and MPC5607B:

https://www.nxp.com/webapp/Download?colCode=MPC5607BRM

The differences between MPC5606B and MPC5606BK are described in:

https://www.nxp.com/docs/en/application-note/AN4477.pdf

Which part number do you have exactly?

In any case, it is obviously a documentation issue in the version for MPC5606BK. Thanks for pointing this out, I will report it. You can take a look to the second manual where it is described correctly.

lukaszadrapa_0-1645605233119.png

 

lukaszadrapa_1-1645605248522.png

 

By the way, I saw that you mentioned on 8bit number like 0x80 in previous posts. Maybe this is the source of misunderstanding - it's 16bit register.

Regards,

Lukas

在原帖中查看解决方案

0 项奖励
回复
12 回复数
3,892 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

important point is that RGM_FES and RGM_DES registers are cleared only on Power-On reset. So, to get relevant information, it is necessary to follow this sequence:

- read RGM_DES and RGM_FES after each reset.

- clear all the flags in RGM_DES and RGM_FES by writing '1'. You can simply write the registers like RGM_DES = 0xFFFFFFFF and RGM_FES = 0xFFFFFFFF

- ... and wait for reset...

Then you will get appropriate result after each reset.

Regards,

Lukas

0 项奖励
回复
3,882 次查看
yangyulong
Contributor II

We has try to w1c the status register,but the software reset and SWT reset will trigger same flag been set.

How to distinguish between the two cases way to? 

0 项奖励
回复
3,874 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

It looks like a reset was triggered before the flag clearing, so two flags are set. I would check this by an oscilloscope if you can see two resets on the reset line.

Regards,

Lukas

0 项奖励
回复
3,856 次查看
yangyulong
Contributor II

yangyulong_0-1645240673698.jpeg

This is SWT reset, and register value:

RGM_FES:0x80

RGM_DES:0x00

yangyulong_1-1645240736602.jpeg

This is software reset, and register value:

RGM_FES:0x80

RGM_DES:0x00

0 项奖励
回复
3,829 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

This doesn't make sense, value 0x80 in RGM_FES means that F_LVD45 flag is set (Flag for 4.5 V low-voltage detected).

Which device do you have exactly? Is that MPC5606S or MPC5606B?

Regards,

Lukas

0 项奖励
回复
3,826 次查看
yangyulong
Contributor II

The MPC5606B device used.

0 项奖励
回复
3,816 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

I can see no problem on my side. If I generate SW reset, F_SOFT is set. If watchdog is not disabled, F_SWT is set after reset when it expires.

I would need to see more details what you do exactly.

Regards,

Lukas

0 项奖励
回复
3,798 次查看
yangyulong
Contributor II

We need to be able to distinguish the cause of system reset by reading one or some column flag bits.

0 项奖励
回复
3,799 次查看
yangyulong
Contributor II

Where the F_SOFT and F_SWT description in the 5606 user manual? We try to search the key word, but noting can find.

0 项奖励
回复
3,802 次查看
yangyulong
Contributor II

We just built a simple test logic to trigger software reset or stop watchdog feeding through can message. After entering the program, read the flag bit and clear it.

0 项奖励
回复
3,792 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

There are two reference manuals:

One covering MPC5605BK and MPC5606BK (you have obviously this one):

https://www.nxp.com/webapp/Download?colCode=MPC5606BRM

And second one is covering MPC5605B, MPC5606B and MPC5607B:

https://www.nxp.com/webapp/Download?colCode=MPC5607BRM

The differences between MPC5606B and MPC5606BK are described in:

https://www.nxp.com/docs/en/application-note/AN4477.pdf

Which part number do you have exactly?

In any case, it is obviously a documentation issue in the version for MPC5606BK. Thanks for pointing this out, I will report it. You can take a look to the second manual where it is described correctly.

lukaszadrapa_0-1645605233119.png

 

lukaszadrapa_1-1645605248522.png

 

By the way, I saw that you mentioned on 8bit number like 0x80 in previous posts. Maybe this is the source of misunderstanding - it's 16bit register.

Regards,

Lukas

0 项奖励
回复
3,780 次查看
yangyulong
Contributor II

You are right. Our document has issue.This is my manual register description:

yangyulong_0-1645673206985.pngyangyulong_1-1645673232247.png

Referring to the register definition you provided , we can  distinguish the reset source.

Thanks.

0 项奖励
回复