Current Assignment
Well obviously this was the previous homework Tim!

But you should all be looking at clock.s43 below. I'll post clock2.s43 when I get it working myself (I just did but I want to clean it up).

Code

mult8x8.s43 - 8 by 8 byte to 16 bit multiply routine

SquareRoot16.s43 - The algorithm from class

clock.s43 - The code I was demonstrating in class (unsuccessfully)

bin2dec.s43 - Binary to ASCII

clock2.s43 - Try this using the FET debugger (except you Bryan and Andrew). Set a breakpoint on the xor instruction and see if while watching memory you notice 0x0201 increments as you repeatedly press GO.

Button2.s43 - With interrupts!

PowerPoint Presentations

Class 1  Class1.ppt

Class 2  Class2.ppt

Class 3 Class3.ppt

Class 4 Class4.ppt (anyone need a hint on the homework?)

Class 9/10 Class9.ppt (contains a homework programming problem due 2/26/2009.

MSP430 Firmware Examples for the eZ430 and the class development board

Add_16 Just extract and open with IAR Embedded Workbench to play with a simple 16 bit adder. You can use this as a starter project for bin2dec (Binary to Decimal).

Simple Decrement Loop

Links to files we'll be using:

Data Sheet 20x1, 20x2, 20x3

The 2xx Family Manual

HAVING TROUBLE WITH UNSIGNED COMPARISON AND JUMPS?

An unsigned compare only uses the CARRY flag. So for this example, think about nibbles and imagine we are comparing when 12 is below 8 (imagine they are in NIBBLE registers R5 and R6 respectively. A CMP R6, R5 would perform R5-R6 and set the flags. To do this it does a NIBBLE ADD of the two's compliment of 8 which is 8 (~1000 -> 0111, 0111 + 1 == 1000).< xml="true" ns="urn:schemas-microsoft-com:office:office" prefix="o" namespace="">

 

12 + 8 = 4 (1100 + 1000 = 0100) but there is a CARRY. The CARRY says that R5 (12) is still greater than or equal to R6 (8).

 

What about when R5 and R6 both equal 8? CMP R6, R5 yields:

 

8 + 8 = 0 (1000 + 1000 == 0000) and still, there's a CARRY.

 

But when R5 is less than R6 (say R5 == 7):

 

7 - 8 = -1 (0111 + 1000 == 1111) AND NO FREAKIN' CARRY!!

 

So now the machine can know when R5 < R6 (UNSIGNED!)...it's when the CMP instruction does not set the CARRY bit in the STATUS register!