oh yes hello I hope you're all feeling
nice and refreshed after lunch not
falling asleep too much so I'm Graham
Sullivan's you've probably seen me here
before I've spoke this is my seventh
talk in a row and I've been here eight
years ago previously I was at populous
Cisco recently moved over to destitute
research and innovation I spend a lot of
time at home tinkering with electronic
stuff I find it quite fun I like keep a
bit of a primer for folks who perhaps
when I get into electronics and have a
chance yet maybe wondering how to get
started I tweet a lot so if you want to
follow me see some balloons
so why hardware so obviously this is a
security conference and people like to
mess up with IOT and things like that
but I think it's interesting to get into
hardware not just because of that book
because you can just build really
interesting stuff I like playing around
with stage lighting so I built some
stuff to control safe lighting oops
sorry I just called on button to control
to safe flight in I like building
there's lots of LEDs so I've got some
sticks with like 200 LEDs on the beach
and you can control them Bob Wi-Fi
I think it's fun to play with hot air of
course on the on the work side of things
breaking hardware stuff is also
something I do is pop my job as useful
to be able to take some sort of board
apart and understand what it does just
by looking at it goofy part numbers and
things like that so are we talking a
little bit about doing that's one so
this talk outline we're gonna go over
some basic physics
I'll keep it light it's just the very
basic things that you need to know to
sort of understand how electricity works
really and then we're going over some
safety quickly just because I don't want
any of you coming away from here
thinking oh yeah
electricity works I should go tech pop
this CRT monitor and I'll poke around
inside no don't do that we're gonna go
over some common components that you'll
see on boards what they do and yeah what
circuit diagrams look like and what PCBs
look like and how you can interpret them
and what kind of thing some stuff about
logic so digital logic and how that
works in electronics processes and
different types of them interfaces that
those processes used to talk to other
things some tools that you might want to
take a look at and maybe get hold of
some options that you've got there and
at the end and I put a slide with a big
resource dump that you can then run the
mean reading them out you can just take
a photo with your phone or something and
then go
think through that on your own time so
it starts off with some physics because
of course that's what you want to do it
what 3 o'clock in the afternoon right
footage some sorts and definitions
voltage measure involves we get
different symbols different letters to
describe these different sort of
parameters for some reason we use I for
current because resistance measurement
knows and power less than what's now
you've all heard of voltage voltages
don't exist in the absolute the voltage
is a sort of energy difference so when
we talk about voltage we're talking
about the voltage between two points so
for example if you've got a nine volt
battery there's no sort of magic 9 volts
that exists what it is is a voltage
between those two terminals on the on
the primary this is quite a sort of
famous diagram of how voltage and
current and resistance sort of all fit
together so but it is kind of like the
force that pushes things along ocean
currents along the more voltage you got
the more current that is likely to flow
because of that resistance tries to stop
action so current it's sort of driven by
how much voltage you've got in the first
place and the more resistance you've got
than s current flow so they sort of the
the voltage and resistance are kind of
up odds of at odds with each other
so we describe that in maths using this
thing called Ohm's law so if you look at
this you see that so the voltage is
pushing and the resistance in ohms
modular homes is resisting so high
currents the amount of current that
flows through a circuit is equal to the
voltage of that circuit divided by the
resistance of that circuit and then
using basic algebra still remains that
so if you know any of the other two you
can work it out so for example if you
know that you've got a device that is
being supplied with the particular
voltage and you know how much current is
going through that you can work out what
that resists the resistance of that
devices and since the same with if you
know how much current is flowing and you
know what the resistance is you can work
out what the voltages I'm going to
quickly go over power but we're not
gonna talk about that too much in this
talk power is the product of voltage and
current power is literally the amount of
energy consumed by thing in in one
second so one what is one Joule per
second so if you got a 60 watt like one
that's turning 60 watts of electrical
energy into so 60 joules of electrical
energy into light and heat every second
these are just other ways to state it
again it's just algebra at the bottom
you might note this one is slightly
different because we can plug up Ohm's
law into this it turns out that if
you've got a device that you know the
resistance of and you know how much
current is flowing through it you can
work out the power without needing to
know the voltage it's quite useful but
we're not really gonna touch on this too
much it's just you know about safety how
many of you have heard the phrase it's
not the vaults that kill you it's the
apps I hate this advice I get told by
electronics people that is correct but I
know it's correct but it's terrible
terrible advice because without context
most of the time this this advice is
given is to people who don't really
understand electricity
that much and this on its own is really
misleading because which of these two
power supplies is more likely to kill
you but one with lots of amps or the one
with lots of volts the answer is the one
with lots of volts so electric shocks
human body resistance in the worst case
if you've got like a cuts and you've got
wet hands and you know it's on a bad day
it's down and around the 500 ohms range
of 150 thousand ohms the lethal current
that is how much current needs to flow
through your body in order to cause
fibrillation basically to stop your
heart it's about 100 to 200 milliamps so
the point 1 to point 2 of them using
Ohm's law you can workout that
effectively about 50 volts is enough to
kill you in the worst case but you're
probably thinking hang on a minute I've
shot myself on the mains before I hurt
so I help and get there the devil didn't
kill me it's way higher than 50 bullets
well that's because generally dry human
body resistance is much higher so if
you've got dry hands on you - catch
yourself on the mains you're more likely
to be around 10,000 to 100,000 ohms and
again if you put those numbers in like
23 clamps which is much love and less
like to kill you still obviously do
something comes with it but yeah so
these are sort of the approximate shop
thresholds yes there's a difference
between AC and DC the reason for this is
that your nerves work on work on
electrical impulse impulses now DC is
just a constant currently plugged AC is
kind of like turning it on and off very
very very very quickly and your nerves
respond to changes in voltage so because
the AC is like turning it on and off
very very very quickly it makes it much
harder for your muscles to sort of calm
safe for that voltage flow so AC can
cause your chest muscles to compress so
much that you can't breathe and you'll
suffocate so basically don't FAQ about
with main stuff but while it's on
because it's a terrible idea is is it
talks in here maybe not but he suggests
some alternative names for some of these
quite amusing that try to avoid silence
so it's the voltage that usually decides
your fate
so it is the ABS that kill you because
it's how many amps flow through your
body that determines whether you live or
die but what determines how much current
flows through you is how much multi
you've got in the first place so it's
important to like one last thing here
three things that you should never take
apart microwaves they've got a big
transformer in them they step the
voltage up to several thousand volts and
you took that you're probably dead CRT
anything with a CRT monitor I know some
of you quite young and probably I've
never even seen a CRT monitor but yet
don't take those apart that's a terrible
idea because they've got that you don't
wake up to about 14,000 volts on the
electron gun on that they will kill you
and third what is anything to do with
driving neon lights near the house of
the six kilowatt power supply show
dominicano that's a igneel light driver
don't take those apart other than that
you're mostly okay but try to stick to
the non main stuff stuff that sits
around flying to 12 maybe 19 ish holds
you mostly safe so we're gonna talk
about components so the things that make
up an electronic circuit there's two
main categories of component passives
and actives if you ask me to describe
the difference between passive and
active
I'd tends to two ways of looking at it
one of them is the
signal definition I see your lack of
either the physical definition is a
massive pain in the ass to understand
and not very intuitive effectively what
one of the main things is that our
active components can amplify power and
passive ones can't but then there's some
gray area around that it's a solute one
don't worry about it too much we'll talk
about it a little bit more in a minute
passives here you can see on the Left
these are all surface amount you might
be more familiar with components that
have actually got leaves coming off them
but in most things that you take about
the tech part these days they're all
gonna be serviced over components rather
than through whole so these are
resistors they're usually black
sometimes blue if they're like a special
precision resistors but they know that
using those numbers on top these are
capacitors they usually Brown and it's
also capacitors very different type
they've got these little cans sometimes
in things like power supply to see much
bigger fasters so resistors we mentioned
resistance already mentioned Ohm's law
resistors effectively limit the flow of
current at a good description you
probably so this little zigzag thing
that's the symbol for a resistor in a
circuit diagram there's also an
american-style symbol which is actually
just a box because you know it's easier
for them to understand it's not so I
think some point you might see a
resistor used is let's say you want to
power an LED off a 9-volt battery you
stick an LED directly over a normal
battery and it's going to go very very
bright then as we go very very dim then
it can go very very smoky because what's
happening there is because the voltage
is so high the LED pulls a lot of
current
too much current and therefore too much
power which gets dissipated as heat and
then it catches fire so what you
generally usually put a current limiting
resistor in series with that to ensure
that the LED can run at lower voltage
because an LED yomi usually likes about
two and a half to three and a half volts
depending on the LED capacitors
think of them like really really tiny
rechargeable batteries they can't store
much much energy but you can charge them
and empty them fairly quickly and you
can do that many many many many times
unlike a battery where you know
rechargeable battery recharging 10 20 30
times at least with the old-school
batteries and they stopped working but
they take a very long time so charge
like lipo batteries and things like that
you often see them in power stuff they
used in a lot of things that filters
radiofrequency stuff but mostly what we
really care about one way of sort of
taking things apart that mostly use the
power stuff that we tend to be looking
at so they're mentioning the capacitance
is measured in farad's you will very
rarely see a capacitor that has a
capacitance more than farad or even
anywhere near a farad because a ferret
is quite a lot talking there remain
capacitors for that know generally you
looking more around the sort of like
micro farad's range maybe a couple of
millions so ceramic capacitors or those
Mo's mlcc's and multi-layer ceramic
capacitors these are smaller devices
they've got very small capacitance
anywhere from you know that the bigger
ones are in like the one the single
digit micro farad's they go all the way
down to like Pico farad's very very very
small amount of capacitance they're
nonpolar you can connect them in either
direction there's no requirement to have
a positive voltage across it in one
particular direction or the other
ah the other type is electrolytic so if
you remember on the slide before the
other two types of capacitors the mlcc's
ones on the left one of the like ants on
the right those are electrolytic
capacitors are these are polar which
means that if you put them if you
connect them over a voltage source in
the wrong direction they know what or
does not work they store more
capacitance they've got they've got more
customs that you generally get up to
hundreds of micro farad's or even a few
ferrets and most of them even go be
bigger than that but you generally let's
in in most most types advices now you
might be thinking well why even bother
with the the little ones if you can have
the big ones well they're not perfectly
conductive they actually have an
internal resistance there this thing
called ESR which is called an equivalent
series resistance what that means is
they can only charge up and discharge at
a certain speed because there's a limit
on how much current can flow because
they have a resistance so these ceramic
capacitors the little capacitors have a
much lower ESR which means that they're
very good for high-frequency stuff so
say for example you want some sort of
energy reservoir so that's some power
your parents and device and you want to
make sure that it's got very smooth
power the problem with big capacitors is
they can't provide power very quickly
they come they can't change the amount
of current that the output very quickly
so ceramic capacitors are really good to
that because they've got a very low
internal internal resistance whereas
electrolytic capacitors they can store a
lot more energy but they've got a higher
ESR so there are a couple of other types
at the bottom tantalum 's I mean on film
they basically sit somewhere else the
spectrum between them some of them have
additional properties like being able to
withstand very high voltages and things
like that
but that's not too important well it is
if you're building your so here that
requires less hood there's another type
capacitive cord inductors effectively
like a little wire coil not going to
come in to them that much because but
I'm not going to go into them at all
because you mostly don't need to know
about them
other than if you see one it's probably
relate to power or radios does it but
mostly power
practice so you've got these active
components as well as passive components
are two component things like
transistors things like operational
amplifiers off hands and things like
logic gates so these are devices that
sort of
can switch things on and off they
usually have a power supply pins on them
that take some sort of power supply yeah
so for example you probably heard that
if you've ever looked into you know any
electronic stuff you probably seen an
example of a transistor switching an LED
on and off so that's that's those kinds
of sort of classes devices won't go into
them too much we're talk about logic
gates laser diodes so diodes are a weird
one there's an argument in the strict
definition they are active components
but most electronics engineers just
treat them as passives so diodes allow
the flow of current in one direction if
you try and pass current in the wrong
direction they don't pass current with
some slight exceptions so they're quite
useful things like protecting against
reverse polarity
by attaching a power source so you if
you've ever seen a device way you know
you can connect an AA battery and if you
vent the battery backwards it just
doesn't do anything
chances are there's a diode in there
protecting it from protecting the
circuit from inverse polarity because if
you don't have one you might blow a
bunch of stuff up I think these are also
dives light emitting diodes but yeah
it's one of these ones where they're
sort of hot they sit on that kind of
border of being active and passive a
little bit so circuit boards I'm
guessing a lot of Hugh if you look at a
circuit board you can see something like
this oh no oh my god what that hell does
any of that do it probably looks like a
giant mess there are some indications so
for example you can google something
part numbers I'm guessing by the fact
that that says Samsung and it's got some
number in there but that's probably RAM
or flash or something like that but it
can be quite difficult to sort of dig
around and work out what this all all
does so let's just take them all writ
more they kill this example anybody know
what this is take a good guess
oh it is a graphics card this is an
Nvidia
1080 with the hissings income taken off
it
anybody who's built a PC before can
probably guess what some of this stuff
does but so power on the right these
power connectors got these six pin
innate and power connectors do use use a
lot out too much to run through this
little piece y'all you pay for the
bottom so they have these big power
connectors these are what's called after
like an exorcism sub you can connect
multiple graphics cards together and
improve your performance from stop then
you've got obviously your outputs here C
but your hdmi and displayport or
whatever now a lot a lot of working out
what parts of a circuit board does what
is actually just sort of the geometry of
the thing the topology the way it's all
laid out so we know that this power
coming in here we can probably guess
that this is the GD yourself the
processor so we can see some power stuff
coming in here we can see a bunch of
electrolytic capacitors these big cam
asses are a bunch of stuff over here
that looks like a bunch of capacitors
and some other thing here these are
actually inductors but it looks like
some power related stuff over here and
some chips here that might be related to
power maybe then you've got the GPU we
know that the GPU has a bunch of VRAM on
it well these are RAM chips this is
around it and then you've got I want you
to stop here that's possibly related to
maybe output may be some other auxilary
functions you've got this imp up here so
there's maybe some stuff going on around
this connector is related that content
so if I wanted to know for example so
GPUs have fun what if I want to guess
where that fun way was stalled store
we've got power here this is a horse of
a collector power so probably all this
stuff over here is a power none of this
looks like it stores firmware what it
looks like is interests or grammar chip
which means that it's probably going to
be somewhere in this bit here now
somewhere
usually stored on little flash chips I
happen to know that this graphics card
has a dual BIOS functionality like one
stock pile someone overclocked files so
they're probably two chips for that and
I can see one little a kinship here and
one that late internship here which
means that that probably the blasters so
just based on taking a look at the board
and how its laid out and where things go
in where things go out my power comes
from where the connectors are you if the
board is well designed you can sort of
infer a lot from them that's not the
only thing that you can use so when
people are designing circuits let's say
you've got you know three engineers
working on a circuit or you know even 50
engineers working on a particular design
they need to be able to talk to each
other about you know particular sections
of the design or this thing around here
well rather than just saying that
transistor over there all that diode
over there what they do is they give
each part a an identifier unique
identifier for the the design so this
usually start with a letter or a
sequence of letters describing what the
part is so there's a resistor it start
with r if it's a faster it starts with C
and then you've got the number after it
which indicates which one it is so C 1 C
2 C 3 is equal for some reason well
actually you might be wondering why
transistors of Q if you can actually
read that it's a bit of a weird one
well T was already taken transformer and
I'm told the reason that it's a queue is
that old transistors used to be in like
a round case and I had a little melt app
coming off it and if you look at it from
the bottom around round circle with a
little tab comin off look like a kid
bitter silly knowledge so on that
particular board first go back a couple
of slides so this is zoomed in section
but this area here and you can see that
we've got some reference designators on
here so you've got the c-141 seven so
all of this is capacitors glasses these
are l32 five
l believes inductor so we have these are
inductors inductors picking up -
especially about how stuff q that's
transistors so go back we can guess that
these are all capacitors here these will
doctors and these are all transistors
these are all power what's called power
faces for that particular design so we
know that that's all related to power
but of course you don't just you know
when you're designing a board you don't
just start on the PCB you want a circuit
diagram to serve describe the circuit
initially and then once you got that now
you can turn that into a PCB design so
I'm guessing sometimes you look at you
thought we might find a circuit back up
online I think what the hell is any of
this do this is from xkcd of course
there are always always a relevant xkcd
I'm guessing sometimes you take a look
at it and you go oh my god what does any
of that do so here is another thing that
it's not particularly simple I mean this
is quite quite a simple circuit but it's
not completely trivial just to give you
an idea of what circuit diagrams look
like and how to interpret them so you
can see here that they use the
american-style resistor symbol so far
well you know it's a resistor d1 that's
diode secret and that's passed down you
can see that with this plus sign here
but it's an electrolytic type because
it's public here note the sign lines
nonpolar is likely a ceramic capacitor
usually on designs you'll see dots where
these lines joins and say that these are
connected
say for example here no dot not
connected just to be confusing no dot
still connected people with people about
it making circuit diagrams so this is
actually a voltage doubler circuit in
one corner so this is just saying go to
power let's just say go to ground this
is a slightly older circuit diagram
different circuit thank you
pop of light timer again difference in
the electrolytic capacitor but it's some
other spot positive similar showing that
it's electricity type itv1 push money
put this little drawing up a push button
here and these resistors you can see
that this is got a reference that
there's a negative r3 and the value of
470 ohms which is sometimes written is
not this is a really old style design
you can tell because they use this
symbol for ground which is a really old
symbol for ground you see that you know
it's it's really messy yeah like old TVs
in business
yeah and then without actually even
having any symbol showing where the
house coming from you just got this
thing that has just said what this
entire rail at the top runs out so what
you can X to quite 5 to 15 volts
positive and one thing I will point out
from the previous point is sometimes
it's another value you'll see a part
number so you've got diet one which is a
1n4007
though so that's that's the kind of
thing you like to see on all circuit
diagrams talk about that logic so logic
if you saw fits as Todd mentioned some
stuff around that briefly so logic here
or binary has ones and zeros in circuits
is represented with high and low
voltages so a voltage of zero volts or
local teachers is zero and about is the
positive voltage usually that means one
usually so generally yeah zeros zero
volts ones positive bulbs logic levels
so when we talk about positive voltage
how much positive voltage this is 100
volts 5 volts one of them usually you'll
see these 5 volts 3.3 volts with my
eyeballs yeah it depends on the device
an important thing to note is if you try
to connect a 5-volt logic device and the
3.3 volt logic device together and bad
things and have
pride so this isn't as an oscilloscope
trace trace by device without putting a
zero than a 1 and a 0 a 1 and a 0 and
you see that it's about about 5 volts so
you've got a 0 not about 5 volts 0 vol 5
months that's 0 1 0 1 yeah
same thing again but we 3.3 volts so
again the one is about 3.3 volts in the
zero is about general's so don't blow up
your hardware you might be familiar with
a few of these devices they have
different voltage logic logic levels so
some number than 5 volts some 3.3 volts
some of them like the teensy they run at
3.3 volts but the inputs will take 5
volts they're tolerant what's called
tolerant but if you put 5 all things to
say about 3pi
gqo and input pin you can blow not only
that I'm guessing you're all roughly
familiar with sort of the digital logic
stuff in terms of you've heard what an
XOR and an end is you know the same sort
of thing in programming all of this
comes from hard way so all of these pit
wise operations just come straight
hardware so you've got to the two inputs
a and B in these particular devices or
one important in case of Knapke
and they perform some sort function and
then they output something we use news q
as the output
I cannot remember why reasons possibly
related to the fact that he was used as
a transistor and these are made out of
transistors Vaughn I don't touch any
other yeah no idea so say for example
you put a low voltage to zero volts here
and a high voltage say 5 volts here you
go zero here because it's Manship it was
huddled here I don't share high voltage
here I mean you can stick a lot of these
gates together and other types of
devices to make various types of logic
circuits and build processors and blah
blah now one thing to mention is our
clocks so I'm guessing you've all heard
but you all know about processor clock
frequencies things like that so you know
you get an Intel Core i7 @ 3.5 gigahertz
or whatever well what that really means
is devices that have digital devices
that have a kind of state so whether
that be memory or whether you know
there'd be some sort of control device
in there there's doing some sort of
digital processing it could be a
microcontroller or microprocessor what
happens is that these devices are only
perform operations when the clock ticks
so usually what we say is it's on the
rising edge
I apologize for their lack of contrast
in this image on but I will just sort of
draw a red line so you can't see it very
well so what's happening here is a clock
signal it's just something that goes to
zero one zero one zero one zero one very
very very very quickly or very slowly
but usually pretty and what happens is
these devices perform an operation on
the rising usually on the rising but
sometimes on the falling but usually on
the rising edge in this clock so as the
transition varies from 0 to 1 we call
them tick and then there are two why the
tick so devices do do it on the falling
edge from a time bomb really here so
you're on the falling edge it would be
from 1 to 0 but most things on the
bottom edge and the time difference
between each tip is called the clock
period and if you take one over the
clock period so say that pop period is a
microseconds let's just say so the time
between here and here is one millisecond
u1 divide that you get thousands that's
1,000 that's all
kilohertz so that's that's what you get
pregnancies and things like that from so
we're gonna talk about processes
processes are sort of split into three
main types
you've got microprocessors
microcontrollers and programmable logic
now program will not be necessarily a
processor but I've put it onto this
category because it's easier to talk
about here so micro processors are they
fetch instructions they decode those
instructions and then they execute them
so if you've ever done anything to do
with processor design or processor
internals do anything say in course
module you might have heard about the
fetch execute cycle which is fetching
instruction execute instruction fetch
the next instruction basically nodes
instruction
microprocessors use external memory so
they have no RAM on board not in the
chip so they've been we have to put that
separately they have no flash on board
so they don't to store any code on board
this is less true of things like desktop
processors because that they've really
muddied the waters with that sort of
stuff but we're talking you know all
original processors mark processes
everything was kept external
they use external peripherals as well so
for example if you wanted to store some
configuration variables across the
reboots you can't be that insider
processor because there's no unless of
like a permanent fashion so that and
examply the side locks at eighty looking
at this room I'm guessing many of you
will have never heard of this thing
it's very processor the powers the ZX
Spectrum I chose this one specifically
because if I've said that Intel Core i7
most of the things I wrote on here about
them using external memory and
peripherals would be wrong because they
just really really do that on a modern
system it is very very bloated and
there's lots of things in there but yes
that eighty all it really does is these
first three things fetch decode execute
microcontrollers however they contain a
microprocessor but they also contain
memories they have their own brand
building on the jetty and they have
program flash built in
so the idea of these is you can program
a single chip with some wisdom code and
that chip on its own numbers like a
standalone device will execute that code
it has its own RAM inside it and you
don't need the supporting components
externally it also usually has things
like interval peripherals so for example
for a some of them have like a Wi-Fi
interface built into them things like
that there's sort of a general purpose
device so an example is the atmel atmega
328p which again you probably never
heard of but I guess you have heard an
Arduino that's the chip that's inside
nod it you know you know so that's what
comes that now program logic is a bit of
a weird one so if you remember the logic
gates I showed earlier think of it it's
like a giant configurable array of logic
gates you can sort of say okay I want
this logic gate and then I want to
connect it to this logic a and etc etc
and then that's a block and then I want
this block this block it's kind of like
logic Lego inside of inside of the chair
so yes an interconnected logic it
doesn't execute instructions not on its
own volition
it's an executed instructions it has
sort of measured logic stuff good
together
they use it for more specialist
specialist applications in some cases
they use for just like okay we want this
whole bunch of like our interconnecting
logic to talk to it to handle some
specific some specific thing but we
don't want to have say 70 chips to
implement this one thing so they were
just getting a towel or a PLA which is a
programmable logic array just a good
don't do that kind of thing you can make
them implement what processors and
microcontrollers because at the end of
the day processors are just a big array
of gates memory is just
what's got a flip-flop the Popeye sees
each flip-flop can solve one bit of data
and it used to cut big array of them
together well now you've got eight bits
of data that's a bite if you stick a
whole load of em together you can make
kilowatts on etc etc so you can
implement mic processors or
microcontrollers on these types of
devices particularly at PGA's an example
of FPGA is the lattice I sporty FPGA the
reason I mentioned this one is because
it's fairly obvious accessible the chips
are very cheap you can buy a little USB
dev board called the tiny FPGA it's
pretty pretty fantastic thing and it's
AI think it's like 60 $60 or something
is it is it even less well what $55 yeah
so if you won't play around with FPGA
team you do that there and an example
application is I don't know how many of
you have heard of risk 5 but risk 5 is
code like an open-source processing
architecture so you know you've got like
x86 you've got arm well risk 5 is a
different architecture and it's designed
to be open so it's an open specification
and there are a bunch of implementations
risk 5 implementations for FPGAs so if
you wanted to build a device that's open
source all the way down to the sort of
processor logic level you can use that
to build let use EJ's to be that kind of
thing interfaces well these devices on
their own not very useful unless they
can talk to talk to other things so just
like with a laptop you might have an
Ethernet cable you might have USB
microprocessors and microcontrollers
need interfaces to talk to other
peripheral devices say for example flash
chips temperature sensors external
memory i/o are gyroscopes that kind of
thing
even just LEDs so the most simple is
GPIO if you're in fences for earlier you
mentioned you guys judo so GPIO is
simple output but I face it we just pins
that come off of the processor and that
you can reconfigure them to do different
things so the most simple thing you can
reconfigure them to do is be an output
or an input so an output so this is a
what we know code yeah an output you can
configure entity an output you can write
a hi to it which sets the voltage high
and you can set right loads they accept
quality but in fact this example makes
an LED on on and off with one second gap
in this obviously can do to set of
inputs and just read whether it's not
although voltage so you aren't so you
artists often miss described as cereal
cereal just generally means that
something that happens in one big line
that's not parallel but a lot of cereal
effectively all it is is a way of
sending bits down wire in a sequence so
you get this solve it and then it will
turn this bits 1 2 3 4 5 7 8
so 0 7 so that's what bytes and you have
to stop it so you can send in two bites
down why it's what this code does is it
says okay I want to send 9600 bites down
the wire every second it's coordinated
system board that the older ones of you
will know what board is more than the
younger ones because we've been playing
with the optical modems so all this
isn't really doing is saying okay send
the ASCII value H down the wire and E
and Allah etc etc season hello well some
users send text read bytes and they can
also receive as well Suzy UART are used
for like debug outputs on brutal boards
and things like that all the time
now rs-232 is also disguised as serial
they are not the same thing rs-232 is
quite an older protocol if anybody
remembers serial
on the back of all pcs the lot the old
ninepenny serial connectors and DV nines
so the way that works is you've got a
voltage all the way with as high as 15
volts only that was negative 15 volts
and what happens is in order to
represent ones and zeros anything
between plus 3 plus 15 it it's actually
a zero and anything between minus 3 and
minus 50 is ideal one just to be weird
so here you've got the say it's the same
sort of scheme as you are so you can see
here you've got this stop it and stop it
bits transferred in between this is
literally the same same thing you will
this stop it you've got one one zero
cause you got these represented one
represents a zero all the way through
and any but you stop it it's important
to know the difference between these two
things because if you try to plug an
rs-232 outputs into a you up receiver
you will probably blow up your you up
receiver because plus and minus 15 volts
is not minutes going through your
receiver you aren't operates at the the
logic level of board so as we're
discussing before 5 volts take my 3
volts 1.8 volts sometimes lower but you
usually going to see 5 point 5 5 5 volts
input my free so yeah don't put that in
into the wrong thing but you get rs-232
receivers I guess the obvious duty to
zip instead cheaply online again by like
15 the money life and nothing which is
good because about 10 percent you broke
them on their one that's purely so as me
eyes a little bit more more complicated
than the previous two actually I stands
for serial peripheral interface again
flash tips if you remember the BIOS
chips that I was mentioning and
mentioning on that and video card they
get to spoken to by spines going
generally you have this concept of a
SQLite master and spi slave
slightly problematic terminology but
this autumn's from like the 1970s or
something so it uses slightly different
these days you might also see primary in
a second
the idea is if you make remember I
mentioned the clock before so master
device provides this clock to say when
data should be read off the or sense so
this is mozzie master out slave in
mustard out slave and the Sun is coming
out of the master in slave and then a
master in laid out say about the idea is
this is a spent essentially like
transmit and receive then modern you
want this thing on SS this can also be
called DX or CS so excess means slave
select DX means device select CS means
chip select they all mean the same thing
and what that basically means is when
the SPI master SS said to the asserts
the SS signal the slave says those slave
starts listening and the idea is that to
save pins because adding more pins to
devices is expensive to save pins you
can have say let's say you've got five
slave devices and what master device you
can have the clock and i/o lines shared
across all of those and then one select
line per device so the idea is that then
if you want to talk to one specific
device you just say you just assert that
one pen for that for that chips select
and then send stuff over the sense of
the rest of the wires again use the this
gets used all over the place but small
devices like temperature sensors and
temperature sensors and flakka memory
and things like that
I squared C is another thing that's very
similar to SPI is you pretty much
exactly the same types of application
again it's a against red and shaped bus
sort of design except in this particular
case I suppose you only have one data
line it's quite directional so the
devices transmit and receive
the same lot of snap online and the SCL
bottom is the clock n which is provided
by the my son casino IDs don't worry too
much about this all this means is that
there's a couple of pull-up resistors on
here the idea is that when these devices
stop talking it causes the voltage on
these lines to sort of float weakly up
towards the vault the vulture Pro and
that's just to do with how the protocol
works in terms of the little hardware
but the way that these devices can tell
which one master wants to talk to at
once is they each have an address
the address is usually I think is so
busy
it's an 8-bit value since seven so of
course it's a seventh bit value just to
be confusing seven bit value usually you
get the option so in the part state
machine you'll see how you can figure
that usually there's like a couple of
pins that you pull high or low to
configure what app addresses you usually
have fairly restrictive configurability
like you can't configure the full seven
bit address you'll be able to configure
two three bits of that address so the
idea being if you've got three and the
same device you have the same device you
can just configure those to be slightly
different from each other I haven't got
time to go into SM possible SF buses I
can't have more modern version of this
that runs on top of I squared C and it's
used in PC motherboard a lot through tag
so again if you were in fittest or Kelly
attack will have been mentioned so JTAG
joint test action group which is a weird
thing to call in his face really it
stops now there's kind of a way to test
the boards have been properly the world
working properly that from a particular
connector you can see that all of the
parts that were on there are all talking
but we're all available and working and
even Talton then they started adding in
debug functionality so judo tanks are
really cool because you can if you get
it configured right which is a massive
hand and you ask most of the time you
can stop debugging check so you can
cause the tip to reset you can stop
going through them like GEB and
and through the code that's running on
that processor and even dump memory and
things like that and then isp and ice
ice SP ISP is in system programmer and
ICS P is in circuit serial programmer
they're effectively the same I think
there's a I'd like slight differences in
the actual protocol and how they work
but they're effectively they do the same
thing so what used to happen way way way
before this existed was if you had a
device that had to have some fun web
program on programmed onto it and the
board will go for the production line
you have to pre flash those chips
separately before they got sold it onto
the board that's a real pain in terms of
like mass manufacturing so what they did
is they came up with this thing called
ISPs or ICS P and the idea is you've got
like a header that's on there that you
can then while that chip is in the
circuit use it to program that chip
program phone where once there it also
means that you can use it to reflash
existing boards once you've got them so
there are cases where you can flash like
third-party servers something with is
PHP so some tools I recommend you get a
multimeter don't get like the absolute
cheapest Chinese knockoff one because
chances are I can't say it is safe for
you know 230 volts or something and just
take it and then it will explode just
getting any old friend of one get a
cheap one doesn't really matter you
don't need massive precision out of it
it's just you talk about telling you
know where where power rail is for
example so just this pin out five volts
going to it yes this opponent does have
five volts going to it so much meter bit
simple
the dead easy to use you can Google if
you confused about how to use one but
you can find out online usually much in
current as well things like that
oscilloscopes oscilloscopes are really
useful because you can use them to debug
circuits but you can also use them to
reverse engineer things the ds2 one two
is kind of cheap I think it's things
like sixty pounds or something
fifty sixty pounds looks like a smart
phone and it's got a couple of channels
and you can hook that up to things and
see the signals that are flying up
across a particular pen in real time
deadly use for dead team I recommend
getting one if you're just looking for
looking for a looking cheap option
you've got this other thing called this
openwork mental logic sniffer well this
is it support is a bit like a bus pirate
but with lots and lots of pins on the
end and it can only receive and the
other is think the each of those pins
can only receive a logical one or a
logical zero they can't report any more
granularity than that so it's a it's a
logic analyzer but there's some software
that comes along with that that allows
you to define what each pin means for a
particular protocol and then decode the
results of that so if you've got a say
for example SPI bus and you want to go
to sniff the data that's coming up back
you go
okay well that was and it'll tell you
all the data that was going across and
show you where the transactions sort and
stop Pecos there's a more expensive
option is a USB oscilloscope this is
more of a professional tool I have one
of these it's really great the software
that comes with it I think runs on
Windows Linux and Mac it's pretty decent
they are quite expensive I think the the
cheaper models start at around 600
pounds I recommend is going on eBay and
looking to see if you can find
secondhand ones and B stock models
because when new board revisions come
out picot tech dump all of they're
always stock models on eBay for like I
think it's like 50% of the retail price
yeah great that's ket alternatively if
you want a proper oscilloscope and you
don't want to pay too much but you don't
care if it's massive bulky heavy and
power-hungry
get yourself an old CRT scope I have one
of these it's older than me and it still
works it's pretty fantastic
so yeah that's good another good option
terms of interfaces are FTE t32 h boards
are absolutely
you can get them very very cheaply again
about 77 quid - Fitz's 7-7 hacks four
seven seven pounds with it up the name
sorry yeah you can do quite a lot of
things with just this board it speaks
spy it speaks I swear to you speak to
you up it's very useful there's the bus
pirate I don't like it that much
I like the Hydra bus the Hydra bus is
like the most pirate the faster better
and has a bunch of extra support Glasgow
Glasgow is not finished really it's it's
an ongoing project it's being built by
two people onto the white clock and mark
and 42
it's an FPGA based tool the idea is that
instead of having one chip that tries to
deal with lots of things you have a
reprogrammable chip that you say okay I
would like the specialist application
and then you flash that particular
application on it for doing one specific
thing so say for example you want to
talk HDMI for example like other tools
that that would be very difficult to do
with Glasgow you just flash the HDMI
core that and then run it the idea I
think is that it going to cost about 70
pounds 70 80 pounds when they come out
there is only about ten revision see
boards in existence but if you ask
nicely there are some people on tour so
it won't make you one so keep an eye out
for that because it's a pretty cool tool
for development stuff for building your
own things I recommend odd we know it's
a fantastic platform to get stuff done
it's really easy
the documentation is written with people
who have never done the electronic stuff
in mind kids use it you can work your
head around it very easily it's quite
nice
no times you know the MCU boards are
like Arduino boards except they run
Wi-Fi they were on what's called an
esp8266 and use them for doing like
Wi-Fi IOT stuff I have an absolute ton
of them the LED sticks that I mentioned
there were enough known MCU boards so
that you can control remember the Wi-Fi
you don't see is practically pies and
FCC's single what computers I don't
really like them that much for doing
hardware stuff but something would
paradox prop just gets a mention here
and it's a little bit like an Arduino
it's not quite so well supported but
it's pretty cool because it's got like
multiple cores so the idea is that you
get like eight or 16 cores in one chip
they're a little bit more expensive but
if you want to do stuff that's got like
multi-core support so you want to do
something that's very very parallel
heavy you can plan that for radio stuff
I'm just gonna make it go this you can
get an auntie LFTR for about 10 pounds
it's a TV tuner device that you can
repurpose as a software-defined radio
then you've got the sort of mid-price
commercial commercial options reached
hack RF and played RF and then if you
want to go too pricey USRP the price
here wants to transmit as well as
receive so in conclusion I think more
people should play with hardware I think
it's one of these things where you don't
need to necessarily have a huge amount
of like domain background knowledge and
electronics to start paying kids like
Audrey no make it super easy and you can
take the things that you learn from
building things and use it to apply into
your work for breaking things so yeah I
remember them and that is the end of the
talk
and as promised here is my tied list of
things that you should go take a look at
feel free to write only so you do