Programming Examples

Home YModem VTD

 

The Following Information is Not In Any Particular Order

(and does not come with any guarantees!)

bullet

Valsalva Test Device (VTD)

bullet

3rd place winner in National uMedic contest

bullet

Vinculum II (VNC2) for adding USB to Propeller

bullet

Adafruit.com 16x32 RGB LED Matrix  Control big LED arrays with a Prop!

bullet

YModem:  Send files to your computer from the Prop over serial link

bullet

Chess:  Human Vs. Propeller

bullet

Show Windows Bitmaps on TV

bullet
Code and screenshots provided in this forum thread.
bullet

Video Player for TV

bullet
Plays custom format video files with sound from SD card onto TV
bullet
Code and description in this forum thread
bullet

Unipolar Stepper Motors

bullet
I used this code to test a unipolar stepper motor (I think I got the motor from Parallax).
bullet
Code provides full, half, or micro-stepping.
bullet
You need something like a ULN2803 darlington array to buffer and protect the Prop.
bullet
There a schematic of someone else's setup here.
bullet

Basic Wavetable MIDI Player

bullet

PropEKG

bullet

RTC (Real-Time Clock) Services

bullet
From DS1307:  The DS1307 is an I2C RTC.  This means you can connect it to the I2C bus on pins 28&29 easily.  It takes a 5V supply, but the I2C pins can directly connect to the I2C bus. 
bullet
Using just the Prop 
bullet

Dual ADC Object and Demo

bullet

DAC (digital-to-analog conversion)   --> WAV Music Player !!

bullet

I/O Expansion Using I2C Bus

bullet

2-Bit Bitmap App

bullet
Creates 4-color bitmaps for the Prop.  TV and VGA demo code also here.
bullet

6-Bit Bitmap App

bullet
Creates 64-color bitmaps for Prop for VGA display.
bullet

1-Bit Bitmap App

bullet

Creates 2-color bitmaps for Prop for VGA display.

bullet

Assembly Tutorial (by Forum username "deSilva")

bullet
This is nice since Parallax failed to provide very much in the way of instructions, other than examples.
bullet
It can be found in the Forum on this thread.
bullet
Or, download the local copy here.
bullet
There are also "Assembly Code Examples for the Beginner" in this forum thread.
bullet

SD Card Interfacing

bullet

Cameras

bullet

TV Colors

bullet
Info on colors generated by the NTSC/PAL TV driver.
bullet

VGA Colors Applet

bullet
Particularly useful for deciphering the 1024x768 VGA tile driver demo.
bullet
Decompose/Examine a Propeller hex palette value
bullet
Generate a hex palette value from RGB color picker
bullet

Interleaved Character Generating Windows App

bullet
Makes interleaved, 2-color characters just like what's in the Propeller's ROM

  bullet

4-Color Character Generating Applet

bullet
Generate custom 16x16, 4-color characters
bullet

Basic Window/Form System

bullet

Notes

bullet

Notes on "Graphics_Demo.spin"

bullet
Use "=>" for "greater than or equal to" test.  ">=" is an assignment operator in SPIN !!!!!!!!!!!!!!
bullet
All addresses are WORDs 
bullet

Sparkfun's Nokia LCD

bullet

MP3 (work in progress [May need to wait for Prop II])

bullet

Wireless (work in progress)

bullet

PrintScreen for VGA

bullet
This code turns the VGA screen into a 24-bit Windows Bitmap file on an SD card (assuming you have an SD card connected to the Propeller).
bullet
Sample: 
bullet

JuiceBox Display

bullet

Delay Generator Demo

bullet

Demonstrates control of two Delay Generator objects with XGA (VGA 1024x768) user interface.

bullet

Screenshots: 

bullet

Download here.

bullet

100 MHz clock

bullet
I believe it's possible to control timing at the clock level using 4 cogs (because instructions take 4 clocks each).  Cogs can be synced using the CNT.
bullet
But, 12.5-ns clock is rather inconvenient!  It would be nice to have even 10-ns increments in the timing.
bullet
I've done this by replacing the onboard 5 MHz crystal with a 6.25 MHz crystal.  Since the crystal simply plugs into both the proto and demo boards, this is very easy to do physically.
bullet
6.25 MHz is non-standard, but I did find some from alltronics.
bullet
I used the counter modulator to toggle PIN#7 at clock frequency and measured result with o'scope:
bullet
80-MHz clock:   
bullet
100-MHz clock:  
bullet

Video BlackJack Game

bullet
bullet
Download current version here.  Forum member "Clemens" has created a modified button bar.
bullet

Playing Card Game Framework for TV and XGA

bullet

bullet
This is a basic framework for playing card games. I've minimized the size of the resources, so there's plenty of room for code for the actual game.
This demo just displays random cards on TV.
A basic psuedo-random number generator is included. Also, the code for a variable # of deck shoe is there.
bullet

Download TV version here.

bullet

Download VGA 1024x768 (XGA) version here.

bullet

I really like the 1024x768 (XGA) tile driver (see 3rd Party or Forum Stuff).  But, wanted to be able to easily resize and move the graphics window around.  So, here are the modifications that do this:

bullet
CON
....
gxt=32 '# graphics tiles in x direction (was 16) 
gyt=4 '# graphics tiles in y direction (was 8)
w_x = 15'40 'left tile# of graphics window
w_y = 3'30 'top tile# of graphics windows
w_left = w_x * 16
w_right = w_left + gxt*16 '256
w_top = (48 - w_y) * 16
w_bottom = w_top - gyt*16'128
PUB start | i, j, k 
...
'start and setup graphics
gr.start
gr.setup(gxt, gyt, gxt*8, gyt*8, bitmap_base)'(16, 8, 16*8, 8*8, bitmap_base)
...
'make some graphics tiles on the screen
repeat i from 0 to (gyt-1) '7
repeat j from 0 to (gxt-1) '15
array.word[cols * (w_y + i) + j + w_x] := display_base + i*64 + j*gyt*64 + 21 'RJA
bullet

PropMonitor (debugging tool)

bullet

Visual Spin