|
Silabs 8051F12x, SFR Paging and RTX51 Tiny - call USER_ROUTINE from timer interrupt function.Next Thread | Thread List | Previous Thread Start a Thread | Settings | Details | Message |
|---|
Read-Only Author Vlad Sharnin Posted 30-Nov-2005 05:36 Toolset C51 |  Silabs 8051F12x, SFR Paging and RTX51 Tiny - call USER_ROUTINE from timer interrupt function. Vlad Sharnin 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 | | Read-Only Author roman horvath Posted 1-Dec-2005 07:55 Toolset C51 |  RE: Silabs 8051F12x, SFR Paging and RTX51 Tiny - call USER_ROUTINE from timer interrupt function. roman horvath It's very good solution. I'm now working on tiny customization to F120 device. I want to use timer2 for tiny because the interrupt code is shorter with timer2 auto-reload function.
ROman | | Read-Only Author roman horvath Posted 1-Dec-2005 07:56 Toolset C51 |  RE: Silabs 8051F12x, SFR Paging and RTX51 Tiny - call USER_ROUTINE from timer interrupt function. roman horvath It's very good solution. I'm now working on tiny customization to F120 device. I want to use timer2 for tiny because the interrupt code is shorter with timer2 auto-reload function.
ROman | |
Next Thread | Thread List | Previous Thread Start a Thread | Settings |
|