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

11. Debugging PASM Code

Sridhar Anandakrishnan1 
(1)
Department of Geosciences, University Park, Pennsylvania, USA
 

It is relatively straightforward to debug Spin code. You can insert commands to print the value of variables to the terminal. This is a time-honored way to debug code, and though tedious, it works. In Listings 11-1 and 11-2, I show how I monitor the value of a variable.

1  PUB MAIN
2  ...
3    UARTS.STR(DEBUG, string(" nsamps = "))
4    UARTS.DEC(DEBUG, nsamps)
5    UARTS.PUTC(DEBUG, CR)
Listing 11-1

Debugging Spin Code with Print Commands

Insert print statements like this in your Spin code, and you can examine the value of ...

Get Propeller Programming: Using Assembler, Spin, and C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.