Class 1

Class 1 Powerpoint is here.

The book for the class is on-line at http://www.parallax.com/Portals/0/Downloads/docs/prod/prop/WebPM-v1.01.pdf

 The software for the class is http://www.parallax.com/Portals/0/Downloads/sw/propeller/Setup-Propeller-Tool-v1.2.5.exe

The Parallax Serial Terminal is http://www.parallax.com/Portals/0/Downloads/sw/propeller/PST.exe.zip

Class 2

 Class 2 Powerpoint is here.

Class 3

 Class 3 was cancelled because of friggin' snow.

Class 4

Class 4 Powerpoint is here.

If you feel like playing with floating point conversions download this file (right-click on the word 'this' and save it somewhere) and rename the extension from .TXT to .EXE. Run it from the command line (Start->Run and type cmd).

 M:\Floating Point\fbits\Debug>fbits

Float: 1.1

fval = 1.100000

31 30    23 22                    0
v  v      v v                     v
+-+--------+-----------------------+
|0|01111111|00011001100110011001101|
+-+--------+-----------------------+

3F8CCCCD

M:\Floating Point\fbits\Debug>

 Class 5 (2/4/2009)

Blink_1.spin is here.

Class 5 Powerpoint are here and here.

 

 Class 6 (2/9/2009)

Serial.spin is here.

Class 6 Powerpoint slides are here.

 Class 7 (2/11/2009)

Timed.spin is here.

Class 7 Powerpoint is herehere.

Remember, besides Fibonacci, time the printing of "ABC" and "ABCDEF" and report to me the time for each as recorded using the diference in CNT before and after the call to SPORT.str. Does it make sense? Is the time to print "ABCDEF" longer than the time to print "ABC" by the amount of time to print 3 additional characters at 19200 bps (10 bits per character)?

Class 8 (2/18/2009) 

Example of func is here.

Class 8 Powerpoint is here.

REMEMBER!! Homework is:

1. Fibonacci again with a function called fib

2. Code the square root algorithm. Determine if the routine correctly round. If possible, figure out a fast methos of rounding. Time the code to see how fast it is. Add the speed to the comments you plan on adding to your code.

3. Have read chapter 3 up through Exercise 4 and be ready for a Test that will likely come on Monday. Remember, actually programming the exercise in Chapter 3 will greatly aid in your understanding and increase your chances of a good grade on the test Monday.

 Class 9 (2/23/2009) 

 Class 8 Powerpoint is here.

 Class 10 (2/25/2009) 

 Class 9 Powerpoint is here.

 Class 11 (3/4/2009) 

 Class 10 Powerpoint is here.

MyObj.spin is here.

TestObj is here.

Quiz4.spin is here.

Class 12 (3/9/2009) 

Class Powerpoint is here.

Floating point Spin example from class is here.

Class 13 (3/11/2009)  

Class Powerpoint was just this SPIN file testing this SPIN file.

 Class 14 (3/23/2009)  

Class Powerpoint is here.

 Class 15 (3/25/2009)  

Class Powerpoint is here.

Spin for Pointers

Point0_Sullivan.spin

Point1_Sullivan.spin

Point2_Sullivan.spin

Point3_Sullivan.spin

Point4_Sullivan.spin

Point5_Sullivan.spin

Point6_Sullivan.spin

Class 16 (3/30/2009)   

Class Powerpoint is here.

Spin for First Assembly program is here.

 The column of numbers to add for homework (print the results as 8 digits of hex) is:

DAT
myblock long  $01234567
        long  $89ABCDEF
        long  $AABBCCDD
        long  $00112233
        long  $44556677
        long  $8899AABB

It must be in DAT block (that's the whole point of the assignment).

 Class 17 (4/1/2009)  

 The homework is to add the same list of number, in a DAT block, that you did for the homework that was due today in assembly language. Here it is:

myblock long  $01234567
        long  $89ABCDEF
        long  $AABBCCDD
        long  $00112233
        long  $44556677
        long  $8899AABB

The code we started to modify in class is here.

Remember, you do not need to use a loop for this. You also need to add an extra variable called t2 and use it like t1 except that you will access COG Memory and not Main Memory. All of the details are not in this code. A lot will have to change. Have the SPIN code watch for a flag again and then print the results of the sum.

Email with any questions. I'll be in the office from 9AM-12PM on Friday 4/3/2009.

PLEASE NOTE: Main Memory addresses that need to load longs should be incremented by 4 while addresses in the COGs only have to be incremented by 1 to move to the next register (long). Also, I am having the same kind of fun that you guys are.

 Class 18 (4/6/2009)  

Class PowerPoint is here.

My Assembly Code:

HomeworkAssembly_Sullivan.spin

HomeworkAssembly4_Sullivan.spin

 Class 19 (4/8/2009)  

The homework is to write an assembly language program to multiply two 16  bit unsigned numbers and return a 32 bit product.

Here is some code to help get you started

By the way, test your code with $5555 times $AAAA

 Class 20 (4/13/2009)  

The program on Timer/Counter is here.

Try it...change the value we increment the timer by and see what happens. Maybe try another pin. Read the App Note too. You'll find it here.

Class 21(4/15/2009)  

VGA_512x384_Bresenham_Sullivan.spin is here.

Remember, you need this too: VGA_512x384_Bitmap.spin is here.

Class PowerPoint is here.

Homework:

 n1. Download VGA_512x384_Bresenham_Sullivan.spin

a. Remember VGA_512x384_Bitmap.spin too!
n2. Rename to VGA_512x384_Bresenham_YOURNAME.spin
n3. Add a new Private Function Plot2
¨PRI plot2(x,y,k)
nx is the x-coordinate
ny is the y-coordinate
nK is Set/Reset
¨K==0?
§Plot the pixel with the background color
¨K>0?
§Plot the pixel with the Foreground color
nYour code should:
¨Call Plot(10,10,1)
nShould plot a pixel
¨Delay 2 seconds
¨Call Plot(10,10,0)
nShould un-plot (clear) the pixel
n4. The question is how do you un-Plot a pixel?
¨If plotting it makes it a 1 then un-plotting must be making it a zero?
nNote: If you know your Boolean operation and SPIN operators, this homework should take 1 minute to write the new function and 2 minutes to write the portion of the code that tests it.
 
Class 22(4/21/2009) 
 
Homework: Download this and this and make them work. Any questions? Don't email me: wait until the next class and say you didn't understand the assignment. Sorry...sarcasm: it's all I got!
 
HINT: I got mine to run in 2 minutes. Serial_Data_Generator needs to have a Start method added kind-of like FullDuplexSerial has. It is THAT function that calls the function to run. Need another hint? Email me.
 
Any questions PLEASE email me!!!
 
Remember: Bring in your projects Monday. Also, you get to evaluate me Monday. Time to give it back to ME!
 
¨
Class 23(4/27/2009) 
 
Homework: Fix the previous assignment (4/21/2009) so it launches CORRECTLY in another cog. Then, add a function to parse a comma seperated string (being puked out of the cog's serial port). The function should be passed a POINTER to a complete line of comma seperated data and the required field of data to be returned. The function (Pluck) should return a pointer to a null terminated string with the data from the required field.
 
The function header/declaration should look (something) like this:
 
PUB Pluck(str,field)
 
If you had a string of data like this:
 
38,75,254<CR>
 
[where <CR> is a 13 (base 10) a.k.a. Carriage Return] and that string was in an array declared as:
 
 
byte lineoftext[128]
 
If you called the function like this:
 
Pluck(lineoftext,2)
 
it would return a pointer to a NULL terminated string containing "7", "5" and a "null" (an actual zero byte).
 
Class 25(4/29/2009) 
 
This is the updated Sensor SPIN file with the Pluck function we worked out in class.
 
Final Project Report Format
 
Here is a report that I wrote on one of my own objects. While your format will likely be in Portrait format it should look something like this (or better).
 
Class 26(5/4/2009) 
Here is the missing Serial Data Generator.
 
Please have a working version of the code in by Wednesday.
 
Remember, Test on Wednesday about this program. Last test, very painful. Understand Pluck and all its weirdness.
 
If you see Shaun tell him about the homework and the test.
 
I wonder if Amanda likes the larger font?
 
Class 27(5/6/2009) - Let the magic continue...
 
Dear Class,
 
Test 4 - The test will ask questions about this and this. Open them (both) up during the test using the Propeller tool or a text editor like Notepad. There will be 25 questions and I will allow about 15 seconds per question so it should go by fast. Be prepared.
 
Good Luck
Professor Bastard