summaryrefslogtreecommitdiff
path: root/electronics/cw2
diff options
context:
space:
mode:
Diffstat (limited to 'electronics/cw2')
-rwxr-xr-xelectronics/cw2/build.sh3
-rwxr-xr-xelectronics/cw2/cable.sh4
-rwxr-xr-xelectronics/cw2/clean.sh4
-rw-r--r--electronics/cw2/final.asm69
-rwxr-xr-xelectronics/cw2/wordcount.sh3
-rw-r--r--electronics/cw2/writeup.tex118
6 files changed, 201 insertions, 0 deletions
diff --git a/electronics/cw2/build.sh b/electronics/cw2/build.sh
new file mode 100755
index 0000000..bd6f7ab
--- /dev/null
+++ b/electronics/cw2/build.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+pdflatex writeup.tex
+
diff --git a/electronics/cw2/cable.sh b/electronics/cw2/cable.sh
new file mode 100755
index 0000000..f435e0b
--- /dev/null
+++ b/electronics/cw2/cable.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+sudo modprobe ftdi_sio
+sudo chmod 777 /sys/bus/usb-serial/drivers/ftdi_sio/new_id
+sudo echo "0403 bd90" > /sys/bus/usb-serial/drivers/ftdi_sio/new_id
diff --git a/electronics/cw2/clean.sh b/electronics/cw2/clean.sh
new file mode 100755
index 0000000..cf008c8
--- /dev/null
+++ b/electronics/cw2/clean.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+shopt -s extglob
+
+rm -rf !(*.tex|*.sh|ref.bib|*.asm|images)
diff --git a/electronics/cw2/final.asm b/electronics/cw2/final.asm
new file mode 100644
index 0000000..fd4ad7d
--- /dev/null
+++ b/electronics/cw2/final.asm
@@ -0,0 +1,69 @@
+init:
+ clrf PORTA ; make sure port A output latches are low
+ clrf PORTB ; make sure port B output latches are low
+ bsf STATUS,RP0 ; select memory bank 1
+ movlw b'11111111' ; set port A data direction to inputs
+ movwf TRISA
+ movlw b'00000000' ; set port B data direction to outputs
+ movwf TRISB
+ bcf STATUS,RP0 ; select memory bank 0
+ BACK equ B4
+ goto main
+
+volow:
+ movlw b'00000001'
+ movwf PORTB
+ goto main
+vomid:
+ movlw b'00000011'
+ movwf PORTB
+ goto main
+vohigh:
+ movlw b'00000111'
+ movwf PORTB
+ goto main
+vovhigh:
+ movlw b'00001111'
+ movwf PORTB
+ goto main
+
+
+convert:
+ andlw b'00001111'
+ movwf BACK
+
+ andlw b'00001100'
+ btfsc STATUS, Z
+ goto volow
+ movf BACK, W
+
+ andlw b'00001100'
+ sublw b'00000100'
+ btfsc STATUS, Z
+ goto vomid
+ movf BACK, W
+
+ andlw b'00001100'
+ sublw b'00001000'
+ btfsc STATUS, Z
+ goto vohigh
+ movf BACK, W
+
+ andlw b'00001100'
+ sublw b'00001100'
+ btfsc STATUS, Z
+ goto vovhigh
+ movf BACK, W
+
+ goto main
+main:
+ ;goto vovhigh
+
+ call readadc0
+ movf B0, W
+
+ goto convert
+
+ goto main
+
+ end
diff --git a/electronics/cw2/wordcount.sh b/electronics/cw2/wordcount.sh
new file mode 100755
index 0000000..ed898ea
--- /dev/null
+++ b/electronics/cw2/wordcount.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+detex writeup.tex | tail -c +85 | wc -w # using the tail to cut of the stuff detex cant handle
+
diff --git a/electronics/cw2/writeup.tex b/electronics/cw2/writeup.tex
new file mode 100644
index 0000000..1432b3f
--- /dev/null
+++ b/electronics/cw2/writeup.tex
@@ -0,0 +1,118 @@
+\documentclass[a4paper,12pt]{article}
+
+\usepackage{geometry}
+\usepackage{titling}
+\usepackage{titlesec}
+\usepackage[english]{babel}
+\usepackage[hidelinks]{hyperref}
+\usepackage{listings}
+\usepackage{xcolor}
+\usepackage{graphicx}
+\usepackage{setspace}
+\usepackage{ragged2e}
+\usepackage{graphicx}
+\graphicspath{ {./images/} }
+
+\definecolor{codegreen}{rgb}{0,0.6,0}
+\definecolor{codegray}{rgb}{0.5,0.5,0.5}
+\definecolor{codepurple}{rgb}{0.58,0,0.82}
+\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
+
+\lstdefinestyle{mystyle}{
+ backgroundcolor=\color{backcolour},
+ commentstyle=\color{codegreen},
+ keywordstyle=\color{magenta},
+ numberstyle=\tiny\color{codegray},
+ stringstyle=\color{codepurple},
+ basicstyle=\ttfamily\footnotesize,
+ breakatwhitespace=false,
+ breaklines=true,
+ captionpos=b,
+ keepspaces=true,
+ numbers=left,
+ numbersep=5pt,
+ showspaces=false,
+ showstringspaces=false,
+ showtabs=false,
+ tabsize=8
+}
+\lstset{style=mystyle}
+
+\titleformat{\section} {\Huge} {} {0em} {}[\titlerule]
+\geometry{a4paper,total={170mm,257mm},left=25mm,right=25mm,}
+
+\author{Lucas Standen}
+\title{Creating a simple radio receiver, with a volume intensity meter}
+
+\begin{document}
+\maketitle
+
+\newpage
+\tableofcontents
+\newpage
+
+\setlength{\parskip}{1em}
+
+{\setlength{\parindent}{0cm}
+\section{System planning}
+
+\subsection{Analysing the problem}
+In modern times the need for a radio has obviously fallen, with the rise of TV sets and the internet, generally being a faster method of receiving information, however in some situations, a radio is still preferable. For example if you are hiking, you may be out of range of cellular data, and a TV would require, power and signal which you wont have; in a situation like this a radio is perfect, being a low power device, that can receive important safety information. Similar situations can be drawn for all outdoor use of electronics, weather its a hike, sailing trip, off grid living or something else, a radio can be a valuable tool for keeping up to date on important information.
+
+I believe creating a simple radio receiver will be helpful to those looking for the capabilities of listening while on the go, it can be small and practical as someone who hikes a lot myself, I would enjoy this project, so I can listen to the news, music or a podcast while hiking, without needing to worry about draining my phones battery, which is better saved for emergency situations.
+
+\subsection{Design specification}
+The product I would like to build for this project is a simple radio receiver, it should receive signals, demodulate them, amplify them and play them out of a speaker. To add something more interesting to my project, I will add a bar graph display that displays the intensity of the currently playing sound.
+
+The design should focus on simplicity, as less points of failure should result in something reliable. I have in the past, owned a radio for hikes, however it had multiple dials which all clogged with mud, and now it doesn't work; I would much rather have something that is pre tuned to my desired values and left as is.
+
+\section{System design}
+
+\subsection{Subsystem designs}
+To build my project, I will split it into manageable subsections, that can each be tested and evaluated. The subsystems I intend to build are:
+\begin {description}
+ \item[The receiver:] \hfill \\
+ This will be the part of my system that detects the weak incoming radio signals from the outside world weak incoming radio signals from the outside world.
+
+ \item[The initial amplifier:] \hfill \\
+ This will boost the small incoming signal to a more reasonable size, to make it easier to process, working with small values may result in signal degradation.
+
+ \item[The demodulation system:] \hfill \\
+ This will take the incoming wave, that will be encoded as an AM signal (not FM), and convert it to the audio wave I wish to detect.
+
+ \item[The volume control amplifier:] \hfill \\
+ This will be another amplifier that controls the volume of the signal, before it reaches the audio system.
+
+ \item[The audio intensity meter:] \hfill \\
+ This will consist of a micro controller (Picaxe 18M2 using the WJEC assembler), and a bar graph, and will show me the current volume of my system.
+
+ \item[The push pull power amplifier:] \hfill \\
+ This will boost the power output of my system, allowing it to drive a small speaker (or perhaps headphones), and output the desired audio.
+
+ \item[The speaker:] \hfill \\
+ This is the audio output of my system.
+\end{description}
+
+\subsubsection{The receiver}
+\subsubsection{etc}
+\subsubsection{etc}
+
+\subsection{Subsystem testing}
+\subsubsection{The receiver}
+\subsubsection{etc}
+\subsubsection{etc}
+
+\subsection{Subsystem results}
+\subsubsection{The receiver}
+\subsubsection{etc}
+\subsubsection{etc}
+
+\section{System realisation}
+\subsection{Circuit diagram}
+\subsection{Circuit realisation}
+\subsection{Circuit testing}
+\subsection{Circuit results}
+
+\section{Evaluation}
+}
+\end{document}