Assignment

  • Group Assignment:browse through the data sheet for your microcontroller
  • compare the performance and development workflows for other architectures
  • Individual Assignment:write a program for a microcontroller development board that you made,to interact (with localinput &/oroutput devices) and communicate (with remotewired or wireless devices)
  • extra credit: use different languages &/or development environments
  • extra credit: connect external components to the board
  • All the important links are Here

    Learning outcomes

  • Implemented programming protocols
  • Group Assignment

    Here is my group assignment

  • browse through the data sheet for your microcontroller
  • compare the performance and development workflows for other architectures
  • Datasheet

    ATtiny 44 Microcontroller

    ATtiny44 is a microcontroller from AVR Microcontroller family.It is a High performance, low power ,8 bit microcontroller.It follows advanced RISC Architecture .

    Your Image Description

    My microcontroller that I used is ATtiny44

    Here is the datasheet for ATtiny44

    This is a pin out configuration of the microcontroller

    Your Image Description

    Pin description

  • VCC - It provides the supply voltage
  • GND
  • PortB(PB3:PB0) : It is a I/O Port with boidirectional data transfer.
  • PortA (PA7:PA0):It is also a 8-bit I/O bidirectional board with internal pul up resistor.
  • RESET :It is an inverted RESET pin.A low level pulse more than minimum length will reset pin.
  • Key Takeaways from ATtiny24/44/84 Datasheet:

    • Memory Configuration: Flash memory for program storage, EEPROM for data storage, and SRAM for temporary data storage.
    • Peripheral Features: Timers/counters, PWM channels, ADC, comparators, and USART for serial communication.
    • Clock Sources: Support for internal and external clock sources.
    • Low Power Modes: Including Idle, ADC Noise Reduction, Power-down, and Standby modes.
    • I/O Ports: General-purpose I/O pins organized into ports.
    • Interrupts: Support for external and internal interrupts.
    • Programming and Debugging: Can be programmed using ICSP interfaces such as SPI or JTAG.
    • Operating Conditions: Designed to operate within specified voltage and temperature ranges.
    • Packaging Options: Available in various package options including PDIP, SOIC, and QFN.

    Architecture or Block diagram of ATtiny 44

    Your Image Description

    XIAO-RP2040 Microcontroller

    Here is the datasheet for XIAO RP2040

    The Xiao RP2040 is a small, affordable circuit board that you can use to control electronic projects. It's like a tiny computer that can run programs to make lights blink, motors move, or sensors react to the environment. It's handy for hobbyists, students, and professionals who want to create all sorts of gadgets and devices.

    This is the pin out configuration of the microcontroller

    Your Image Description

    Key takeaways from the datasheet

    • Microcontroller: Xiao RP2040 features a powerful RP2040 microcontroller.
    • Memory: It has 264KB of embedded SRAM and 2MB of embedded flash memory.
    • Peripherals: Various peripherals including GPIO, I2C, SPI, UART, PWM, ADC, DAC, and USB.
    • Flexible Clock System: Supports a wide range of clock frequencies and configurations.
    • Low Power: Offers low-power sleep and dormant modes for energy-efficient operation.
    • Rich Connectivity: USB 1.1 with device and host support, enabling versatile connectivity options.
    • Operating Conditions: Designed to operate within specified voltage and temperature ranges.
    • Package: Available in a compact form factor for easy integration into various projects.

    Individual Assignment

    • write a program for a microcontroller development board that you made,to interact (with localinput &/oroutput devices) and communicate (with remotewired or wireless devices)
    • extra credit: use different languages &/or development environments
    • extra credit: connect external components to the board

    Programming

    Firstly I thought of programming a circuit board, I designed as a practice board. But for this week's assignment I added a button to it.But I ended up programming the quentoores from Electronic Production week.

    Image 1
    Image 2

    Then I added my initials using inkscape

    Your Image Description

    Printing the board

    Image 1
    Image 2
    Your Image Description

    Components

    Your Image Description

    Soldering!

    Your Image Description
    Image 1
    Image 2

    Change of plans

    Sadly, while trying to program my board, after connecting the Arduino UNO to my board using AVR ISP, it got stuck and I used too much force and mistakenly took out the copper plate as well. And as there was not much time left I changed my plans and used the QuenTorres.

    Programmer board : QuenTorres

    Image 1
    Image 2

    Programming

    http://drazzy.com/package_drazzy.com_index.json

    https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

    Your Image Description
    Your Image Description
    Your Image Description
    Your Image Description
    Your Image Description
    Your Image Description
    Your Image Description
    Your Image Description
    Your Image Description
    Your Image Description
    Your Image Description

    This is the code I used

        
        /*
          Button
        
          Turns on and off a light emitting diode(LED) connected to digital pin 13,
          when pressing a pushbutton attached to pin 2.
        
          The circuit:
          - LED attached from pin 13 to ground through 220 ohm resistor
          - pushbutton attached to pin 2 from +5V
          - 10K resistor attached to pin 2 from ground
        
          - Note: on most Arduinos there is already an LED on the board
            attached to pin 13.
        
          created 2005
          by DojoDave http://www.0j0.org
          modified 30 Aug 2011
          by Tom Igoe
        
          This example code is in the public domain.
        
          https://www.arduino.cc/en/Tutorial/BuiltInExamples/Button
        */
        
        // constants won't change. They're used here to set pin numbers:
        const int buttonPin = 27;  // the number of the pushbutton pin
        const int ledPin = 1;    // the number of the LED pin
        
        // variables will change:
        int buttonState = 0;  // variable for reading the pushbutton status
        
        void setup() {
          // initialize the LED pin as an output:
          pinMode(ledPin, OUTPUT);
          // initialize the pushbutton pin as an input:
          pinMode(buttonPin, INPUT);
        }
        
        void loop() {
          // read the state of the pushbutton value:
          buttonState = digitalRead(buttonPin);
        
          // check if the pushbutton is pressed. If it is, the buttonState is HIGH:
          if (buttonState == HIGH) {
            // turn LED on:
            digitalWrite(ledPin, HIGH);
          } else {
            // turn LED off:
            digitalWrite(ledPin, LOW);
          }
        }
        
        

    Serial Communication

    I programmed my Quentorres board to provide real-time feedback by printing 'LED ON' and 'LED OFF' messages to the serial monitor when the LED blinks and remains off, respectively.

    This is the code I wrote myself to fulfil the requirements

      
        const int ledPin = 1; 
    
    void setup() {
      pinMode(ledPin, OUTPUT);
      Serial.begin(9600);
    }
    
    void loop() {
      digitalWrite(ledPin, HIGH);  
      Serial.println("LED ON");   
      delay(1000);                
      digitalWrite(ledPin, LOW);  
      Serial.println("LED OFF");  
      delay(1000);                
    }
      
    

    Explanation of the code

    const int ledPin = 1;

    Defines a constant integer variable ledPin with a value of 1. This specifies that the LED is connected to GPIO pin 1 on the ESP32-C3.

    void setup() {

    Begins the setup() function, which runs once when the microcontroller starts or is reset.

    pinMode(ledPin, OUTPUT);

    Configures pin 1 (ledPin) as an output, allowing the microcontroller to control an external device like an LED.

    Serial.begin(9600);

    Initializes serial communication with the computer via the USB port at a baud rate of 9600 bits per second. This enables communication with the Serial Monitor for debugging and feedback.

    void loop() {

    Starts the loop() function, which runs repeatedly as long as the microcontroller is powered on.

    digitalWrite(ledPin, HIGH);

    Sets pin 1 (ledPin) voltage to HIGH, turning on the LED connected to it.

    Serial.println("LED ON");

    Prints "LED ON" to the Serial Monitor, indicating that the LED is turned on.

    delay(1000);

    Pauses the program for 1000 milliseconds (1 second), keeping the LED on for this duration.

    digitalWrite(ledPin, LOW);

    Sets pin 1 (ledPin) voltage to LOW, turning off the LED.

    Serial.println("LED OFF");

    Prints "LED OFF" to the Serial Monitor, indicating that the LED is turned off.

    delay(1000);

    Pauses the program for another 1000 milliseconds (1 second), keeping the LED off for this duration.

    The loop() function then repeats from step 6, causing the LED to blink on and off continuously every second.