2020-2021 ICS4U-E Tasks

 

Project 3.4. Pin Change Interrupt. For your first DER project entry employing the Dolgin Development Board v6 in an off-platform application, you are asked to employ the concept of a Pin Change Interrupt to maintain and display a hexadecimal count on a single 7-segment display.

Also introduced in this project is the concept of resuable code in the form of an external library, consisting of ATtiny84/DDB assets this, and future projects, can draw on. This will shorten your development time and make your functioning prototypes more reliable since they'll be based on proven code.

Basic Task.

  1. Watch this project support video.
  2. If it does not exist currently, create the library file DDBv6XX.h (where XX are your initials) that includes one (or more) Lookup Tables (LuTs) that define a variety of segment maps (segment order, size (10, or 16)) that your client code will refer to when 'outshifting' to your 7-segment display. Place this header file in the /libraries folder of your Arduino Sketchbook folder. Your client code will access this library file from the statement, #include <DDBv6XX.h> in your sketch.
  3. In addition to the three control lines to your '595, wire another free pin from the DDB to the output of your ACES button debouncer. Your code will configure a Pin Change Interrupt on this pin to react to a falling edge from your debouncer PCB. Each of these 'events' result in an increase in (modular) hexadecimal count.
  4. Create the project, PinChangeInterrupts. Using maximum use of register-level code for your GPIO and Pin Change Interrupts, develop a sketch that employs your DDBv6XX.h library to mimic the behaviour as shown in the support video.

Enhanced Task.

Your Session 5 supplemetary kit contains both the generic KY-040 from Amazon and RSGC ACES' (fully debounced) Rotary Encoder on breakout boards.

  1. Incorporate the Rotary Encoder of your choice into the Basic Task so that clockwise rotations increase the count and counterclockwise decrease the count. The inexpensive KY-040 should be fully debounced with caps beyond their onboard 10 KΩ pull up resistorsas suggested on page 2 of this Bourns datasheet.
  2. The Rotary Encoder's Switch will also reset the count to 0.

Submit your DER and attach the two code files, by the deadline: Saturday January 30.

Note. I encountered an issue with my own counting that I eventually resolved only after walking away from the task for a few hours and thinking about it. It may be instructive to share the problem and the solution. At certain numbers, the count would either skip over the digit or simply stall out. The numbers were typically 2 and, especially, 8. It dawned on these numbers draw more current than other numbers and the MCU/prototype may be choking on the demand. After placing a 1 μF capacitor across the power rails to support the rapid draw, operations were considerably smoother. Replacing the 5V USB power source altogether, with a 9V AC/DC adapter, appeared smooth the issues out completely. Remember this tip should you ever encounter similar current demand spikes in future projects. Here's a short video that monitors the current draw for each if the digits (20 mA/segment) Current Draw on Counting


Project 3.3. Keypad Matrix Echo. For your first ATtiny84 project of ICS4U you are to maximize your mid-level coding skills in the development of a prototype that echoes button presses on your 12-key telephone keypad onto your small Adafruit 861 8x8 matrix. Each of you has been assigned a 4x3 subset of your matrix as shown below that represents the 1:1 Key→LED mapping. For example, should your user press the '0' key, the LED indicated will light up for 300 ms, only.

Your ATtiny84 has just enough GPIO pins (10) to pull this task off as I describe it below (7 input; 3 output). Furthermore, the code is surprisingly short if done skilfully.

(Basic) Task.

  1. Assemble a breadboard layout similar to the one shown below.

  2. Ground the Common pin of your keypad so your code can recognize presses through the use of internal pullup resistors set on each input pin.
  3. The 8 output pins of you 74HC595 are more than enough to map to the 4 rows and 3 columns of your matrix
  4. Code the most efficient solution you can think of to light the respective LEDs for 300 ms.
  5. You should be using your newly-minted library and since other projects will draw on its resources you could consider adding an Appendix to your DER at the end, that includes this library.

Optional (Advanced) Task.

Some of you may wish to consider going beyond the basic task.

Rather than 1:1 Key→LED mapping, a 1:4 Key→LED mapping could be achieved. What is compelling about this implementation is that it requires a skill you already possess: PoV!

You have the time; consider it if you are inspired.


Project 3.2. CHUMP. See here.


Project 3.1. GB Machine. The greatest challenge (and I believe, privilege) for ACES is to influence the direction of our program. Through your imagination and skill you are expected to contribute to the enhancement of our mutual creativity, tool set, and assets. G. Benson (ACES' 19) fulfilled this opportunity/commitment through his enhancement of the indispensable PB Machine (P. Bagga, ACES '17). Beginning in the Fall of 2019, Sr. ACES are expected to solder up their own GB machine and put it to good use in the pursuit of their own prototypes.. Your experience with electric circuits has been largely limited to components that use through-hole technology (THT). To round out your proficiency with all components, your next few projects will require the use of devices that use surface-mount technology (SMT). As the graphic reveals, the smallest size that is reasonable for hand-soldering techniques is the 1206 family, so this is what we carry in the DES inventory.

GB Machine (click image to enlarge)
1206 LED Package

Task.

  1. In his Sr. ACES year, G. Benson (ACES '19) redesigned the PB Machine (RSGC ACES DC Power Jack developed by P. Bagga (ACES '17)). Affectionately referred to as the GB Machine, this breadboard appliance includes supply rail spanning, ON/OFF switching, diode protection, and optional features that include 5V regulation and ON/OFF LED indication. You will be given a small parts kit that includes the GB Machine PCB, a THT DC power jack, 1N4001 power diode, 7805 voltage regulator, two mini SPDT slide switches, and two 2x3 male header sets, a blue, 1206 SMT LED, and a 10kΩ 1206 chip resistor.
  2. Using your available soldering equipment, assemble both the THT and SMT components of your GB Machine.
  3. Develop a creative circuit that exploits your new GB Machine device.
  4. Add your first ICS4U project report to your DER and submit by the deadline.
  5. Below is an image of a Grade 10 555-Based Traffic Light Sequence (555+4017) that uses the GB Machine (click image to enlarge)