Can you give me a C code routine for the MC9S08DZ60 controller to run in STOP2 mode?

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

Can you give me a C code routine for the MC9S08DZ60 controller to run in STOP2 mode?

171 次查看
wangbengang
Contributor I

Hello! I am currently writing a C code about the MC9S08DZ60 controller running in STOP2 mode! Mainly, after power on, it enters STOP2 mode, and then wakes up and lights up the LED small light through the external button of the IRQ pin! But I don't know how to get started. I looked at the low-power documentation of AN3387, but it's all assembly code, and I only know C language! So I would like to request a case study of C language programming from you! Thank you!

0 项奖励
1 回复

99 次查看
Pablo_Ramos
NXP Employee
NXP Employee

Hi @wangbengang ,
I recommend you in order to have a better understanding of what is happening you can check register by register why is the value on the example code, you can use the MC9S08DZ60 Data sheet in order to do so.
For example, taking the first line IRQSCinit: equ $10, you can go to the IRQSC register and see what that value does.

Pablo_Ramos_0-1719349013995.png

Pablo_Ramos_1-1719349020789.png

With this you can see that this line do is enable IRQ pin function as the comment in the application note says.

Also, to know what asm instruction do, you can see section 7.5 HCS08 Instruction Set Summary of the MC9S08DZ60 Data sheet

Hope it helps you!

 

0 项奖励