This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Silabs 8051F12x, SFR Paging and RTX51 Tiny - call USER_ROUTINE from timer interrupt function.

I have executed all recommendations specified in the reference http://www.keil.com/support/docs/3104.htm

My user code is written on C51 and I have not found other way how to insert call to USER_ROUTINE after timer's handler.
Function USER_ROUTINE is declared in the module on С51 as function of interruption with a vector 31.

The code should be:

//****************************************
//************* Conf_tny.A51 *************
//****************************************
...
EXTRN   CODE   (USER_ROUTINE) ;;; Inserted by me
...

USING   0               ; Registerbank 0 for following code

IF (TIMESHARING == 0)
; Insert for SiLABS SFR Paging:
IF (CPU_IDLE_CODE)
                SETB    ?RTX_ISR_SIG
ENDIF
                JMP USER_ROUTINE ;;; Inserted by me
                RETI


//****************************************


//****************************************
//************** user_code.c *************
//****************************************

void USER_ROUTINE () interrupt 31 {
...
   user's code
...
}

/****************************************

Vector of interrupt for user routine can be any from 0 up to 31
(except for 1:), but should be free and not occupy used hardware vectors.

It reliably works on Silabs C8051F121,
SYSCLK = 100Mhz,
Clock T0/T1 = SYSCLK/4,
INT_CLOCK = 25000,
timer quant = 1mS.

With best wishes,
Vlad