Changeset 36


Ignore:
Timestamp:
Sep 3, 2010, 5:05:30 PM (8 years ago)
Author:
mulligan
Message:

More on Claudio's presentation: upto interrupts and their handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D4.1/Presentation/Paris-September-2010.tex

    r34 r36  
    8484\begin{frame}
    8585\frametitle{Special function registers (SFRs)}
     86\begin{itemize}
     87\item
     88The special function registers (SFRs) are areas of memory dedicated to controlling specific functionality of the 8051.
     89\item
     90The 8051 maintains the illusion that SFRs are a part of internal memory: writing 1 to the serial port is achieved by moving 01h to memory location 99h (an SFR controlling serial port activity).
     91\item
     92However, SFRs are \emph{not} part of internal memory: any modification to memory addresses 00h--7Fh modifies internal RAM, whereas 80h--7Fh modifies the SFRs.
     93\item
     94On the standard 8051, there are 21 SFRs, falling into three basic classes: those related to I/O, those related to controlling the operation of the processor, and auxiliary SFRs.
     95\item
     96Derivative processors are also free to add bespoke SFRs that control additional functionality of their chips.
     97\end{itemize}
     98\end{frame}
     99
     100\begin{frame}
     101\frametitle{I/O SFRs}
     102\begin{itemize}
     103\item
     104The 32 I/O lines of the 8051 are controlled by four SFRs: P0--P4.
     105\item
     106Individual I/O lines are controlled by setting bits of the requisite SFR.
     107\item
     108Bit 0 of port 0 is pin P0.0, for instance.  Writing 1 to this bit will send a `high' level on the corresponding output line, whereas 0 corresponds to a `low' level.
     109\end{itemize}
     110\end{frame}
     111
     112\begin{frame}
     113\frametitle{Control SFRs (I)}
     114\begin{itemize}
     115\item
     116There are seven control SFRs: PCON, TCON, TMOD, SCON, IE, IP and PSW.
     117\item
     118Setting PCON places the processor into a power saving mode.
     119\item
     120TCON is a control flag for the processor's timers, and signals when they overflow.  Further, some non-timer related functionality is included, related to how external interrupts are activated.
     121\item
     122TMOD sets the operating mode of the timer: an 8 bit timer that autoreloads, one 16 bit timer, a 13 bit timer, or two separate 8 bit timers.
     123\item
     124IE is the `interrupt enable' flag, used to enable and disable specific interrupts.
     125\end{itemize}
     126\end{frame}
     127
     128\begin{frame}
     129\frametitle{Control SFRs (II)}
     130\begin{itemize}
     131\item
     132IP is the `interrupt priority' flag.  The 8051 has two interrupt priority modes: low and high.
     133\item
     134An interrupt with a high priority can always interrupt another interrupt of lower priority.  An interrupt with high priority can never be interrupted (even by another with high priority).
     135\item
     136PSW is the `program status word'.  This contains a number of important flags, for instance, Carry, Overflow, Parity, etc.  This SFR also contains the flag used to select the active register bank.
     137\end{itemize}
     138\end{frame}
     139
     140\begin{frame}
     141\frametitle{Auxiliary SFRs}
     142\begin{itemize}
     143\item
     144There are 10 auxiliary SFRs: SP, DPL, DPH, TL0, TL1, TH0, TH1, SBUF, ACC and B.
     145\item
     146SP is the stack pointer.
     147\item
     148DPL and DPH are the `data pointer high' and `data pointer low' SFRs.  These act together to give a 16 bit data pointer used in operations regarding external RAM and code memory.
     149\item
     150Oddity: though there's an explicit instruction to increment the DPTR, there's no instruction to decrement it.
     151\item
     152TL0--TH1 are the timers.
     153\item
     154SBUF is the 8051's serial buffer.
     155\item
     156ACC and B are two accumulator registers, with ACC being the primary accumulator.
     157\item
     158Only a small number of operations involve the B register, so this can optionally be used as an additional general purpose register.
     159\end{itemize}
     160\end{frame}
     161
     162\begin{frame}
     163\frametitle{Addressing modes}
     164\begin{itemize}
     165\item
     166The 8051 has three modes for addressing memory: immediate, direct and indirect.
     167\item
     168When using direct addressing, any location between addresses 00h and 7Fh is internal RAM, whereas addresses between 80h and FFh are SFRs.
     169\item
     170Oddity: the 8052 provides 128 bit extra internal RAM, and this cannot be accessed through direct addressing (address clash with the SFRs), use indirect addressing instead.
     171\item
     172Indirect addressing \emph{always} refers to internal RAM, never to an SFR.
     173\end{itemize}
     174\end{frame}
     175
     176\begin{frame}
     177\frametitle{Interrupts}
    86178\end{frame}
    87179
Note: See TracChangeset for help on using the changeset viewer.