2. I am not a computer scientist
• I know far too much about how nuclear power
stations work
• I know far too much about how big the wires
should be that go to your shed
• I know just how much current it takes to kill
you (and where to apply it)
• I have ultimate knowledge of the three types
of magic smoke
3. Because I am an Electrical Engineer
Ask me about:
• Power generation
• Power distribution
• What the three types of magic smoke each smell
like
• How heavy lead is
• What happens when you put your scope probe
on a poorly-designed test pad
(preferably in the pub, I’m quite busy otherwise)
4. EE checklist
• Historical trend of
– Occasionally making something with wire or stuff
– Taking things to pieces and never putting them back
together again
– Taking things to pieces and putting them back
together again, but they don’t work right
– Creating electrical fires that are hard to extinguish
• Irrational enthusiasm
• Do it for long enough and eventually someone
will give you a qualification for it
5. But I can compute
• Commonality among engineering branches
• Engineers have to know about software
engineering anyway
• Logic universally applied
• Divide and conquer is king
• There’s some physics in there as well,
apparently
• Ok maybe mathematics too
6. How do I function at Pi Towers
• I did a RCA on that thing that was on fire and
threatening to bugger everything up
• Repeat last bullet point 2-3 times
• I like doing that sort of thing
• Also sometimes I do some testing of new
hardware
• And sometimes I write some hand-optimised
assembler
7. How do I function at Pi Towers
• I did a RCA on that thing that was on fire and
threatening to bugger everything up
• Repeat last bullet point 2-3 times
• I like doing that sort of thing
• Also sometimes I do some testing of new
hardware
• And sometimes I write some hand-optimised
assembler
8. Happiness is a warm GPU
• If I explained what this function did it would take more than 20 seconds
; void pwm_sdm_mod_ord1(int16_t *in, uint32_t *out, SDM_CONTEXT_T *ctx)
; VRF lock must be held on entry.
.function pwm_sdm_mod_ord1
stm r0-r15, (--sp)
ld error1_l, (ptr_ctx + ofs_z1l)
ld error2_l, (ptr_ctx + ofs_z1r)
ld nbits, (ptr_ctx + ofs_pwm_bits)
ld pwm_offset, (ptr_ctx + ofs_pwm_offset)
ld nsamples, (ptr_ctx + ofs_nsamples)
ld rng_phase, (ptr_ctx + ofs_rng_phase)
mov quant_mask, 0xFFFFFFFF
rsub out_shift, nbits, 31
add out_shift, 1
lsr quant_mask, quant_mask, nbits
not quant_mask, quant_mask
loop:
cmp nsamples, 0
beq out
cmp rng_phase, 16
blt skip_rng
mov rng_phase, 0
BUMP_RNG ptr_ctx, out_shift
skip_rng:
ldh sample_l, (ptr_in + 0)
ldh sample_r, (ptr_in + 2)
add dither_l, ptr_ctx, ofs_rng_shifted
add dither_l, 0
ld dither_l, (dither_l + rng_phase << 2)
add dither_r, ptr_ctx, ofs_rng_shifted
add dither_r, 4
ld dither_r, (dither_r + rng_phase << 2)
shl sample_l, 16
shl sample_r, 16
shl dither_l, 1
shl dither_r, 1
sub sample_l, pwm_offset
sub sample_r, pwm_offset
; sample += error1
adds sample_l, error1_l, sample_l
adds sample_r, error1_r, sample_r
mov error1_l, sample_l
mov error1_r, sample_r
; sample += dither
adds sample_l, dither_l, sample_l
adds sample_r, dither_r, sample_r
; Q(sample, nbits)
and sample_l, quant_mask, sample_l
and sample_r, quant_mask, sample_r
; error1 = output - input
subs error1_l, sample_l, error1_l
subs error1_r, sample_r, error1_r
; clamp to >0 - how to do this nicer and retain dual-issue?
abs sample_l, sample_l
abs sample_r, sample_r
lsr sample_l, sample_l, out_shift
lsr sample_r, sample_r, out_shift
st sample_l, (ptr_out + 0)
st sample_r, (ptr_out + 4)
add ptr_out, 8
add ptr_in, 4
add rng_phase, 2
sub nsamples, 1
b loop
out:
st error1_l, (ptr_ctx + ofs_z1l)
st error1_r, (ptr_ctx + ofs_z1r)
st rng_phase, (ptr_ctx + ofs_rng_phase)
ldm r0-r15, (sp++)
b lr
.endfn
9. Happiness is a warm GPU
• So let’s take 40 seconds
; void pwm_sdm_mod_ord1(int16_t *in, uint32_t *out, SDM_CONTEXT_T *ctx)
; VRF lock must be held on entry.
.function pwm_sdm_mod_ord1
stm r0-r15, (--sp)
ld error1_l, (ptr_ctx + ofs_z1l)
ld error2_l, (ptr_ctx + ofs_z1r)
ld nbits, (ptr_ctx + ofs_pwm_bits)
ld pwm_offset, (ptr_ctx + ofs_pwm_offset)
ld nsamples, (ptr_ctx + ofs_nsamples)
ld rng_phase, (ptr_ctx + ofs_rng_phase)
mov quant_mask, 0xFFFFFFFF
rsub out_shift, nbits, 31
add out_shift, 1
lsr quant_mask, quant_mask, nbits
not quant_mask, quant_mask
loop:
cmp nsamples, 0
beq out
cmp rng_phase, 16
blt skip_rng
mov rng_phase, 0
BUMP_RNG ptr_ctx, out_shift
skip_rng:
ldh sample_l, (ptr_in + 0)
ldh sample_r, (ptr_in + 2)
add dither_l, ptr_ctx, ofs_rng_shifted
add dither_l, 0
ld dither_l, (dither_l + rng_phase << 2)
add dither_r, ptr_ctx, ofs_rng_shifted
add dither_r, 4
ld dither_r, (dither_r + rng_phase << 2)
shl sample_l, 16
shl sample_r, 16
shl dither_l, 1
shl dither_r, 1
sub sample_l, pwm_offset
sub sample_r, pwm_offset
; sample += error1
adds sample_l, error1_l, sample_l
adds sample_r, error1_r, sample_r
mov error1_l, sample_l
mov error1_r, sample_r
; sample += dither
adds sample_l, dither_l, sample_l
adds sample_r, dither_r, sample_r
; Q(sample, nbits)
and sample_l, quant_mask, sample_l
and sample_r, quant_mask, sample_r
; error1 = output - input
subs error1_l, sample_l, error1_l
subs error1_r, sample_r, error1_r
; clamp to >0 - how to do this nicer and retain dual-issue?
abs sample_l, sample_l
abs sample_r, sample_r
lsr sample_l, sample_l, out_shift
lsr sample_r, sample_r, out_shift
st sample_l, (ptr_out + 0)
st sample_r, (ptr_out + 4)
add ptr_out, 8
add ptr_in, 4
add rng_phase, 2
sub nsamples, 1
b loop
out:
st error1_l, (ptr_ctx + ofs_z1l)
st error1_r, (ptr_ctx + ofs_z1r)
st rng_phase, (ptr_ctx + ofs_rng_phase)
ldm r0-r15, (sp++)
b lr
.endfn
11. Happiness is also fixing hardware bugs
• D3, R48, R47, C106
• Forms an asymmetric
timing circuit
• Works around a silly
interaction between
AP2553 and LAN9514
12. Happiness is also fixing hardware bugs
• Works around a
glitch that could
cause undefined
operation of USB
peripherals
• Sometimes you have
to trade elegance for
a functional hack
13. What else is on?
• I’m the one that has to write all the
documentation that gets us into space
• I go to the boring bits of Amsterdam and sit in
a room with ESA safety experts and discuss
minutiae
• At the end of it, we can go into space with the
help of some Russians and large amounts of
LOX
14. Who talked me into this anyway
• Rachel pokes me incessantly for electronics
advice
• I am genuinely interested in novel applications
of our little computer thingy that we make
and is popular
• Good ideas can come from surprising sources
15. Care and feeding of your EE
Useful:
• If you want to know if your idea is
possible/feasible/realisable
• If you want the gory details
• If you require cynicism in large doses
Not so useful:
• Painting anything (except walls in a uniform
colour)
16. How to Art
When you fuse
technology with the
arts, form has to
follow function.
17. How to Art
When you fuse
technology with the
arts, form has to
follow function.
18. If you build it, you will get buy-in
• You can attend only so many design review
meetings in good faith without either going
mad or having extra-curricular interests
• Follow the rules guidelines I just laid down,
and you will engage any engineer who has an
interest in the arts
• Sometimes we like to see the end result of
tinkering with a wild idea behind it
19. Get your ass to Mars
• If you know who that is and what film this is from
without Google’s help, you get a sweetie*
• *sweetie not included