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

Post Reply
a_ziliu
Posts: 208
Joined: 20 Mar 2017, 10:52

31 May 2021, 16:20

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.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests