Tom's Physics 123 Page


May 13, 2008

hand-written review notes for P123, May 13, '08
miscellaneous old review notes for P123
correction to HWD3 solution: add flops for do-it-once behavior

May 5, 2008

MTK: an alternate loader program, from Dallas Interface is not as good as that of Loader420, but includes some extra features, including ability to slow the write cycle on download.

Lab 22 Program Sources

Here are some programs that one might want to run on the micro in standalone mode. Two--digipot and servo--call for input from keypad at external port 0. When you run these stand-alone, you will need to provide this byte of input in another way: you can connect the keypad to a free port (such as port 1); even easier, connect a pair of DIP switches to ground/float each of those 8 inputs.
The two pulse-measuring programs are written without reference to an external bus, so no rewriting is required (beyond swapping between two versions of a few lines of SHOWCAP code, in the second of these programs, the one that uses a timer).
SPI digital potentiometer program (SPI_digipot_int_504.a51)
First timer program: TMR800.A51
Servo motor control program (servopulse_1204.a51).
Pulse-measuring program (decimal output) (pulse_measure_decimal_standalone_505.a51).
Pulse-measuring program (hex/binary output) (pulse_measure_capture_standalone_505.a51).
LCD display code (8-bit interface) .
LCD display hardware (8-bit interface) .
Keypad encoder program (4X4 keypad) .
keypad hardware .

C files to try

These are very simple C programs, equivalent to some of the labs' assembly-language programs. They may help to introduce you to some of the 8051 extensions to the language; there's nothing clever, here.
delay_bitflip_408.c Flips bit P1.0 at about 2 Hz. Useful to reassure yourself that a download to Flash ROM has worked.
keypad_to_disp_408.c Exact equivalent to an early Lab 19 program.
keysum.c Another lab 19 program: adds keypad value to running sum.
int_separate_intsetup.c Increments display on each INT0* interrupt (a lab 20 program equivalent).
adc_dac_int_408.c Reads sample from ADC to DAC on each interrupt (a lab 21 program equivalent).
bit_test_c_dec07.c A simple bit-test loop, equivalent to a lab 20 program.
tblcopy_804.c Copies a small table.
tblcopy_reverse_406.c Copies a small table, in reverse order (this is hard work in assembly, and dead easy in C!)

May 1, 2008

Classnotes: lab 22b, micro peripherals (Wed. April 30)

April 21, 2008 8051 Materials

Classnotes: lab 22, micro 5 (Fri., April 25)
Classnotes: lab 21, micro 4 (Wed., April 23)

April 25, 2008

hw D4 (due FRIDAY, May 2)
sequence_detect_MT.v Verilog source file for you to complete
sequence_detect_tb.v Verilog testbench for sequence detector.
sequence_detect_MT.a51 start of RIDE assembly-language sequence detector.
bit_test_804.c Scraps of a C file to show some details of bit operations.

Some programs you might try, once your have Loader working (these are source files; you'll need to assemble or compile and link, using RIDE, in order to produce the .HEX file you'll ship to the micro):
storage scope program, to download to micro: tableint_Rn_408.a51
bit flip program, to download to micro: portpin_408.a51
C language version of bit flip program, to download to micro: flip_bit_408.c .
C language version of keysum program of Lab 19, to download to micro: keysum.c

April 21, 2008 8051 Materials

Lab 21: ADC, DAC


8051 References

8051Instruction Set Reference (Phillips) (this is xeroxed "Reference B")
8051 tutorial,from Web (this is xeroxed "Reference A")

Dallas data sheet for DS89C420/430 processor
Dallas high speed microcontroller User's Guide
Index to selected topics in Dallas User's guide

Raison 8051 assembler and simulator

Here is the excellent free program (free for code size under4K) that I use to assemble and simulate code. It's a zipped file (about 37M),and includes instructions.
When we ask you to do some coding, Ride will help a lot, though it is notessential (you can use the programmer's reference, in the posted set ofsources, to see the instruction set. You may not need even that: some preferjust steal code from the lab programs!). The file: ShortNote on how to use the RIDE Assembler & Simulator
Sampleprograms (some of those used in the micro labs)
kit51_747_.exe: zipped Raisonance assembler, compiler & simulator. (37 Meg, zipped)
And here--long before you'll need it--is a file of vector names--an".INC" file that zealots will want to include in the INC directory oftheir Raisonance/Ride installation! (I realize I may be speaking to no one atall.) Here it is: a table of symbolic names for the80C320's vector addresses (for use with a program that relies oninterrupts). These vector addresses are the same for the DS89C420 and DS89C430, incidentally.

Link to RIDE documentation: detailed user's guide


I expect this is much more than you want; but here it is, anyway, for thezealot who wants the full story about the Raisonance assembler, compiler &simulator.
Part I
Part II


April 19, 2008

Classnotes: lab 20, micro 3 (Fri., April 18)
Classnotes: lab 19, micro 2 (Wed., April 16)
Lab 20: bit operations; interrupts

April 16, 2008

hw D3 (due Wed., April 23)
bus_arbiter.v Verilog source file for you to modify
bus_arbiter_tb.v Verilog testbench for existing file and for your modified file.

April 13, 2008

Classnotes: lab 18, micro I (Fri., April 11)
Classnotes: lab 17 afterthought re PLL (Wed., April 9)
Lab 19: I/O
Lab 18: micro enters
Note on address decoding

April 10, 2008

hw D2 (due Wed., April 16)
zipped project: two_bit_simplest_ctr.zip CORRECTED (4/16) Verilog project file. You can use this full collection of project files (probably the easier course), or you can start a new project of your own, taking in the two files just below--the source file and the testbench.
two_bit_simplest_ctr.v CORRECTED (4/16/08) Verilog source file for you to modify
two_bit_simplest_ctr_tb.v Verilog testbench for existing file
two_bit_up_dn_ctr_tb.v Verilog testbench for your modified (up/dn) file

Xilinx application notes
The most relevant is XAPP143: Using Verilog to Create CPLD Designs Aplication Note v1.0 ..., showing examples of small Verilog files (40 pages)
Note on sampling

April 5, 2008

hw D1 (due Wed., April 9)
step_glue_mt.abl Incomplete ABEL file--we've done the dull parts, leaving the equations to you. We have corrected this template file (4/808), removing ".abl" from the module name. We suggest, also, that you should keep the filename short--under 9 characters.
Classnotes 17, analog-digital (Fri., Apr. 4)
Classnotes 16, memory & state machines (Wed., Apr. 2)

April 1, 2008

Note on PLD's and logic compilers (Verilog)
Lab 16: memory

Verilog download
Verilog download, free from a PLD manufacturer, Xilinx. The download is very large (probably you'll need > 100Megs--and the largest version offered is 1.7Gig!). You'll find the program here: Xilinx Verilog/ABEL download (restricted to Xilinx parts); Click on ISE WebPACK, register, and download. (You do not need the ModelSim simulator.)
Here's a pretty good introductory tutorial on Verilog
Enormous Verilog (and VHDL) reference, from Xilinx (.PDF) You won't want to print this, at almost 700 pages, but may want to consult it. Includes a great many sample files.
xilinx abel note

March 22, 2008

a solution to midterm (this is to aid in the search for any additional points that we owe you.)
analog score totals, and letter-grade estimates
list linking mdtm % to pts, to help you figure out which 'dot' on chart is yours
Classnotes 15, digital 3 (big file, pretty colors) (Fri., Mar. 21)
Classnotes 15, digital 3 (8X smaller, lacks pretty colors) (Fri., Mar. 21

March 20, 2008

Classnotes digital 2 (big file, pretty colors) (Wed., Mar. 19)
Classnotes digital 2 (8X smaller, lacks pretty colors) (Wed., Mar. 19)

March 17, 2008

notes (Tom's) from review session (Sun., Mar. 16)
some old midterm review notes (Includes rough solution to analog music project.)
midterm test, Fall 07 (wi solu)

March 15, 2008

Classnotes digital 1: gates (Fri., Mar. 14)
Lab 14: flip-flops

March 7, 2008

Classnotes 11b: MOSFET's (Fri., Mar. 7)
Classnotes: 11a: voltage regulators (Wed., Mar. 5)
PID notes

Mar. 3, 2008

HW 5, review, regulators (due Mon. Mar. 10, 2008)
Classnotes 10c: PID loop (2/29/08)
Quiz nasty oscillator solution (2/29/08)

belated solution to comparator quiz
Quiz comparator solution: simpler question (2/27/08)
Quiz comparator solution: nastier question (2/27/08) This is the one iven in class--which includes heavy loading by the heater switch. That complicates the comparator calculations, so I prefer the simpler version, just above.

Feb 29, 2008

Classnotes 10b: nasty positive feedback: parastic oscillators (2/27/08)

Feb 25, 2008

HW 4, op amps II (due Mon. Mar. 3, 2008)

Feb 22, 2008

Classnotes 10a: nice positive feedback: oscillators (2/22/08)
Classnotes 9: op amps II: imperfections (2/20/08)

Feb 18, 2008

HW 3, op amps I (due Mon. Feb. 25, 2008)
Classnotes 8: op amps I (2/15/08) (This is the 6th class, but I'm following the lab numbering.)

Feb 14, 2008

Classnotes 5: transistors II (2/13/08)
Classnotes 4: transistors I (2/8/08)

Feb 11, 2008

HW 2, transistors (due TUES Feb. 19,2008)
Lab 8: op amps I (This lab follows Lab 5; we cut out Labs 6 and 7.)
Lab 9: op amps II
c Classnotes 3: diodes (2/6/08)
Classnotes 2: capacitors (2/1/08)
Quiz 2 (RC) solution (third class)
Quiz 1 solution (second class)
Lab 5: Transistors II
Lab 4: Transistors I
Lab 3: diode circuits

Feb 4, 2008

HW 1, passive devices (due Feb. 11,2008)
C_notes: trying for a simple, intuitive view of RC filters
Current versus Voltage

Jan. 31, 2008

Classnotes 1 (1/30/08)

Course Information
Course Schedule
1st-day Signup Form
Lab 1: DC Circuits
Lab 2: RC Circuits


Link to Text problem solutions, and old exams (some with solutions)


Click here to hop to old Finals, and Text-problem solutions


Files are in Acrobat (PDF) Format, Download Acrobat Reader

Most recent entries at top of page


Harvard Physics Department