MPC5606 复位源判断

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

MPC5606 复位源判断

Jump to solution
4,467 Views
yangyulong
Contributor II

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

Tags (1)
0 Kudos
Reply
1 Solution
4,360 Views
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

View solution in original post

0 Kudos
Reply
12 Replies
4,461 Views
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 Kudos
Reply
4,451 Views
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 Kudos
Reply
4,443 Views
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 Kudos
Reply
4,425 Views
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 Kudos
Reply
4,398 Views
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 Kudos
Reply
4,395 Views
yangyulong
Contributor II

The MPC5606B device used.

0 Kudos
Reply
4,385 Views
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 Kudos
Reply
4,367 Views
yangyulong
Contributor II

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

0 Kudos
Reply
4,368 Views
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 Kudos
Reply
4,371 Views
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 Kudos
Reply
4,361 Views
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 Kudos
Reply
4,349 Views
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 Kudos
Reply