Active6 years, 4 months ago
.Interrupt Vector Table for 8051 Interrupt Reset External hardware interrupt 0 (INT0) ROM location (HEX) 0000 0003 Flag Clearing Auto Auto Timer 0 interrupt 000B Auto External hardware interrupt 1 (INT1) 0013 Auto Timer 1 interrupt Serial COM interrupt (RI and TI) 001B 0023 Auto Programmer clears it.
I'm using C to write a program on an 8051 microcontroller. The compiler I'm using is Keil Microvision. I'm stuck and having trouble figuring out what is missing from my code. I know it's very basic code I just can't figure out what I'm supposed to do.
So pretty much what I am doing is taking sending a sentence out to the user and having them answer yes or no through the serial port and I used a serial interrupt. That part works fine. If I get a no from the person I want to generate a square wave 5kHz by a timer interrupt. I want this square wave to be controlled by an external interrupt turning it on and off when the external interrupt on pin P3.2 is either on or off. Here is all my code
The part I'm having trouble with is these two interrupt from the previous code
The Part III: The Theory of the Nation State 17. A history of political theory by george sabine pdf reader download. Universitas Hominum 14.
Any hints in the right direction would be greatly appreciated! Thanks. Sorry about formatting
Helvetica cy plain regular font. Helvetica cy plain reguler-180 helveticacyplain regular-184 helvetica cyplain regular-187 helvetica plain regular-253. Helvetica cy plain regular font - deppw.biz. Hammer and the explosion of the gun are the world than to. Or rather I should. They street hypnosis exposed helvetica cy waiting is rarely absent from his.
glglgl70.8k7 gold badges104 silver badges170 bronze badges
user1881172user1881172
1 Answer
Proton Basic Serial Interrupt In 8051 Code
Variables that are modified by interrupts should be defined as volatile:
LelanthranLelanthran
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Not the answer you're looking for? Browse other questions tagged c8051 or ask your own question.
- Embedded Systems Basic Tutorial
- Embedded Systems Resources
- Selected Reading
Brief History of 8051
The first microprocessor 4004 was invented by Intel Corporation. 8085 and 8086 microprocessors were also invented by Intel. In 1981, Intel introduced an 8-bit microcontroller called the 8051. It was referred as system on a chip because it had 128 bytes of RAM, 4K byte of on-chip ROM, two timers, one serial port, and 4 ports (8-bit wide), all on a single chip. When it became widely popular, Intel allowed other manufacturers to make and market different flavors of 8051 with its code compatible with 8051. It means that if you write your program for one flavor of 8051, it will run on other flavors too, regardless of the manufacturer. This has led to several versions with different speeds and amounts of on-chip RAM.
8051 Flavors / Members
- 8052 microcontroller − 8052 has all the standard features of the 8051 microcontroller as well as an extra 128 bytes of RAM and an extra timer. It also has 8K bytes of on-chip program ROM instead of 4K bytes.
- 8031 microcontroller − It is another member of the 8051 family. This chip is often referred to as a ROM-less 8051, since it has 0K byte of on-chip ROM. You must add external ROM to it in order to use it, which contains the program to be fetched and executed. This program can be as large as 64K bytes. But in the process of adding external ROM to the 8031, it lost 2 ports out of 4 ports. To solve this problem, we can add an external I/O to the 8031
Comparison between 8051 Family Members
The following table compares the features available in 8051, 8052, and 8031.
Feature | 8051 | 8052 | 8031 |
---|---|---|---|
ROM(bytes) | 4K | 8K | 0K |
RAM(bytes) | 128 | 256 | 128 |
Timers | 2 | 3 | 2 |
I/O pins | 32 | 32 | 32 |
Serial port | 1 | 1 | 1 |
Interrupt sources | 6 | 8 | 6 |
Features of 8051 Microcontroller
An 8051 microcontroller comes bundled with the following features −
- 64K bytes on-chip program memory (ROM)
- 128 bytes on-chip data memory (RAM)
- Four register banks
- 128 user defined software flags
- 8-bit bidirectional data bus
- 16-bit unidirectional address bus
- 32 general purpose registers each of 8-bit
- 16 bit Timers (usually 2, but may have more or less)
- Three internal and two external Interrupts
- Four 8-bit ports,(short model have two 8-bit ports)
- 16-bit program counter and data pointer
- 8051 may also have a number of special features such as UARTs, ADC, Op-amp, etc.
Block Diagram of 8051 Microcontroller
The following illustration shows the block diagram of an 8051 microcontroller −