Program an ATtiny85 to do something interesting!
Introduced in day33
1. Requirements
1.1. Cannot use the Arduino framework
Using the Arduino IDE to compile and upload code (with your Nano running the "Arduino as ISP" code as the programmer) is okay. The IDE, with the correct Tools -> Board … settings gives you the appropriate compiler, linker, and programmer settings for building and uploading code to the target MCU.
What is forbidden is using any other features that are provided in the Arduino framework.
Framework features include, for example, delay()
, millis()
, pinMode()
, digitalRead()
, digitalWrite()
, etc.
It is possible to write your own functions that have the same name as these functions which override the framework’s versions.
1.3. Digital output
Writes to least one general-purpose output pin.
These two refer to the hardware described in ATtiny85 Datasheet section § 10.2 Ports as General Digital I/O.
Specifically, this involves reading register PINx
and writing to register PORTx
and doing any necessary register configuration beforehand.
These registers and hardware are described in the ATtiny85 Datasheet section §10. I/O Ports.
1.7. Utilizes the Analog to Digital converter
and does something with the conversion result.
Using a pin for the ADC input does not also satisfy requirement #2. However, it would be possible to use that same physical pin in general digital I/O mode, which would then cover #2.
Using a timer to trigger your ultrasound module and then reading the echo pin hits four requirements at once, for example.
2. Submission
Demonstrate that your project behaves as designed and satisfies the requirements.
Someone, knowledgeable about embedded systems, but, receiving only what was submitted to Blackboard must be able to independently verify these characteristics. That person [1], therefore, needs at least the following information:
-
"as designed" — A description of the system’s reason for existence (besides "to meet the requirements"). Describe what your thing does, a little why it does so, and how a user interacts with and experiences the results. Make clear what inputs or stimuli cause which outputs or responses.
-
"Demonstrate … behaves" — Evidence of behaving like the above description can be in the form of a demonstration video, a series of photos, output files, etc. In-person demonstrations are fun, but not required.
-
"satisfies the requirements." — There are 7.5 requirements. Ensure that your documentation shows each requirement being met.
The ultimate demonstration of the completeness of the submission would be:
-
Another ECE 322 student (with end-of-course knowledge, skill, and experience) is given the submission materials.
-
They can build, program, and operate a similar system that works in the same way as described in the submission materials.
2.1. Example
One reasonable set of items that demonstrates your project can be:
-
A document (PDF) that holds the project description and serves as the "road map" for the other files, such as
-
An accurate schematic of the system as-built.
-
Overview of what to expect from the demonstration video.
-
Description of each source code file.
-
-
ZIP file containing all of the source code.
-
Video file or include a link in the document.
This doesn’t need to be a detailed, step-by-step, hand-holding tutorial. It merely needs to include enough information and details such that someone else could reproduce the project.