Master's thesis - Multi-purpose system for measuring electrical power supplied by electric sockets
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
latex-masters-thesis/problemexpres.tex

154 lines
12 KiB

\section{Embedded system}
An embedded \gls{system} is some combination of computer \gls{hw} and \gls{sw}, either fixed in capability or programmable, that is specifically designed for a particular function \cite{ganssle2008embedded}. Industrial machines, automobiles, medical equipment, cameras, household appliances, airplanes, vending machines and toys (as well as the more obvious cellular phone and \gls{pda}) are among the myriad possible hosts of an embedded \gls{system}. Embedded \glspl{system} that are programmable are provided with programming \glspl{interface}, and embedded \glspl{system} programming is a specialized occupation.
9 years ago
\subsection{Processing units}
The term embedded \gls{system} is quite broad, so there is no surprise that the spectrum of used processing units is also wide. Since the general purpose microprocessors require external components, namely memories and peripherals, they tend to consume extra power and a board space. Since the design limitations of an embedded \glspl{system} are most of the time low physical size, low power consumption and/or long uptime and ruggedness (more components mean more parts could fail), microprocessors are seldom used. However, most of the commonly used architectures and word lengths are covered. Due to aforementioned reasons, microcontrollers are favored over microprocessors.
9 years ago
\subsection{System-on-chip}
Today's state of chip integration allows production costs of a complex \gls{system} on chip devices to be relatively low, thus making \gls{soc} attractive choice for embedded \glspl{system}. \glspl{soc} could be described as an \gls{ic} that integrates all components of a computer or other electronic \gls{system} into a single chip. It may contain digital, analog, mixed-signal, and often radio-frequency functions - all on a single chip substrate \cite{flynn2011computer}. \glspl{soc} are very common in the mobile electronics market because of their low power consumption. A typical \gls{soc} consists of (specific block diagram can be seen on \ref{f:ar_block}):
\begin{itemize}
\item a microcontroller, microprocessor or \gls{dsp} core(s)
\item memory blocks including a selection of \gls{rom}, \gls{ram}, \gls{eeprom} and \Gls{flash}
\item timing sources including oscillators and phase-locked loops
\item peripherals including counter-timers, real-time timers and power-on reset generators
\item external \glspl{interface}, including industry standards such as \gls{usb}, FireWire, \Gls{ethernet}, \gls{uart}, \gls{spi}
\item analog \glspl{interface} including \glspl{adc} and \glspl{dac}
\item voltage regulators and power management circuits
\item a bus connecting these blocks
\end{itemize}
9 years ago
\glspl{soc} can be implemented as an \gls{asic} or using a \gls{fpga}.
9 years ago
\subsection{Operating system}
An \gls{os} is a computer program that supports a computer's basic functions, and provides services to other programs (or applications) that run on the computer. The applications provide the functionality that the user of the computer wants or needs. The services provided by the operating \gls{system} make writing the applications faster, simpler, and more maintainable.
9 years ago
Over time, a lot of embedded \glspl{os} suited for embedded \glspl{system} were developed. An embedded \gls{os} is a type of \gls{os} that is embedded and specifically configured for a certain \gls{hw} configuration. \Gls{hw} that uses embedded \gls{os} is designed to be lightweight and compact, forsaking many other functions found in non-embedded (i.e. desktop) computer \glspl{system} in exchange for efficiency at resource usage \cite{holt2014embedded}. This means that they are made to do specific tasks and do them efficiently. Notable embedded \glspl{os} currently in use by consumers include:
\begin{itemize}
\item \textbf{Symbian} - used in cell phones, mainly ones made by Nokia
\item \textbf{Embedded \Gls{linux}} - used in many other devices like printers, \glspl{router} or smart TVs; Android \ref{f:android_scr} is a subset of embedded \Gls{linux}
\item \textbf{BlackBerry \gls{os}} - for BlackBerry phones
\item \textbf{iOS} - subset of Mac \gls{os} X, used in Apple’s mobile devices Palm \gls{os}
\item \textbf{Windows Mobile}
\end{itemize}
9 years ago
9 years ago
\begin{figure}[ht!]
\centering
\includegraphics[width=.4\textwidth,angle=0]{android_scr.png}
\caption{The Android 5 (Lollipop) screenshot - the most common \gls{os} is among the embedded ones}\label{f:android_scr}
9 years ago
\end{figure}
\subsection{Real-time operating system}
A \gls{rtos} is just a special purpose \gls{os}. The real time part of the name does not mean that the \gls{system} responds quickly, it just means that there are rigid time requirements that must be met. If these time requirements are not met, the results can become inaccurate or unreliable\cite{jean2002microc}. Embedded \glspl{system} frequently posses the real time requirement. There are two kinds of \glspl{rtos}:
9 years ago
\begin{description}
\item[Hard Real Time]- \gls{system} delays are known or at least bounded. Said to be operating correctly if the \gls{system} can return results within any time constraints.
\item[Soft Real Time]- critical tasks get priority over other tasks and will retain priority until the task is completed. This is another way of saying that real time tasks cannot be kept waiting indefinitely. Soft real time makes it easier to mix the \gls{system} with other \glspl{system}.
\end{description}
9 years ago
\subsection{Embedded Linux}
\Gls{linux} itself is a \gls{kernel}, but \Gls{linux} in day to day terms rarely means so. Embedded \Gls{linux} generally refers to a complete \Gls{linux} distribution targeted at embedded devices. There is no \Gls{linux} \gls{kernel} specifically targeted at embedded devices, the same \Gls{linux} \gls{kernel} source code can be built for a wide range of devices, workstations, embedded \glspl{system}, and desktops though it allows the configuration of a variety of optional features in the \gls{kernel} itself. In the embedded development context, there can be an embedded \Gls{linux} \gls{system} which uses the \Gls{linux} \gls{kernel} and other software or an embedded \Gls{linux} distribution which is a prepackaged set of applications meant for embedded \glspl{system} and is accompanied by development tools to build the system\cite{hallinan2010embedded}.
9 years ago
With the availability of consumer embedded devices, communities of users and developers were formed around theses devices: Replacement or enhancements of the \Gls{linux} distribution shipped on the device has often been made possible thanks to availability of the source code and to the communities surrounding the devices. Due to the high number of devices, standardized build \glspl{system} have appeared like OpenEmbedded, Buildroot, OpenWrt, and LTIB.
9 years ago
\subsection{Kernel}
The \gls{kernel} is the essential center of a computer \gls{os}, the core that provides basic services for all other parts of the \gls{os} \cite{bovet2005understanding}. It has complete control over what happens in the \gls{system}. A \gls{kernel} can be contrasted with a \gls{shell}, the outermost part of an \gls{os} that interacts with user commands. \Gls{kernel} and \gls{shell} are terms used more frequently in Unix or Unix-like \glspl{os} than in IBM mainframe or Microsoft Windows \glspl{system}.
9 years ago
\begin{figure}[ht!]
\centering
\includegraphics[width=.6\textwidth,angle=0]{linux_block.jpg}
\caption{The simplified view on the \Gls{linux} \gls{system} structure}\label{f:linuxbl}
9 years ago
\end{figure}
The simplified view on the \Gls{linux} \gls{system} structure can be seen on \ref{f:linuxbl}. It does not include device drivers, compilers, deamon, utilities, commands, library files and such, but should be enough for a demonstration.
9 years ago
\subsection{OpenWRT}
OpenWrt is an \gls{os} (in particular, an embedded \gls{os}) based on the \Gls{linux} \gls{kernel}, primarily used on embedded devices to route network traffic. The main components are the \Gls{linux} \gls{kernel}, util-linux, uClibc and BusyBox. All components have been optimized for size, to be small enough for fitting into the limited storage and memory available in home \glspl{router}.
9 years ago
OpenWrt is configured using a command-line \gls{interface} (ash \gls{shell}), or a web \gls{interface} (LuCI). There are about 3500 optional \gls{sw} packages available for installation via the opkg package management \gls{system}.
9 years ago
\newpage
9 years ago
\section{GL.inet board}
GL.inet Smart \Gls{router} is a remake of a common TP-Link \gls{router} TL-WR703N. The board changes include, but are not limited to, increased \gls{ram} and \Gls{flash} memory, custom \gls{firmware} and what is the most important - 5 usable \gls{gpio} pins exposed to the 2cm pin header for utility. Whole thesis is revolving around taking advantage of this fact. The frequency of \gls{cpu} is 400 \gls{mhz} and it is suited for running \Gls{linux} distributions for embedded devices, preferably OpenWrt or DD-Wrt. The board provides \gls{lan} and \gls{wan} connection, as well as other \glspl{interface} defined in \gls{ieee}. The information about the board are summed up in the table \ref{t:charact}.
9 years ago
\begin{table}[h]
\caption{The basic characteristics of the GL.inet board}\label{t:charact}
\medskip
\centering
\def\arraystretch{1.5}
\setlength{\tabcolsep}{12pt}
\begin{tabular}{|l|l|}
\hline
Model & GL-iNet 6408A / 6416A \\
\hline
\gls{cpu} & Atheros 9331, 400 \gls{mhz} \\
\hline
\gls{ram} & DDR 64\gls{MB} \\
\hline
\gls{rom} & \Gls{flash} 8\gls{MB} (6408A) / 16\gls{MB} (6416A) \\
\hline
\Gls{interface} & 1 \gls{wan}, 1 \gls{lan}, 1 \gls{usb}2.0,
1 Micro \gls{usb}(Power), 5 \gls{gpio} \\
\hline
Wireless & \gls {ieee}802.11n/g/b, \gls{ieee} 802.3, \gls{ieee} 802.3u \\
9 years ago
\hline
\end{tabular}
\end{table}
\subsection{Atheros AR9331 wi-fi System-on-Chip}
The Atheros AR9331 is a highly integrated and cost effective \gls{ieee} 802.11n 1x1 2.4 G\gls{hz} \gls{soc} for \gls{wlan} \gls{ap} and \gls{router} platforms. The block diagram of the chip can be seen on figure \ref{f:ar_block}. Features of this \gls{soc} are following:
9 years ago
\begin{itemize}
\item Complete \gls{ieee} 802.11n 1x1 \gls{ap} or \gls{router} in a single chip
\item \gls{mips} 24K processor operating at up to 400 \gls{mhz}
\item External 16-bit \gls{ddram} or \gls{sdr} memory \gls{interface}
\item \gls{spi} NOR \Gls{flash} memory support
\item No external \gls{eeprom} needed
\item 4 \gls{lan} ports and 1 \gls{wan} port \gls{ieee} 802.3 Fast \Gls{ethernet} switch with auto-crossover, auto polarity
\item Fully integrated \gls{rf} front-end including \gls{pa} and \gls{lna}
\item Optional external \gls{lna}/\gls{pa}
9 years ago
\item Switched antenna diversity
\item High-speed \gls{uart} for console support
\item \gls{i2s}/\gls{spdif} audio \glspl{interface}
\item \gls{slic} for \gls{voip}/\gls{pcm}
\item \gls{usb} 2.0 host/device mode support
\item \gls{gpio}/\gls{led} support
\item \gls{jtag}-based processor debugging supported
\item 25 \gls{mhz} or 40 \gls{mhz} reference clock input
9 years ago
% \item Advanced power management with dynamic clock switching for ultra-low power modes
\item 148-pin, 12 mm x 12 mm dual-row \gls{lpcc} package
9 years ago
\end{itemize}
\begin{figure}[ht!]
\centering
\includegraphics[width=.8\textwidth,angle=0]{AR9331_block.jpg}
\caption{The block diagram of the Atheros AR9331 \gls{soc} used as a main processing unit on GL.inet board}\label{f:ar_block}
9 years ago
\end{figure}
\subsection{From TL-WR703N to GL.inet}
TP-Link TL-WR703N \gls{router} is a popular choice among \gls{hw} customisation community because of it's cheap price tag compared to processing power and usage of a full-grown \Gls{linux} distribution. People have figured out how to upgrade \gls{ram} / \Gls{flash} memories or to make use of not used \gls{gpio} / UART ports for their own needs. These solutions however were mostly crude and expensive to replicate. The GL.inet team saw an opportunity to grasp this public knowledge and rolled out their own improved board clone to the marked.
9 years ago
Whole printed circuit board of TL-WR703N was remade by the GL.inet team to expose the unused \gls{gpio} ports on the \gls{soc}, utilize two \Gls{ethernet} port instead of one and utilize the \gls{usb} 2.0 port. Memory chips were replaced by their higher capacity alternatives.
9 years ago
\begin{figure}[ht!]
\centering
\includegraphics[width=.8\textwidth,angle=0]{gl-inet_pcb_up.jpg}
\caption{The front side of the GL.inet board exposing the main Atheros \gls{soc}, \gls{ram} and \glspl{interface}}\label{f:board_front}
9 years ago
\end{figure}
\begin{figure}[ht!]
\centering
\includegraphics[width=.8\textwidth,angle=0]{gl-inet_pcb_down.jpg}
\caption{The back side of the GL.inet board exposing the \Gls{flash} memory and a main voltage regulator}\label{f:board_back}
9 years ago
\end{figure}