SPEAKER: All right, let's
talk about schematics.
Why?
Because a lot of people in
Chrome OS write firmware
and they need to
look at schematics.
They don't need to understand
how exactly it works, but they
just need to know to
walk of the design
to understand how things
connect from point A to point B.
When you first look at a
schematic, it's pretty scary,
but actually, we're not
designing rockets here.
We're just making Chromebooks.
And we've done this for-- well,
I mean, Chromebooks, maybe
like 10 years or so,
but laptops, we've
been doing for a very long time.
So there's no science here,
and you can kind of break down
the problem into little parts.
So really, what
you're looking at
is you have a source
where you're starting
to look at the schematic.
There's a lot of exciting
stuff and then the destination.
You don't have to look
at 50 pages all at once.
You just have to look
at one wire at a time.
So let's start from
the way beginning.
You have a battery.
The schematic
symbol for a battery
looks like one of
those two things.
There's a positive end
and a negative end,
and our dear friend,
Benji, decided
that we would follow the
flow of positive charge out
of the battery.
It turns out, he
was totally wrong,
and the real answer is we
should be following electrons,
and that's called the
electron flow model.
And that's what electricity
actually does, but it turns
out, we actually don't care.
We're electrical engineers.
We don't care if we go
from B to A or A to B,
we just care that your
light bulb turns on.
So we actually
follow the wrong way,
and we denote the
way, so to speak--
the positive terminal
is usually a red wire
and the negative
terminal is a black wire.
That is not true for
your house wiring.
Do not try this at home, you'll
get very unhappy results.
The ground symbol
down there is usually
what we refer to as ground.
It's drawn like this
in the schematic.
It's totally wrong.
We use the wrong
grounding symbols,
but that's just how we do it.
SKCD kind of talks
about this at length.
You can go read the
comic one of these days.
So here's a real
Chromebook battery.
This is from a AMD
Lenovo Chromebook,
and you can actually see
the little wires there.
You've got two reds and two
blacks, so you already know,
oh yeah, the red
wire's positive,
so charge comes out of the
battery on the red wires
and goes through the
entire Chromebook
and comes back through
the black wires.
And in case you're
blind or colorblind,
there is a nice symbol, plus
and minus, on the pack for you.
Oh, too quick.
On the right, that's the
schematic equivalent.
It doesn't look like
a battery at all
because we're not
actually putting
a battery in the schematic.
We have a connector that
connects to the battery.
So this is the symbol
for a connector,
and you can see we've got
some ground wires connecting
to the battery pack.
And there's a whole
bunch of exciting stuff
we put on all our schematic
symbols, so you'll see things
like the manufacturer, the
part number, the number of pins
in case you can't count.
We have a Google
part number, which
is a part number
we use to track all
this information in an extremely
slow database at Google.
We have this thing,
the J14, it's
called a reference designator.
We'll talk about
that in a second.
We have the actual
schematic symbol,
and then there's
ground down there.
What is a reference designator?
There are so many
parts on these designs,
we have to be able to
track each individual one
from the schematic all the
way to the real manifestation
of itself.
So this header, as we
call it, is called J14,
and J14 has its place on
the printed circuit board,
and that's what it
looks like right there.
And in real life,
if you were to take
a picture of the connector,
you would see, oh,
this is where J14 is, OK.
So, as you're
tracing problems, you
have to use these reference
designators to find out where
you need to look on the board.
That's all they are.
There's a whole bunch of
different designators.
These are kind of some
of the ones you'll see.
There is sort of a
standard but not really.
People will screw
it up all the time.
You don't get docked
points if you do it wrong,
just people look at you funny.
The ones you'll see the most
are Q, U, J, D, C, and R.
Sometimes, you'll see Y.
OK, so from our
battery connector,
I'm going to expand the
schematic a little bit.
So now, there's a
whole bunch of wires
and a whole bunch of text.
This text is what we
refer to as a net name.
Each wire, we give
a name, and that
allows us to track
where this wire goes
as it travels from
point A to point B.
There's a whole bunch
of numbers next to it,
and that tells us which sheet
this net name will appear,
because unlike
code, where we have,
like, unlimited space, we still
print on paper, which is absurd
and it drives me insane.
But there's no
good solution yet,
so we still draw on
individual sheets.
So for instance, if you look
at 28, on the top net name,
it says 28 and 23.
So on page 23, you'll see
there's the net name there,
and on page 28, it's
there in two other places.
And that helps us flip
sheets and figure out
where to look for this stuff.
Let me go back a little bit.
The bottom net is actually in
bold and it starts with PP.
That's your telltale sign that
this is not a digital line,
it's a power line.
And we have a very
loose set of rules
to describe how we name
power nets, PP or PN.
I've never seen a
PN in a Chromebook,
so you can more or
less ignore that one.
PP is the positive voltage.
And then right after that,
we give you the voltage
that it is in millivolts,
or if the voltage varies,
we'll call it VAR.
And then afterwards is domain,
and I just put a bunch of text
there, but the truth is,
there's absolutely no standard.
We totally mess this
up all the time.
It's completely inconsistent
between every project,
so it's a zoo.
So the only important two things
is the first two parameters.
You can ignore the last one.
So here's an example,
PP 5,000 always.
It's positive, it's 5
volts, and it's always on.
So back to our schematic,
we have PP VAR BAT.
So positive power, variable
voltage, and it's the battery.
All right, and it makes
sense because the battery,
as you charge and discharge
it, its voltage changes.
And this is why it's PP VAR
and not PP some known number.
OK, let's expand the
schematic a little bit.
I added some stuff in
the upper corner here.
Now, we have a new rail
that's PP 3,000 H1 always.
So H1's our security chip,
and then this tells us, OK,
it's 3.3-volt rail, it's
to the security chip,
and it's always on.
Great.
Now, we have these
squiggly things.
We refer to those as resistors,
and really, their sole purpose
in life is to slow
down circuits so
that we don't get fun sparks.
And I'll show you
a video of what
happens if you don't do that.
All right, no.
Bad.
OK, I screwed up.
I clicked the wrong buttons.
All right, this guy talks a lot.
So he's using a wrench, which
has a really, really small r,
and he's shorting a big
car battery, all right?
So if you basically
have no resistance
and you were to plug in a
battery in your Chromebook,
this is what you
would get, which
I would argue would
be an awesome product
but probably not what we
strive to achieve here.
And the way that
it does this is it
converts extra energy into heat.
So whenever you have a
heating element at home
and it gets really hot,
or like your toaster,
it's basically a
glorified resistor that
heats up and grills your toast.
So we have a whole bunch of
text next to resistors as well.
You see the reference
designator on top starts
with an R. That tells
us it's a resistor,
in case you can't see
the resistor symbol
for some inexplicable reason.
The next value is the
resistance in ohms.
So this one is a 5,000-ohm
resistor, essentially.
For reference, our body,
if we're super sweaty,
we're about at a
kiloohm, and if we're
on the verge of dying of thirst,
we're around anywhere from 100
to a mega ohm, which is
why if you touch an outlet
and you're super thirsty,
you'll probably live,
but if you touch an outlet and
you just finished a marathon,
you'll definitely
feel the outlet.
So the percent tells us how far
off of that resistance we are.
Because we live
in the real world,
it's impossible to
get an exact resistor,
so this tells us
that in this family,
this is 1% error rate on the
value of this resistance.
And then the number
below is 0201.
That's the size of the resistor,
and in electrical engineering,
we use completely
nonsensical measures.
We use mils, which is a
thousandth of an inch,
so this is two
thousandths of an inch
by one thousandth of an inch.
So it's pretty small.
We have smaller,
but I don't like
to torture myself that way.
And the last parameter
is the wattage.
It's how much heat
it can dissipate
without self-destructing.
Typically, we don't show
that in the schematic
because the package size has a
standard wattage rating for it.
Now, asterisk, that's
not always true,
but for the sake of
Chromebooks, it is.
Oh yeah, not quite there yet.
OK, so let's do
a simple example.
I have a battery.
I have a resistor.
Ohm's law, the super
smart guy, figured out
that the voltage across
the resistor that
will be burned as heat
is equal to the current
through times its resistance.
So you can extrapolate that.
For power is--
the amount of heat
it generates is the
voltage times the current.
So if we put in
a simple problem,
you have 5 volts and 1
ohms in a 0201 package.
You do the math, you end
up with 25 watts of heat.
Now, if you've ever touched
a 100-watt light bulb,
you know it's really hot,
but 25 watts at a 201,
you'll get this.
This is what happens.
And in other words, I
get fired, all right?
So this resistor, it's a
quarter of a watt resistor,
and it was attached
straight to 120 volts,
so this is what happens.
So don't do this at home, folks.
Come on.
There it is, yeah.
OK, all right, so let's
revisit this problem.
Instead of 1 ohm, let's
do 100k ohms, right?
You do the math and you end
up with 25 milliwatts of heat.
That's way better.
You don't get a Chromebook
that goes on fire.
Everyone's happy.
All right, one more
thing about resistors.
We use this rule all the time.
And pretty much all the math I
learned in college, I forgot.
This is the only
thing I use every day.
It's the voltage divider.
If you have two resistors
and you have an input voltage
at the top, you
can figure out what
the voltage between those
two resistors is going to be,
and that's the equation.
I'm not going to
derive it for you.
So suppose we have 5 volts,
a 2 kiloohm and a 1 kiloohm.
You do the math,
and in the middle
there, on Vout, you'll
get 1.66 volts, always.
OK, back to our schematic.
Why do we have a 0 ohm there?
Why do we bother
putting a resistor that
has no resistance?
This is absurd.
Well, we work with printed
circuit boards, and printed
circuit boards, you
can't change them.
So we get a printed
circuit board,
and imagine I had to cut
that line right there.
Well, I get out an exacto
knife and I very carefully cut,
and that's very
painful and I cut
myself and it takes a while.
So we just put resistors
everywhere that are 0 ohm,
and then we can remove
them, and now, we
can rewire the
printed circuit board.
So you'll see a lot in the
schematic, this DNS on there.
That means Do Not Stuff.
In other words, don't
put the part on.
So yeah, I put it
on the schematic,
but I actually don't put it
on the printed circuit board
when you make the
printed circuit board.
There's other names for this.
There is Do Not Populate, Do
Not Install, and other ones
that I haven't imagined yet.
There is no standard here, so.
Oh, I've seen asterisks.
That's another one.
OK, so now, let's expand
our view a little bit here.
There's these little
bar-looking things down there.
Those are capacitors.
Their sole purpose in life
is to store energy for later.
So again, reference
designator, starts
with a C and then some number.
The value is in Farads.
The package size.
This is 042, so it's
slightly bigger.
50 volts is the maximum you
can put through this capacitor
before it explodes, and
the temperature coefficient
is something you can
completely ignore.
It's totally irrelevant.
So if you go over 50 volts,
this is what happens.
Now, it's worth
noting that there's
a whole bunch of different
capacitors out there,
and they all fail in
magically different ways.
This is an
electrolytic capacitor
and it makes a lot of
smoke, and that's by design.
It's called venting.
The alternative is having
it explode, like for real,
like a grenade, and
that's way worse.
So the venting, as
catastrophic as it looks,
it's way better than
the alternative.
All right, so now, we
know about resistors.
We know about capacitors.
Let me talk about
the only filter
you'll ever see in a Chromebook.
This is called a low-pass
filter, also referred
to as a step response of an RC.
There's a fancy equation there.
You can forget it.
The only thing that's
important is that it slows down
how quickly electricity
goes into the capacitor,
and it's a known
calculatable amount.
So over time, what will happen
with a circuit like this is
your voltage will slowly ramp,
and the amount of current
will start high and
then slowly come down
as the capacitor fills up.
So in this schematic here
that we're working on,
I expanded our view a
little bit and look at that.
There's an RC
filter right there.
Also yeah, low-pass filter.
It's drawn a little
differently, right?
The power's on top, the
resistor is vertical
and the capacitor is
vertical, but that's
exactly what that is.
OK, so now, we've got these
super complicated shapes
down here.
Those are MOSFETs.
This is a transistor, and pretty
much, without transistors, we
can't do a whole lot.
Asterisk, we can talk
about that later.
OK, the part on the
left is called the gate.
That's the control signal
that turns your transistor
on and off.
The bottom part is called
the source and the top one
is called the drain.
That arrow points into the
gate, and that tells us
the polarity of the MOSFET.
There's different types.
You can almost always forget
all kinds of polarities.
The only one we ever
deal with in NMOS.
Asterisk, we do deal with
PMOS, but you can ignore those.
And those two lines
connected together
tells us where the source is,
in case the text isn't there.
So again, transistors,
the reference designator
starts with a Q.
The part number.
There's a drain-to-source
maximum voltage
before the part lights on fire.
The ohm value, we'll talk
about that in a minute.
There is a drain current,
the amount of charge
you can put through the
part before it explodes
and lights on fire, and
then the package size
is a whole different world
that we won't get into.
You can ignore it,
it doesn't matter.
These two parameters are fun
because if you don't do that--
So this is a 60-volt
MOSFET, and it's
being over voltage with 120
volts from the utilities.
This one decided
to light on fire.
Sometimes, they
explode like popcorn
and it makes a popcorn sound.
It does not smell
nearly as good.
MOSFETs are very complicated.
They have a ton of parameters.
The data sheets
are pretty dense.
But for the sake of just
walking through schematic,
the only thing that matters
is the gate-to-source voltage,
the resistance between
the drain and the source.
And this is always given
in a data sheet for a part.
And you can see
that, on the graph,
I have my gate-to-source
voltage in the horizontal axis
and my resistance in
the vertical axis.
So the transistor has a
very, very high resistance
when the gate-to-source
voltage is 0,
and as I increase the
voltage, it precipitously
drops and essentially
becomes one ohm.
So really, what we have here is
a voltage-controlled resistor.
The more I apply voltage
to the gate to source,
the lower the resistance.
OK, so let's apply this
principle in practice.
So here, I drew
a little circuit.
I have an input on the left,
and my output's on the right.
It's connected to a 1.8-volt
rail to the EMMC storage
device, and its power is 0,
which means when the whole
processor is up.
It's connected to 100k ohms.
OK, so suppose I have
0 volts on my input.
The gate-to-source
voltage, so the voltage
between the 0 ohm and the
source, which is at the bottom
here, is 0.
They're the same voltage.
They're all 0.
So I'm going to call my
resistance three megaohms.
What do we have here?
We have a voltage divider.
So let's do our
voltage divider math.
It turns out that our
output is 1.74 volts.
Awesome.
Now, if I put 1.8
volts on the input,
my resistance goes
down because I have
a voltage-controlled resistor.
So let's say it's four ohms, you
do the voltage divider stuff,
you end up with 71 microvolts.
And putting this in tabular
form, if I give it 0,
I get 1.7 volts.
If I get 1.8 volts, I
get essentially 0 volts.
I have an inverter.
So the voltage I
give it, it gives me
the opposite on the way out.
Incredibly useful stuff.
And it turns out, we have
an inverter right here.
The battery pack is a
resistor inside of it.
We actually kind of annotate
this form of schematic.
We call these open
drains, and we'll actually
change the net name to have
an OD at the end of it.
So whenever you see
OD, you know, OK, it's
got that kind of setup in there.
And yeah, I won't
go into why we call
it open drain other than that's
the drain we're referring
to when we call it open drain.
OK, I kind of didn't talk
about this little symbol guy,
but let's talk about him now.
This is a diode.
It's called the body diode.
Let's talk about diodes before
we talk about body diodes.
Diodes let current go towards
where the arrow is pointing
and blocks current when
the arrow is not pointing.
So if I have a 3.3 volt
on one side and 1.8,
the diode will turn on,
and if I have the reverse,
the diode will block that.
Diodes' reference
designator starts with a D.
They have a maximum
forward current,
they have a reverse
blocking current,
and if you don't respect those--
these are fun.
They explode like grenades.
They do not smell good either.
OK.
So diodes in a perfect
world would just do this
and they wouldn't
consume any power,
but we don't live in a perfect
world, so like a resistor,
it will convert some of
that energy into heat.
And that causes the
voltage to change
from the inputs of the
diode to the output,
and we call that
the forward voltage.
So, like, as a
contrived example--
this is a little more involved--
if we were to always pull
one milliamp-- the way
that you look at these graphs
is, you have one milliamp.
You go to the vertical axis,
you find one milliamps,
you come across, you
come down, and that
will tell you, OK, my
forward voltage is 1.5 volts.
So if I have 5 volts and I
have a forward voltage of 1.5,
if I were to take a multimeter
and measure across the diode,
I would see 1.5, which
means on the other side,
I would get 4.85 volts.
And the rest is lost as heat.
So with our knowledge
of resistors and diodes,
let's look at this circuit.
So I have 3.3 volts
in a resistor,
and my inputs on the left.
If I give 3.3 volts on both
of the inputs on the left,
the diodes will block it because
the voltages are the same.
So all my energy is going
to come from the top
and is going to
go to the output,
and I get 3.3 volts, right?
I'm putting that in the table.
We'll keep track of that.
All right, so now, I'm going
to make the bottom diode--
the input is going
to be at 0 volts.
What happens here is the
top one gets blocked.
The bottom one
will conduct across
and will develop
a forward voltage.
So my output now is going
to have the forward voltage,
so I'm going to put
that in the table.
The reverse, the
same thing happens,
and then if I put all to 0,
the same thing happens again.
So I don't write code, but
if I were to write code
and my forward voltage was
0.15 volts, I could say,
if any voltage is above 2.7
volts, let's make this a high,
and if it's below 1 volt,
let's make this a low.
So I'm going to convert this
table into the highs and lows
and what do I get?
I get an AND.
This is the world's
cheapest AND gate
and this is why we
use it all the time.
So this is a three-input
AND gate right here.
We actually, in this
particular case,
you'll see an
underscore L, And this
means that the signal
is normally high,
and then when we do exciting
stuff to it, it goes low.
And this is called active
low, hence the underscore L.
And we actually
mix these together.
So here, we have an open
drain active low signal,
so we put ODL on it.
OK, back to our MOSFET.
Body diodes.
It's an accidental result of
the way that we make MOSFETs.
Basically, it's there.
I won't go into the details.
It's a terrible diode.
Here, it says, if
you apply 3 amps,
you'll get a
forward voltage drop
of 2.5 volts, which is awful.
So we don't really use them
as diodes, but we do cheat.
This is an extremely
common configuration
and we use the body
diode to make this work.
So suppose-- OK, let
me take a step back.
This is an n-channel
MOSFET because the arrow's
pointing towards the gate.
This tells us where
the source is,
so now, we know where
all our good stuff
is, drain, source, gate.
OK, inputs on the left,
outputs on the right.
Suppose I put 1.8 volts here.
I have a gate-to-source
voltage of 0
because I have 1.8
volts at the gate.
My resistance here
is extremely high.
We have yet another voltage
divider and most of the energy
is going to go to the
output, and because my output
is 3.3 volts, I have
3.3 volts on the output.
If I put 0 here on the input,
my transistor will turn on.
My resistance is very low,
I have the voltage divider
in the opposite direction,
so I get 0 on the output.
OK, really, what we have
here is a level shifter.
My signal's at ground,
the output's at ground.
If I give 1.8 volts, I
have 3.3 on the output.
We use this kind of level
shifting all the time.
Now, this is actually
a kind of cool circuit
because you can flip the
input and the outputs.
So if I do 3.3 volts here,
it gets blocked by the diode.
Ha, ha, I knew the
diode was useful.
OK, so then we get the
output at 1.8 volts.
So we level shifted
the other way.
If I do 0 volts here, things
get a little complicated.
The body diode
will first turn on
because it has 1.8 volts on the
one side and 0 on the output,
right?
We developed a
forward voltage here.
That means that our
gate-to-source voltage
will be 1.8 volts minus
the forward voltage, which
means that the transistor's
starting to turn on,
which means the resistance
of the transistor
is starting to decrease.
And now, we apply Ohm's law.
We know that the voltage is
equivalent to the current times
the resistance, so if
my resistance goes down,
my voltage goes down.
So now, instead of
forward voltage,
I have the voltage across that
resistor on the MOSFET, which
means that my gate-to-source
voltage is going up,
which means my
resistance is going down,
and this keeps going forever
until the transistor is fully
turned on, and then we
have 0 volts on the output.
Basically, we have
0 volts, and now, we
have a bi-directional
level shifter, right?
I can consider the A or
the B side the inputs,
and then the outputs
will be level shifted.
So hey, now, we can look at a
really complicated schematic
and see, oh, look, there's
a level shifter here,
there's a level shifter here,
there's a level shifter here.
And we can look even another
one and we see everything
that we've talked about.
We have a level shifter
here, we have an inverter
here, we have a low
pass filter here, we
have another inverter
here, have an AND gate
here, a level shift,
and an AND gate.
See, not so hard.
Now, you're going to
[INAUDIBLE] schematics.
Congratulations.
[MUSIC PLAYING]
