Page 1 of 1

How to print the value of SFR when SFR and SBUF are on the different SFR pages?

Posted: 31 May 2021, 16:20
by a_ziliu
The recommended solution is to move SFRs to XRAM. Then the SFR page should be set to the UART page to print the value of SFR.
The following is demonstration of printing the value of PWM0C1H on ML51EB9AE. Make sure you are on the correct SFR page for the ML51EB9AE when accessing SFRs.
Because SBUF and PWM0C1H are not on the same SFR pages, user must move PWM0C1H to XRAM. Then the SFR page should be set to the UART page to direct the operation to UART0. The sample code is shown below.