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!
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.
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!