Arduino As An AVR Debugger

When you leave the safety of the Arduino development environment and move to development with Atmel AVR processors, without an IDE, you lose some debugging / printing capabilities.  However, there is a simple technique to recover some functionality. This is not a replacement for real debugging tools, but rather a quick fix for simple print capability. I develop in an OS X environment with Emacs as my editor, avr-gcc as my compiler, and avrdude to download the compiled code to the AVR processor via an AVRISP mark II device.

Now the simple hack. You take an Arduino and make it a slave SPI device that simply reads data off of the SPI bus, when it is selected, and uses the Arduino’s Serial.print() capability to print the data over the USB port to the Arduino console. The following code performs this function.

You now setup the AVR microcontroller to be an SPI master and create print functions that meet your needs.  A simple function that prints a single byte or character is included below.  It simply selects the debug device, sends a byte of data over the SPI bus, and deselects the debug device.  When the Arduino receives the byte of data it is displayed on the Arduino console, our new debug window.

This function can now be used to create additional functions such as printStr(), etc.  As I said, a simple hack to solve a simple problem.

Domain of One’s Own @ BYU

At Brigham Young University we’ve noticed the work at Mary Washington University on the Domain of One’s Own.  I’ve been thinking for some time about providing each of our potential, matriculated and former students with a portfolio where they could deposit their application material before arriving, school work while here, and other contributions to society throughout their lives.

Students could then explicitly permit the institution to access and evaluate their work. They could permit potential employers to view samples of their work, and could interact with others through shared access, etc.

The  MWU Domain of One’s Own initiative may be a great start at such a tool. I love their concept that in addition to a tool to facilitate student learning it also teaches students to take control of their own data and to stake out their own digital identity. In addition to learning traditional college disciplines, they learn to interact and communicate in the virtual online world.

We’re going to learn from these pioneers and bring the knowledge to the students at BYU. This should be an interesting and fun experience.