Presentation is loading. Please wait.

Presentation is loading. Please wait.

Grading Lab reports: 10pts each. Demo required Homeworks: 3 points each (will be scaled by difficulty) Ratios –Lab: 25% –Homework 25% –Quizzes total 25%

Similar presentations


Presentation on theme: "Grading Lab reports: 10pts each. Demo required Homeworks: 3 points each (will be scaled by difficulty) Ratios –Lab: 25% –Homework 25% –Quizzes total 25%"— Presentation transcript:

1 Grading Lab reports: 10pts each. Demo required Homeworks: 3 points each (will be scaled by difficulty) Ratios –Lab: 25% –Homework 25% –Quizzes total 25% –Final 15% –Class Participation 10%

2 Today Grading Homework 1 and 2 Review Design Meeting (what’s next) 8051 I/O Ports Materials

3 Homework 1 Review Main Issues: –Interrupt configuration (EA, ET0, TR0) –Time delay in doing setpoint comparison –Use of registers for static storage –Saving state in ISR –Critical Sections, do we have them? –My version –C-compiler: Semi-static local variables Lab Issues –Simulation v. HW –Incrementalism v. Big Bang

4 Compact ISR for PWM CSEG AT000Bh LJMPISR0 … ISR0:PUSHACC() PUSH PSW() INC CNT(2) MOV A, CNT(2) ADD A,THI(2) MOV P1.1,C(2) POPPSW() POPACC() RETI(1)

5 Homework 2 Review 1ms + 1Mcycles = 1/32 +.001 sec ~ 32ms Let R = 10K, so C =.032/10K = 3.2uF + - 8051 RST 10K 3.2u

6 Design Meeting Conclusions (Frequency Range, MIPS utilization) What’s next? Debug User interface (text for now) –Command mode, play mode Tone generation algorithms/techniques –Single timer Song Parameters/Representation

7 A Bi-direction Port? Write Reg Read Reg Pin bus

8 What’s Inside the Buffer? IhIh IlIl Write Reg This device always “drives” either high or low. Will overpower an input signal, or get hot trying Never High Impedence ‘Z’ Note: this one inverts the signal, but its just an example…

9 I/O Ports Write Reg Read Reg Pin bus Dir Ctl Output driver can be disconnected from the pin so that input buffer can sense only the input signal This kind of bi-directional port requires a direction control register (SFR) for each bit of output (like StrongArm…

10 The 8051 (always has to be different) Eliminate the need for configuration bits by making outputs that can only drive strongly low (sink). There are three kinds of pins on the 8051 (of course) No pull up Weak pull up Weak pull up with momentary strong pullup To use a input pin, set output value to 1 (weak or no pullup). External signals just have to overpower the weak pull up (low resistance to ground). As output, will go from 0 to 1 slowly unless you add an external pullup Data sheet doesn’t spec the resistance of the pull up, but it specs the Amount of current that will result in a given voltage at the pin. For Example, in Ports 1,2,3 Ioh = -25uA at.75Vcc.

11 Application: Wired NOR 8051 Communication bus: Each processor tries to send data, but detects collision. If collision, then stop transmitting Collisions are safe because nobody drives high. The one who writes the zero first gets the bus! Q1) How can a processor detect a collision?

12 Summary Port 0: –used as address bus for external address/data bus. Uses active pullup in this mode. Fast –Can use as GPIO. Must use external pullup. Pullup size is power/speed tradeoff, up to 3.2mA Port 1 and 3: –GPIO only. External pullups are optional. Power/speed tradeoff, up to 1.6mA. Port 2: –Also used for external address bus. Has active and passive internal pullups. External pullups are optional in GPIO mode, up to 1.6mA.

13 Example Problem P1 Open = 0 Closed = 1 R 1) As big as possible! According to Data sheet: Processor reads a zero if Vpin <.2Vcc -.3 = 0.7V I low (port 1) is.45Vp at 50uA. So what is max R? (.45/50e-6) = 9Kohms So the switch resistor better be smaller than 9Kohms. 4.7K is a good choice. 2.7 is okay but higher power! Vp

14 Careful w/ Coils (motors, etc) Current limiter R = 50Ohms Coil (L) MOSFET Switch 8051 Steady state on current: Vcc/R Vds ~ 0 (Rds ~ 4mOhm) But, when we try to turn off the Mosfet quickly, what happens? Rds goes up quickly, but Ids drops slowly) If Rds becomes 1K, then Vds becomes 100V And instantaneous power becomes 10W I =0.1A Vds


Download ppt "Grading Lab reports: 10pts each. Demo required Homeworks: 3 points each (will be scaled by difficulty) Ratios –Lab: 25% –Homework 25% –Quizzes total 25%"

Similar presentations


Ads by Google