© Sridhar Anandakrishnan 2018
Sridhar AnandakrishnanPropeller Programminghttps://doi.org/10.1007/978-1-4842-3354-2_17

17. Concluding Thoughts

Sridhar Anandakrishnan
(1)
Department of Geosciences, University Park, Pennsylvania, USA
 
This book has just skimmed the surface of the capabilities of the Propeller microcontroller.
As always, the best way to learn is by doing, so pick a problem of interest and have at it. The next best way to learn is to study somebody else’s code. You can download a number of Spin and PASM projects at the Object Exchange ( http://obex.parallax.com ).
There are a number of programs already written in Spin, and there is a large knowledge base available to help with learning it and fixing problems. However, Spin is relatively slow. Furthermore, Parallax is encouraging new users to learn to use C to program the Propeller and encouraging existing users to migrate. There is a huge knowledge base of information on “standard” C, but the Propeller-specific parts of C are still in development. Finally, PASM is by far the fastest way to run your code (particularly for bit-twiddling), but Cog-C mode is nearly as fast (see Table 17-1).
Table 17-1
Comparison of Compression Speeds
Language
Number of Counts to Compress 128 Samples
Spin code
1.5 million counts
C code (LMM only)
150,000 counts
Cog-C mode
42,000 counts
Mixed-mode C and PASM
23,000 counts
PASM code
22,000 counts
The ideal combination may well be C with Cog-C modules and injected inline assembly code for particular tasks. This is also, unsurprisingly, somewhat complex. I hope that you can use the examples in this book to do your own projects. Good luck with your journey (Figure 17-1)!
Our motto might be “Render unto C that which is C’s and unto PASM to twiddle bits!”
A459910_1_En_17_Fig1_HTML.jpg
Figure 17-1
Crossing the timber line, Pike’s Peak Railway, some time between 1898 and 1905. Detroit Photographic Company, public domain. https://​goo.​gl/​dzvSXN.