Embedded programming
Assignment
All the important links are Here
All the important links are Here
Here is my group assignment
ATtiny44 is a microcontroller from AVR Microcontroller family.It is a High performance, low power ,8 bit microcontroller.It follows advanced RISC Architecture .
My microcontroller that I used is ATtiny44
Here is the datasheet for ATtiny44
This is a pin out configuration of the 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
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.
Then I added my initials using inkscape
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.
http://drazzy.com/package_drazzy.com_index.json
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
/*
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);
}
}
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);
}
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.