Input Devices
Hello Step Response TXRX Circuit
For this assignment, I designed the hello step response txrx (transmit-receive) circuit in Eagle.
TXRX schematic and board files available here
Fabrication
My next step was to mill the board. Here is my workflow in Fab Modules:
Terminal: type "fab"
Choose "png" to "rml", 500 dpi
>Load png
Settings: 1/64" bit
Diameter (mm): 0.4 Overlap (0-1): 0.5 Intensity (0-1): 0.5 Offsets (-1 to fill): 4 Error (pixels): 1.1 Z (mm): -0.1 Speed (mm/s): 4
>Make Path >Make rml >Send It!
I used the vinyl cutter to make some simple circular touch pads. I then wired the touch-pads to the circuit and hooked everything to the ISP. I got a green light on the ISP indicating that it was able to recognize the microcontroller.
Programming the Board
I decided to use Atmel Studio to program the device. Here is my workflow:
Atmel Studio
Connect the hello.txrx board's J1 ISP Header to the AVRISPmkII, and connect the AVRISPmkII to the computer via the USB cable.
Connect the hello.txrx board's FTDI cable to the computer's USB.
You should get a green light on the AVRISPmkII. New Project> GCC C Executable project Device Selection> ATtiny45
Paste this C code into the command window: http://academy.cba.mit.edu/classes/input_devices/step/hello.txrx.45.c
Save File
Build> Compile
Build> Build Solution
Tools> Device Programming: (Tool: AVRISP mkII, Device: ATtiny45, Interface: ISP) > Apply. >Target Voltage- Read (5V) >Device Signature- Read
This is the part where I keep getting stuck. I have made several boards but each time I try to read the device signature, it says that it "cannot enter programming mode".
Troubleshooting
Testing various boards for defects
My next step was to troubleshoot. I used a multimeter to check for shorts on the board. Everything seems fine.
I next tried to push down on different parts of the board while programming in Atmel Studio. Still no luck. The device keeps saying that it is unable to enter programming mode.
I also tried making a few other boards. They all have the same issue which makes me think that there is an issue with my settings in Atmel studio... maybe the clock speed?
I then came across a few posts online that recommended AVR dude.
Programming with Avrdude in Windows My next step was to try programming with Avrdude.
I created a folder with the files found here: http://academy.cba.mit.edu/classes/input_devices/index.html
I also realized that I needed to hide my file extensions in order for avrdude to properly read them. For this I went to: Start> Control Panel> Folder Options> View
I put a check in the box next to "Hide extensions for known file types"
Avrdude Workflow:
Terminal
avrdude
cd (directory- in my case it is on my desktop)
make -f hello.txrx.45.make
I kept getting an error message as shown below:
I also tried programming on an Ubuntu system, just to see if I might get a different result. I ran the following commands in terminal to set it up:
sudo apt-get install geany (optional code editor)
sudo apt-get install avr-libc gcc-avr avrdude (avr toolchain for ubuntu)
sudo apt-get install gavrasm (assembler for .asm files)
sudo apt-get install python-tk (for GUIs)
sudo apt-get install python-setuptools (allows use of easy_install for python “eggs”)
sudo easy_install pyserial
I got these directions from this former student's page: http://fab.cba.mit.edu/classes/863.11/people/nancy.ouyang/Week9/Week9.html
I then navigated to the proper archive (cd Desktop) and typed the following command: make -f hello.txrx.45.make However, I kept getting the same error message, as seen in the image below.
To install Python on a Mac:
Terminal
sudo easy_install -U pyserial
I saved all of the files found here: http://academy.cba.mit.edu/classes/input_devices/index.html
to a new folder on my computer
To run the Python program: in terminal, navigate to the folder where you saved your files
Python (Filename) / dev/ttyUSB(#)
In my case: Python hello.txrx.45.py / dev/ttyUSB1