Keil Logo

RTX51 TINY: USING WITH SILABS SFR PAGING


Information in this article applies to:

  • RTX51-Tiny Version 2
  • C51 Version 7.50 or higher

QUESTION

Some SiLABS C8051Fxxx versions implement a paged SFR scheme that expands the number of available SFR addresses. This paging scheme affects the SFR locations used for the RTX51 Tiny system timer.

What changes should I make using RTX51 Tiny together with a SiLABS part that is using SFR paging?  Are there any restrictions?

ANSWER

RTX51 Tiny uses the standard 8051 Timer 0 (mode 1) to generate a periodic interrupt.  This timer interrupt performs task switching.  To use RTX51 Tiny on a SiLABS device with SFR paging, make the following modifications to the configuration file CONF_TNY.A51:

  • Remove the call to HW_TIMER in the timer interrupt function: 
    TIMERINT:
      :
      :
    ; Removed for SiLABS SFR Paging:
    ;;;;;;;         CALL    HW_TIMER        ; Enable Interrupts again.
    
                    MOV     ?RTX_SAVEPSW,PSW
    
  • Insert the marked lines at end of the timer interrupt function to:
               USING   0               ; Registerbank 0 for following code
    
    IF (TIMESHARING == 0)
    ; Insert for SiLABS SFR Paging:
    IF (CPU_IDLE_CODE)
                    SETB    ?RTX_ISR_SIG
    ENDIF
                    RETI
    
    ; Round Robin Task Switching not required.  System Interrupt ends here
    ?RTX?SET_ISR:
    IF (CPU_IDLE_CODE)
                    SETB    ?RTX_ISR_SIG
    ENDIF
                    RET
    ENDIF
    

These changes impose the following restrictions when you are using SFR paging on a SiLABS device:

  • The modification prevents the RTX timer interrupt from a subsequent interrupt. The LONG_USR_INTR setting has no effect and should be left at 0.
  • The HW_TIMER function is no longer called. If you need to add code, you may insert it directly into the timer interrupt function.
  • On a SiLABS part that uses SFR paging, you may not use Round Robin Task SwitchingTIMESHARING must be set to 0.
  • Set SFRPAGE to 0. before calling an RTX function.
  • Enable SFRPGEN SFR Automatic Page Control in the SFR Page Control Register SFRPGCN. This ensures that the timer related SFR page is selected when an RTX51 Tiny timer interrupt occurs.

MORE INFORMATION

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Sunday, October 29, 2006


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.