M. Horowitz E40M Lecture 13

Similar documents
Lecture 12. Building an LED Display

E40M. Binary Numbers, Codes. M. Horowitz, J. Plummer, R. Howe 1

E40M Useless Box, Boolean Logic. M. Horowitz, J. Plummer, R. Howe 1

E40M Useless Box, Boolean Logic. M. Horowitz, J. Plummer, R. Howe 1

E40M. Solving Circuits using Nodal Analysis and EveryCircuit TM. M. Horowitz, J. Plummer, R. Howe 1

E40M. An Introduction to Making: What is EE?

How Do We Figure Out the Voltages and Currents?

E40M. Solving Circuits using Nodal Analysis, Part II and EveryCircuit TM. M. Horowitz, J. Plummer, R. Howe 1

EE 330 Laboratory 3 Layout, DRC, and LVS Fall 2015

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Building Memory

E40M. MOS Transistors, CMOS Logic Circuits, and Cheap, Powerful Computers. M. Horowitz, J. Plummer, R. Howe 1

E40M LEDs, Time Multiplexing. M. Horowitz, J. Plummer, R. Howe 1

Topic Notes: Building Memory

E40M LEDs, Time Multiplexing. M. Horowitz, J. Plummer, R. Howe 1

EE 330 Laboratory 3 Layout, DRC, and LVS

Digital Systems Design with PLDs and FPGAs Kuruvilla Varghese Department of Electronic Systems Engineering Indian Institute of Science Bangalore

Module 3B: Arduino as Power Supply

Welcome to Lab! You do not need to keep the same partner from last lab. We will come around checking your prelabs after we introduce the lab

1/Build a Mintronics: MintDuino

cs281: Introduction to Computer Systems Lab03 K-Map Simplification for an LED-based Circuit Decimal Input LED Result LED3 LED2 LED1 LED3 LED2 1, 2

CSMIO IP. Differential outputs Addition. copyright 2012 CS-Lab s.c.

Arduino 05: Digital I/O. Jeffrey A. Meunier University of Connecticut

ENGR 40M Project 4b: Displaying ECG waveforms. Lab is due Monday June 4, 11:59pm

COMP combinational logic 1 Jan. 18, 2016

Physics 120/220 Lab Equipment, Hints & Tips

ENGR 40M Project 3c: Coding the raindrop pattern

Discharge by touching: BNC coax shield, outlet metal cover plate, wire connected to GND

Illuminating the Big Picture

Note. The above image and many others are courtesy of - this is a wonderful resource for designing circuits.

Halloween Pumpkinusing. Wednesday, October 17, 12

Coding Workshop. Learning to Program with an Arduino. Lecture Notes. Programming Introduction Values Assignment Arithmetic.

Instructions for designing the HelloWorld circuit board using Autodesk Eagle 8.6.0

12v Power Controller Project Board

Thursday, September 15, electronic components

Department of Computer Science. Software Usage Guide. CSC132 Programming Principles 2. By Andreas Grondoudis

Welcome to Lab! Feel free to get started until we start talking! The lab document is located on the course website:

Embedded Systems and Software

Lecture 4a. CMOS Fabrication, Layout and Simulation. R. Saleh Dept. of ECE University of British Columbia

Lab 2.2 Ohm s Law and Introduction to Arduinos

3. The circuit is composed of 1 set of Relay circuit.

Introduction to PSpice

Robotics and Electronics Unit 5

E85: Digital Design and Computer Engineering Lab 1: Electrical Characteristics of Logic Gates

Lecture 11: MOS Memory

What s a Tri-state Buffer?

EK307 Lab: Microcontrollers

EECS 140 Laboratory Exercise 4 3-to-11 Counter Implementation

7 8 9 C. PRELAB REQUIREMENTS You must adhere to the Lab Rules and Policies document for every lab.

Silicon Steroids for the Stamp Help Your Projects Heft Big Loads Using Switching Transistors

Step 1: Downloading the source files

PARTS LIST 1 x PC Board 36 x 5mm Red LED 36 x 12mm LED Standoff 36 x NPN Transistor 36 x 10kΩ Resistor OTHER PARTS YOU MAY NEED

Additional Slides for Lecture 17. EE 271 Lecture 17

Programming Principles 1 (CSC131) & 2 (CSC132) Software usage guide

Connecting LEDs to the ADB I/O

How to approach a computational problem

(Refer Slide Time 6:48)

Building your own special-purpose embedded system gadget.

Chapter 19. Floppy Disk Controller Discussion. Floppy Disk Controller 127

Introduction to CMOS VLSI Design (E158) Lecture 7: Synthesis and Floorplanning

Digital Circuits. Page 1 of 5. I. Before coming to lab. II. Learning Objectives. III. Materials

Outline for Today. Lab Equipment & Procedures. Teaching Assistants. Announcements

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet.

Boot Camp. Dave Eckhardt Bruce Maggs

Keypad Interfacing. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

AUDIO AMPLIFIER PROJECT

ENGR 40M Project 3c: Switch debouncing

Learning the Binary System

Using PSpice to Simulate Transmission Lines K. A. Connor Summer 2000 Fields and Waves I

Mark Schutzer December 9, 2007 (updated fix for older rev B and C ProCabs)

TMC3in1 Torch & Motion Controller 3in1. Vol. 04: FAQ and Troubleshooting Guide

University of Florida EEL 3701 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering Revision 0 12-Jun-16

UNIVERSITY OF CALIFORNIA College of Engineering Department of Electrical Engineering and Computer Sciences Lab #2: Layout and Simulation

Physics E-1bxl and PS3 Lab 4: Neuron Model 2016

COS 116 The Computational Universe Laboratory 7: Digital Logic I

UART Thou Mad? An Introduction to the UART Hardware Interface. Mickey Shkatov. Toby Kohlenberg

If I wanted to connect an LED and little light bulb and have them switch on and off with one switch, my schematic would look like the one below.

Lecture 14: Prototyping and Schematics

EE 330 Spring 2018 Laboratory 2: Basic Boolean Circuits

Parallel I/O and Keyboard Scanning

Select the technology library: NCSU_TechLib_ami06, then press OK.

Digital Systems Design with PLDs and FPGAs Kuruvilla Varghese Department of Electronic Systems Engineering Indian Institute of Science Bangalore

EECS 140 Laboratory Exercise 5 Prime Number Recognition

Reliable programming

DIY Kit 113. DUAL STEPPER MOTOR CONTROLLER

9.2 Types of Errors in Hypothesis testing

FPGA Programming Technology

Lab. Course Goals. Topics. What is VLSI design? What is an integrated circuit? VLSI Design Cycle. VLSI Design Automation

Designing Information Devices and Systems II Spring 2018 J. Roychowdhury and M. Maharbiz Discussion 1A

Grelllbbb s ESP Flashamater Adaptimizer Assembly & User Guide

EQ-ROBO Programming : Ladybird Robot

Educational Smart Breadboard

2015 edition FT TYPE: Utility madbeanpedals. Previous version of the Road Rage:

Physics 364, Fall 2012, Lab #9 (Introduction to microprocessor programming with the Arduino) Lab for Monday, November 5

ECE/CS Computer Design Lab

Administrivia. Next Monday is Thanksgiving holiday. Tuesday and Wednesday the lab will be open for make-up labs. Lecture as usual on Thursday.

Fire TV Quick Start BJM **DISCLAIMER**

How to Become an IoT Developer (and Have Fun!) Justin Mclean Class Software.

7.6 DI Technical Data. 140 DI135 Chapter 3. General Information

Luxman DML replacement manual by PE1MMK (construction)

Lecture 8: Synthesis, Implementation Constraints and High-Level Planning

Transcription:

http://applecorp.avature.net/ursite? projectid=7260&source=ur+site+ Portal&tags=stanford%7Cfall_2017 %7Cstanford_university_fall_2017_ careers_in_hardware_and_silicon_ panel%7crsvp 1

Lecture 13 Driving the LED Cube Good Design Procedure Copyright 2016 by Mark Horowitz 2

You Have A Cube, Now What? M. Horowitz E40M Lecture 12 3

By the End of Lecture, You Should Be Able To: Create the circuit to drive your LED cube from your Arduino Map the x, y coordinate of the folder LED array to Its x, y, z position in the cube Create a set of clean interfaces to test your design To separate the hardware test from the software test Work to fail fast in your projects Do risky stuff first, not last, to minimize cost of failure Faster learning cycles 4

LED CUBE DRIVER 5

So We Soldered Our Cube We have an 8 x 8 array Logically looks like: Physically it is different Need to drive it To light up the lights For independent light control Either only one + wire high Or only one - wire low Max of 8 LEDs on at once 6

The LED Driver Current Requirements Look at current requirements - wires connect 8 LEDs; + wires connect 8 LEDs But we decided to drive only one + wire high at a time So each - wire can drive only one LED on at any time But each + wire can drive 8 LEDs that are on at on time How much current will each LED take? Series resistance is about 100 total 82 from explicit resistor, 20-30 from pin Voltage drop across this resistance is 2-3V Current is approximately 20-30mA (for green/blue or red) 7

Arduino Current Limitations If you read Arduino specs Each pin can drive 40mA Whole chip should drive less than 200mA Pin current is limited by MOS devices on the chip Have measured 20 ohm If you measure the current it is less ~60mA This makes sense. If the spec is 40mA That is the guaranteed value. Nominally it will be higher 8

Max Chip Current https://www.flickr.com/photos/john_gammell/4562350638/ Why is there a max total chip current? When current flows out of pin It must flow in from somewhere i = 0 Somewhere is the Gnd pin Or Vdd The current must flow through some small wires Called bonding wires, which connect chip to package Too much current and these wires become fuses Poof, and it is gone Very conservatively spec d. Probably 400mA is ok But remember Poof is possible and permanent 9

How to Drive Your LEDs Arduino can drive the - wires directly Use 82 series resistor to limit current Current will be 20mA for blue/green LEDs, 30mA for red Total Arduino current will be around 240mA max Above spec, but will be ok + wire driver will need to supply 160-240mA Arduino can t drive that current Will need an external driver for that What type or driver do we need? 10

Driving the + Wires of the Cube Want to build as little as possible Need to build 8 of them What do we need? Need to connect to Vdd Need to disconnect from Vdd Don t need to drive it to Gnd 11

Where To Put The Resistor and Transistor? 12

Putting It All Together 13

One More Thing to Remember The Arduino will drive the gates of the pmos drivers The pmos transistors turn on when the gate is low Thus the Arduino should drive 7 outputs HIGH And drive only one output LOW at a time And the negative side of the LEDs (with a series resistor) To turn the LED on The Arduino output should be LOW 14

BREAKING BREAK 15

Take Apart a Keyboard 16

LED CUBE MAPPING 17

Mapping a Plane to a Cube 18

What The Wires Look Like 19

Your Mapping Function The program that drives your display Will scan through the plus wires (A-H) Determine which LEDs are on for each row To determine which LEDs are on Need a function that takes a LED array coordinate D3 And map it to an x,y,z coordinate So you can see if that light is on: LED[x][y][z] 20

With A Little Wire Renumbering 21

GOOD DESIGN PRACTICES 22

Debugging Debugging complex systems is very hard It is too hard to figure out what should be happening This is why we try to create clean software interfaces Debugging hardware has similar issues Want to check well defined interfaces First check your tools/inputs Measure inputs (including Vdd) And check that the scope/meter are working Then check the smallest subcircuit you can Unfortunately hardware can break Could work yesterday and not work today Good to record what a working solutions looks like Check these voltages when it stops working 23

Debugging Hardware / Software Systems Often project has hardware and software What happens when this system breaks? Again isolation is the key In addition to having the main software Always have test software This should just double check that the hardware is working E.g. checking that all the LEDs light in the right order Test jigs are great Either software only (output on a screen/ computer) Or other hardware/software that is known to work Can test/debug your software/hardware 24

Debugging the Smart Useless Box Isolation is key: In prelab Tested power inverters in simulation Wrote test programs to read switches and drive the motor In lab Measure the output of the Arduino directly Test power inverters directly Use test programs to debug your wiring Use std simple debugging Use Serial.println(keyVariable) To help figure out where the code is going wrong Check for the std stupid C errors Like using = in an if statement 25

Archive Your Test Programs Remember that hardware sometimes stops working Either because you hit a bug you missed before Or a component that used to work isn t anymore Need to figure out which is which Having code that can measure/test hardware is crucial Then when system stops working can check hardware is ok Or narrow down to which component is no longer working 26

Minimizing Work Required When you start a project you have a choice What will you design What will you borrow from others Design only the critical stuff you need Borrow the rest from others Don t invent stuff you don t need Good enough is really good enough Think about the minimal system that is ok Think also about the things you might like to add later But build this minimal system first When it works, you can then start adding stuff 27

Hacking is Rarely the Best Approach If you are going to do this only once And will never use it again You can hack your way through it, just to get it done If you are going to do this more than once Creating an efficient method will save you time in the end Building jigs is often a time saver And you rarely do things only once Because you make mistakes Or performance / aesthetics of unit is important Remember if you are doing something for the 2 nd time There will probably be a 3 rd, so think about your methodology 28

Failing Fast People don t like to fail So they tend to avoid areas that they are worried about This is exactly backward to being successful You actually want to fail as fast as you can If something is not going to work Why waste time working on the other stuff? Don t you want to know ASAP so you can t stop working on it? Should always work on the most risky part of the project first Mantra in entrepreneurship Often knowing what the customer wants is the hardest point So try many products/variations until you find one that wins 29

Failing Fast It is easier to modify designs early in the process If something is not going to work Find out early when you can change other components/project Have less sunk investment to lose Failing is learning You fail because of an conceptual error The world is different than what you thought Learning the way the world really is, is important Debugging is easier in smaller chunks Want to test the smallest chunk possible If something is risky, would like to isolate it to debug it 30

31

By the End of Lecture, You Should Be Able To: Create the circuit to drive your LED cube from your Arduino Map the x, y coordinate of the folder LED array to Its x, y, z position in the cube Create a set of clean interfaces to test your design To separate the hardware test from the software test Work to fail fast in your projects Do risky stuff first, not last, to minimize cost of failure Faster learning cycles 32