BookRags.com Literature Guides Literature
Guides
Criticism & Essays Criticism &
Essays
Questions & Answers Questions &
Answers
Lesson Plans Lesson
Plans
My Bibliography Periodic Table U.S. Presidents Shakespeare Sonnet Shake-Up
Research Anything:        
History | Encyclopedias | Films | News | Create a Bibliography | More... Login | Register | Help
Not What You Meant?  There are 34 definitions for Spin.

Spin (programming language)

Print-Friendly
About 1 pages (340 words)

Bookmark and Share Know this topic well? Help others and get FREE products!

Spin is a multitasking object oriented high level programming language created by Parallax's Chip Gracey, (Who also designed the Propeller microcontroller it runs on) for their line of Propeller microcontrollers. Spin code is written on "the propeller tool". A GUI oriented software development platform which is written for Windows XP. This compiler converts the Spin code into bytecodes that can be loaded, (with the same tool) into the main 32KB RAM, (and optionally into the serial boot FLASH EEPROM) of the Propeller chip. After booting the propeller a bytecode interpreter is copied from the built in ROM into the 2K RAM of the primary COG. And then this COG will start interpreting the bytecodes in the main 32KB RAM. More than one copy of the bytecode interpreter can run in other COG's, so several Spin code threads can run simultaneously. Within a the general Spin code program assembler code program(s) can be "inline" inserted. These assembler program(s) will then run on their own COG's. Just like Python Spin uses indentation/whitespace, rather than curly braces or keywords, to delimit statement blocks.

Contents

Syntax

The syntax of Spin can be broken down into blocks. The blocks are as following.

VAR

Holds global variables

CON

Holds program constants

PUB

Holds code for a sub-routine

OBJ

Contains code for objects

Example Keywords

reboot: causes the microcontroller to reboot waitcnt: wait for an amount of clock cycles waitvid: Waits for a video timing event before outputting video data to I/O pins. COGINIT: starts a processor on a new task

Sample Code

An example program, (as it would appear in the "Propeller Tool" editor) which outputs the current system counter every 3000000 cycles, the cog running the program is then shut down by another cog after 40000000 cycles: Image:Example SPIN program.GIF

External links

View More Summaries on Spin (programming language)
 
Ask any question on Spin (programming language) and get it answered FAST!
Answer questions in BookRags Q&A and earn points toward
discounted or even FREE Study Guides and other BookRags products!
Learn more about BookRags Q&A
Copyrights
Spin (programming language) from Wíkipedia. ©2006 by Wíkipedia. Licensed under the GNU Free Documentation License. View a list of authors or edit this article.

Article Navigation
Join BookRagslearn moreJoin BookRags




About BookRags | Customer Service | Report an Error | Terms of Use | Privacy Policy