PASM Intro and Tutorial book [updated - now with C and cogc chapters]

sanandaksanandak Posts: 16
edited November 2016 in Propeller 1 Vote Up0Vote Down
Friends,

I have put a book for sale on leanpub that I hope is a useful intro and tutorial on C and pasm programming for folks who know spin and want to speed things up.

https://leanpub.com/propellerassemblerpasmintroduction

You can read a free sample (first two chapters) and purchase the whole book if you are interested.

I implement a "Delta-compression" algorithm - first in Spin, then in PASM, then in C.

As you have comments and corrections I will update the text on leanpub and you can download the updated book for free (leanpub also has a 45 day refund policy if you are unsatisfied).

The code (spin and pasm) is on github.com/sanandak/propbook-code - please feel free to download/fork and send pull requests...

Sincerely,
Sridhar

Attached is the table of contents...
Leanpub book on Propeller Programming in C and PASM

email: sak [at] essc.psu.edu

Comments

  • 20 Comments sorted by Date Added Votes
  • I read through your free sample, it looks/looked very good. I always like to see that LaTeX is still alive and well. I used LaTeX a lot back in my days at Hewlett-Packard on HP-UX (UNIX) writing documentation for our automated test engineering software group.

    I went ahead and purchased the full e-book from leanpub and downloaded the example code files from git hub. Purchasing from leanpub was easy and quick.

    I look forward to going through the whole book. If I spot anything that needs correcting, I'll let you know.

    Keep up the good work.

    Along with 'Antimatter' and 'Dark Matter' we've recently discovered the existence of
    `Doesn't Matter`, which appears to have no effect on the universe whatsoever.
  • I noticed a '32Kb' in the sample where it's likely that '32KB' was meant.. as RAM and EEPROM and the like is sold in _bits_ (e.g. the 27C512 which is 512 kilobits, i.e. 64KB), it's best to use the proper terms.
  • Excellent stuff Sridhar! Really nice looking book so far, will send PR's if I stumble on anything.
  • Dear Francis, Tor, geo_leeman - thanks for the comments and kind words. I'll fix those things.

    Latex is still very much in use. The ebook sites (leanpub, gitbook, overleaf, softcover) prefer markdown, but I found it difficult to integrate the diagrams into the text.
    Sincerely,
    Sridhar
    Leanpub book on Propeller Programming in C and PASM

    email: sak [at] essc.psu.edu
  • LaTeX is great. I write all my documentation in LaTeX. I have automatic translators from other formats, that I wrote, e.g. from good old FrameMaker MIF (Maker Interchange Format). The nice thing is that you can extract the exact content, but leave out the formatting - so by simply applying your own \document{style} any old document can be brought up to the company's (or whoever's) current style.
    Combine it with revision control like Git (not possible with binary formats, or messed-up XML formats), and Perl or other scripting to transform text, and LaTeX is unbeatable.

    Those first chapters look good btw. I may buy it, haven't decided yet.
  • In page VII, point 2.2 it states "....M9 Tohuki earthquake". It ought to be "... M9 Tohoku ..."

    Kenichi
  • Friends, I have updated the book on the leanpub site.
    I added 4 chapters on programming the propeller with C.

    Here is a table of contents to the book.


    https://leanpub.com/propellerassemblerpasmintroduction

    Sincerely,
    Sridhar
    Leanpub book on Propeller Programming in C and PASM

    email: sak [at] essc.psu.edu
  • Tracy AllenTracy Allen Posts: 6,103
    edited November 2016 Vote Up0Vote Down
    That's great Sridhar. I received the notification from Leanpub and downloaded the new version. Thank you, it is nicely done, clearly written, good for explanation of both the programming tools and the methods to achieve the goals.

    Curious, are you Sridhar Anandakrishnan, Professor of Geosciences at Penn State? Oh, I see you say so on your Leanpub page. Seismology, Glaciology, that explains a lot about the keen focus on data compression. But what about the trains?
  • Dear Tracy - thanks for the comments on the book (and if/when you find any errors, please let me know).

    We used to go on a train to visit my grandmother every summer - it was the highlight of the year for me. I have loved trains ever since!

    Sincerely,
    Sridhar
    Leanpub book on Propeller Programming in C and PASM

    email: sak [at] essc.psu.edu
  • sanandak,

    I've just purchased and have started reading your book. Great! Although I am a fan of Spin, easily gets lost in C, and are in the wild with PASM - I am curious to learn, and your book is very clear, concise and educational. I look forward to enjoy reading it all. Thanks.

    Erlend
    21st century - when everything changes
    "Better with a DAT and a COG than with a CAT and a DOG"
  • ErlendErlend Posts: 554
    edited November 2016 Vote Up0Vote Down
    I am not sure I agree to this, though:
    Parallax is encouraging new users to learn to use C to program the propeller, and encouraging existing users to migrate.
    and I do hope it will not become true any time soon. On project-to-completion speed, nothing beats Propeller+Spin.

    Erlend
    21st century - when everything changes
    "Better with a DAT and a COG than with a CAT and a DOG"
  • Dear Erlend, thanks for your encouragement, and I hope you find the book useful (please point out errors and suggest areas for improvement).

    In terms of spin vs C - I am somewhat agnostic. In my opinion, C is almost as easy to use as Spin. The part that makes most people's head explode (including mine!) is pointers. In fact, there is an obfuscation contest to see how maddening one can make pointers! However, for most things you can use the simplest form of pointers...

    Because I come from a unix/C background, and now that simpleIDE is available, I think I will tend towards C. (note that simpleIDE isn't as stable as the propeller tool or propellerIDE). I find that it will lock up very often and needs to be killed and restarted.

    I am working on a Makefile solution where the compile and linking is done in the makefile so I can use command line tools to do my work (which I much prefer - using emacs to edit the code; a makefile to compile and link; and a command line tool to download the code to the propeller and a terminal to see the output - my idea of heaven!).

    Spin and PASM work together very easily in terms of launching new cogs (either new pasm cogs or new spin cogs).

    C can launch new C cogs easily enough. However, launching new cogC cogs or new PASM cogs is an intricate dance. C is faster than Spin, which may not matter for many projects...

    The fact that new users are learning C hopefully means that the tools for using C will continue to improve and existing users *can* migrate if they wish to! :)

    Cheers,
    Sridhar

    Leanpub book on Propeller Programming in C and PASM

    email: sak [at] essc.psu.edu
  • sanandak wrote: »
    I am working on a Makefile solution where the compile and linking is done in the makefile so I can use command line tools to do my work (which I much prefer - using emacs to edit the code; a makefile to compile and link; and a command line tool to download the code to the propeller and a terminal to see the output - my idea of heaven!).

    Have you discovered PropWare yet? You may find its build system exactly what you're looking for. As an emacs user, you may also like this suite of plugins: https://github.com/atilaneves/cmake-ide
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
    Tag me with "@DavidZemon" if you have a question for me. I will be checking these forums far less for the forseeable future.
  • sanandak wrote: »
    In terms of spin vs C - I am somewhat agnostic. In my opinion, C is almost as easy to use as Spin. The part that makes most people's head explode (including mine!) is pointers. In fact, there is an obfuscation contest to see how maddening one can make pointers! However, for most things you can use the simplest form of pointers...
    Spin has pointers too. The LONG[x] syntax treats x as a pointer. And @y takes the address of y (a pointer).

  • Dr. Sridhar Anandakrishnan was featured on recent eps of the Embedded.fm / Don't Panic Geocast podcast ( it was a combo effort) and mentioned his book as well as how he using the Propeller in his Geo Device.

    He gave some very cool Props to Parallax and the folks on the forum for their assistance with his device as well as his book.

    It's certainly worth a listen.


    embedded.fm/episodes/206

    dontpanicgeocast.com/?p=484

  • Sanandak,

    Just previewed the book. Looks good, just purchased. This is going to be most useful addition.

    Thanks,

    Frank
    Ordnung ist das halbe Leben....
    Ich lebe in der anderen Hälfte
  • Sanandak,

    Just previewed the book. Looks good, just purchased. This is going to be most useful addition.

    Thanks,

    Frank

    +1

    PropBASIC ROCKS!
  • Just finishing up the SPIN part of the book. The examples he uses really help make the topic pop. Had to think about a couple things he did, but it was good to go through in detail. This is shaping up to be an excellent read so far. I have seen variants of TDD. I like the way he presents that as well. Now on to PASM.
    Ordnung ist das halbe Leben....
    Ich lebe in der anderen Hälfte
  • JonM and Frank - thanks for the shoutout to the book - and to the podcasts - it was a lot of fun doing it.

    Any feedback you have after spending some time reading the book would be welcome.
    Thanks,
    Sridhar
    Leanpub book on Propeller Programming in C and PASM

    email: sak [at] essc.psu.edu
  • PMd a couple notes, more to follow. So far so good. Book has been very useful.
    Ordnung ist das halbe Leben....
    Ich lebe in der anderen Hälfte
Sign In or Register to comment.