C8051F120 ISR List?

Thread Starter

crazyengineer

Joined Dec 29, 2010
156
In order to prepare for my microprocessor systems class, I brought the C8051F120 microprocessor. So I found the SDCC list of bit registers and sfr (page 7), but the problem is that I cannot find the list of ISR's for the C8051F120. Can someone please tell me where I can find them?
 

Arm_n_Legs

Joined Mar 7, 2007
186
I am not sure about SDCC. Maybe you can try the listing used by Keil C51.
Interrupt 0 = external interrupt 0
Interrupt 1 = timer 0 interrupt
Interrupt 2 = external interrupt 1
Interrupt 3 = timer 1 interrupt
Interrupt 4 = serial interrupt
 

JohnInTX

Joined Jun 26, 2012
4,787
I cannot find the list of ISR's for the C8051F120.... I'm having problems finding the C code for calling the interrupts listed on that page.
To round out what I think you are asking:

The C code does not call interrupt routines. The processor gets interrupted and it calls the routine at the address specified by the interrupt source.

Interrupt routines are special in that the interrupted code's context must be saved before executing any IRQ service (ISR) and restored before returning to the interrupted code. In C you will generally have some #pragma or other keyword associated with the ISR function definition that tells the compiler 1) that its an interrupt service and the compiler needs to save / restore context; 2)where to locate the code i.e. the vector and 3) in some 8051 implementations, which register bank to use.

Between the brackets is up to you.. i.e. what the code does to service the interrupt must be written. You'll also have to sort out the various register settings to enable / configure the interrupt system for your chip and the hardware connected to it. Welcome to embedded programming!

From your link, the class looks like a good one. The instructors may supply some standard routines if that's what you are looking for. Its more fun to write your own.

Have fun.
 

Arm_n_Legs

Joined Mar 7, 2007
186
Are you asking about how to write interrupt routines in C. Below is an example of writing the timer 0 interrupt routine. The interrupt number, as in the example, 1 defines timer 0 interrupt. The number that corresponds to a particular interrupt is defined in the compiler manual.

If you are using the Keil C51 compiler, the list can be found at http://www.keil.com/appnotes/files/apnt_103.pdf



void timekeeper(void) interrupt 1
{
TF0=0; // Reset Interupt Flag​
TH0=0xb8; // Next overflow in 5 ms​
TL0=0x00;​
}
 
Top