Interrupts in 8051 8051 Micro-controller by Ravinder Nath Rajotiya - December 3, 2021December 3, 20210 Interrupts in 8051 What is an Interrupt: It is a requesting mechanism for the peripherals to make the microcontroller interrupt the currently executing program and run the program to service the request. The program that is run upon the interrupt is called an ISR (interrupt service routine) Types of Interrupts in 8051 There are five different sources of interrupts A real life example - Before going to sleep, you set the timer. Then forget what the timer does, and go for sleep. When the timer finishes the counting, it alarms and interrupts you from sleep. You then wake and starts doing your routine. sources of interrupt in 8051 are: Timer-0: Timer-0 interrupts Timer-1: Timer-1 interrupts Serial Rx/Tx INT0 INT1 All interrupts in 8051 are vectored interrupts Interrupt
8051 Timers 8051 Micro-controller by Ravinder Nath Rajotiya - December 3, 20210 Timers in 8051 There are two timer in 8051, Timer-0, Timer-1;--- Use of timers: To produce precise delay timing Counting the events Generating baud rate Registers associated with timer operation are: TMOD 89h TCON 88h TH0 8Ch TL0 8Ah TH1 8Dh TL1 8Bh Format of TMOD and TCON registers TMOD SFR (89h) Timer-1 Timer-0 D7 D6 D5 D4 D3 D2 D1 D0 Gate C’/T M1 M0 Gate C’/T M1 M0 1: COUNT only if INT1 (P3.3) input pin is high 0-count regardless of INT1 1- Count pulses on pin T1(P3.5) 0- Count every machine cycle 00 Mode-0; 13 bit timer 01- Timer 16 bit 10 mode-2; 8-bit auto reload 11- Split timer mode 1: COUNT only if INT0 (P3.3) input pin is high 0-count regardless of INT0 1 Count pulses on pin T1(P3.5) Count eevery machine cycle 00 Mode-0; 13 bit timer 01- Timer 16 bit 10 mode-2; 8-bit auto reload 11- Split timer mode Timer Control SFR Timer Control TCON SFR (88h) Bits D7 D6 D5 D4 D3 D2 D1 D0 Bit Address 8F 8E 8D 8C 8B 8A 89 88 Bit Name TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0 Description Timer-1
Program to Read from external memory 8051 Expriments by Ravinder Nath Rajotiya - June 3, 2021May 9, 20220 Objectives: To learn interfacing of external memory with 8051 To understand the instructions for accessing the memory To develop a program to read and write data to external memory Theory: 8051 Microcontroller on the other hand has onchip 4KB of ROM and 128B of RAM. 8052 has 8KB of program memory (ROM) and 256 bytes of data memory (RAM). For simple to less complex applications this is sufficent, but, If the program and data tend to be larger and require more memory than available on 8051/8052 then external RAM and ROM can be interfaced with 8051 microcontroller. Thus, there is a provision of connecting both external RAM and ROM i.e., Data Memory and Program. Interfacing memory with 8051 We can interface a maximum of
ARM Class Notes Embedded Systems by Ravinder Nath Rajotiya - January 22, 2021May 10, 20210 2-Comparison of Embedded Systems with general purpose processors (1) L-12 Comparison of ARM and PIC embedded Sys L-13 ARM Data path L-14 ARM Registers L-15 ARM Instruction set L-16 ARM Exception Programming L-17 ARM interrupts L-19 ARM Thumb Architecture L-20 ARM Bus L-21 Serial Parallel Communication L-22 DMA L-23 Amba I2C L-24 SPI L-25 ARM PCI L27 Embedded Software L28 Emulators and Monitors L29 Embedded Software Design L-30 Concept of Real Time Systems L-31 Real Time Systems Task Scheduling L-32 Software quality measurement L-33 Software Quality Measurement-2 L-34 Testing embedded systems L-35 Compilers for embedded systems L-36 RTOS L-37 RTOS Multi Tasking L-38 Embedded Linux OS L-39 RTLinux L-40 Real Time Sceduling RTOS intro
Timer Programming in 8051 8051 Expriments by Ravinder Nath Rajotiya - December 4, 2020May 27, 20210 Programming 8051 Timers Registers used for normal operation (No interrupts) TMOD, TH1,TL1, TH0, TL0, and TCON TMOD to set the Mode Timer Register to set the count TCON to start and stop the timer Registers used for Interrupt operation IE, TMOD, TH1,TL1, TH0, TL0, and TCON TMOD to set the Mode Timer-0 and Timer-1 Register to set the count TCON to start and stop the timer Register Formats: Interrupt Enable (IE) Register IE.7 IE.6 IE.5 IE.4 IE.3 IE.2 IE.1 IE.0 EA ET2 ES ET1 EX1 ET0 EX0 =0, disable =1 enable -- Enable/disable serial port interrupt Enable/disable timer-1 Ov interrupt Enable/disable external interrupt-1 Enable/disable timer-0 Ov interrupt Enable/disable external interrupt-0 TMOD Register: Timer-1 Timer-0 GATE C/T’ M1 M0 GATE C/T’ M1 M0 =1; The timer/counter enabled while INTx and TRx bit is set =0, timer enabled whenever TRx bit is set 1 = Counter 0=Timer 00=13 bit timer mode (8-bit timer/counter with TLx as 5-bit prescalar 01=16 bit timer mode, THx and TLx cascaded,