8051 Tutorial 6: 8051 Interrupts Programming in C

What is an interrupt?

An interrupt is an asynchronous signal that needs attention. An interrupt stops the CPU of a microcontroller, leaving the tasks that it is currently doing, to give attention to the interrupt signal. Once the attention has been given to the interrupt signal, the CPU goes back to its unaccomplished task before the interrupt has occured and continues the task.

The Interrupts of AT89C2051

The interrupts of AT89C2051 is compatible with the interrupts of the original 8051 microcontroller. It has 6 interrupts sources ( 5 interrupts + RESET). The interrupt sources of AT89C2051 are the following:

Interrupt Source Priority Number
1 RESET RST N/A
2 External Interrupt 0 IE0 0
3 Timer 0 Interrupt TF0 1
4 External Interrupt 1 IE1 2
5 Timer 1 Interrupt TF1 3
6 UART Interrupt RI or TI 4

Please note that in this tutorial, we will not consider the interrupt from RESET.

The table above shows the interrupt sources of AT89C2051 and their respective interrupt priority number. Knowing the priority number is important specially if two different interrupt sources occur at the same time. [Read more...]

Pages: 1 2 3 4

8051 Tutorial 5: 8051 UART Programming in C

What is UART?

UART stands for Universal Asynchronous Receiver/Transmitter. As its name implies, it is universal. It can be used to establish a communication between a microcontroller and another device – microcontroller, USB controller, Bluetooth modules, GSM modules, GPS modules, personal computers, etc.

I am not going to discuss the UART protocol here. If UART is still unknown to you, you may read this article from wikipedia first.

What is RS-232?

RS-232 is a standard for serial transmission of data between a DTE (Data Terminal Equipment) and a DCE (Data Circuit-terminating Equipment). It is commonly found in desktop computers where it is commonly referred as COM port. You can read this wikipedia article for more info about the RS-232 standard.

AT89C2051 UART

The AT89C2051 has one UART port. Its TXD (Transmit) pin is the same as its P3.1 pin. Its RXD (Receive) pin is the same as its P3.0 pin.

[Read more...]

Pages: 1 2 3 4

USB Development Board

USB has established itself as the new standard for connectivity. That is why USB connectivity has become the “holy grail” of most embedded applications.

Well, let me get straight to the point. If you want to start developing projects with USB interface, you want to have  the  proper development tools. To have the tools that you need, you either have to buy or to do-it-yourself.

If you want to build a USB development board yourself, here is one for you. [Read more...]