Week 7, 10/18: Embedded Programming


This week, I have done my best to understand the basis of digital fabrication, computational architecture, which is made up of an alignment of software and hardware, extending from simple actions which take only a tiny quantity of bits to a complex, multidimensional fabric of computations per second. I have been on the user end of computers for most of my life, understanding how they work has always been shrouded in mystery.


Although I do not have the background knowledge to fully appreciate VonNeumann's "First Draft of a Report on EDVAC," the parts I could understand abstractly illuminated the very beginnings of thinking about around computing and the practocal ways to achieve it. It was interesting to discover the basis upon which so much has been built. There are countless ways the element described in this paper have impacted the technology we take for granted today.


It was also helpful and enlightening to think about the software of a computer existing in physical space as the architecture on a circuitboard, or elsewhere, as described in Neil Gershenfeld's paper, "Aligning the representation and reality of computation with asynchronous logic automata." From my perspective, there is much to be learned from the concept of aligning computing with the laws of physical space. If we extended this thinking to other areas of thought and action, to create systems that are based upon the laws of the natural world, would our systems in social, political and economic arenas be more in balance with our ecosystems? This could have significance for the most dire issues of our time, like global climate change.


I have read through the datasheet for the ATtiny44, and in all honesty, did not understand much of what I was seeing. However, I suspect that the information contained therein will only begin to make sense as I use it to create programs and things. The same has been true of the tutorials I have read through and watched. Much of it is over my head, but I feel that if I was actively using the knowledge on a more regular basis, things would come into focus. These tutorials were helpful to me:

AVR


Arduino


I wanted to learn more about what the ATtiny was capable of from a source that might help me decode the datasheets, so I skimmed through the documents section on this page about the ATtiny44:

In Production - The high-performance, low-power Microchip AVR RISC-based CMOS 8-bit microcontroller combines 4KB ISP flash memory, 256-Byte EEPROM, 256B SRAM, 12 general purpose I/O lines, 32 general purpose working registers, an 8-bit timer/counter with two PWM channels, a 16-bit timer/counter with two PWM channels, internal and external interrupts, an 8-channel 10-bit A/D converter, a programmable gain stage (1x, 20x) for 12 differential ADC channel pairs, programmable watchdog timer with internal oscillator, a internal calibrated oscillator, and three software selectable power saving modes. By executing powerful instructions in a single clock cycle, the device achieves throughputs approaching 1 MIPS per MHz, balancing power consumption and processing speed.



Detailed info about the duties of each port and pin is best found from the datasheets, and since my output, the LED, was connected to pin 6 or PortA7, I wanted to learn more about Port A:


"1.1.5 Port A (PA7:PA0) Port A is a 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port A output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port A pins that are externally pulled low will source current if the pull-up resistors are activated. The Port A pins are tri-stated when a reset condition becomes active, even if the clock is not running. Port A has alternate functions as analog inputs for the ADC, analog comparator, timer/counter, SPI and pin change interrupt as described in "Alternate Port Functions."'


It was my goal to begin the assignment by programming a simple flashing of the LED on an interval loop using the Arduino and avrdude toolpaths. I began with Arduino, and after searching through the very helpful pages of past student work, I found a great tutorial which helped me understand the process of using Arduino to create programs, specifically how to make the LED on my board blink.



I followed the steps and kept getting an error message: "An error occurred while uploading the sketch"


I contacted TA Prashant who was able to come help me figure out what my problem was through a comprehensive and step by step debugging process.


The soldering was good, the connections were good. However, we ultimately discovered that there is a problem with the fundamental design of my board: a section of the layout is causing the copper lines to be too close together underneath the ATtiny.



I removed the ATtiny to view the layout and attempted to fix the problem manually by using a blade to cut a deeper trench in between the copper lines. I soldered the microcontroller back on and unfortunately it did not solve the problem. Prashant gave me some pointers on the design in Eagle and I have gone back to the drawing board.


Unfortunately, despite having learned a lot, I was not successful in completing this week's assignment. I am still working on a new schematic and need to create a new board. Then I need to continue where I was stopped by my hardware, and use the toolpaths to create software which will result in a blinking button board.





The computer was successfully talking to the board! I got it to do so in the Ubuntu terminal following the code and was able to successfully burn the bootloader in Arduino.


The next step was using the python terminal to type "hello world" but that did not work. I also tried Arduino's "blink" program, but was unsuccessful there, too.



I will have to do debugging to figure out what is going on.


I got a cheap Chromebook and installed Linux Ubuntu on it. I've always been primarily a Windows user, with some dabbling in Apple. However, my Dell laptop has Windows 10 on it, and is my primary computer. I was having trouble working with powershell and in general, so I really felt the need to get a computer which I could use to learn development and programming. I installed Ubuntu's xfce4 in Developer mode and learned how to download and install program packages. It's a bit of a learning curve, but am finding that using the command line to do things is actually much easier than using GUIs and the mouse to click through pathways. It is helping me to understand how the computer actually works and is very enlightening. I have learned a few basic commands and am really looking forward to continued use of the command line to do things.