0% found this document useful (0 votes)
17 views11 pages

Ex-7 Embedded & IOT

Uploaded by

maniv2769
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views11 pages

Ex-7 Embedded & IOT

Uploaded by

maniv2769
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

EXP NO:7A INTRODUCTION TO THE RASPBERRY PI

DATE PLATFORM

Aim :

To study and understand the features, architecture, and programming capabilities of the
Raspberry Pi Pico W microcontroller platform.

Introduction to Raspberry Pi Pico W:

The Raspberry Pi Pico W is a compact and affordable microcontroller board developed by the
Raspberry Pi Foundation. Building upon the success of the Raspberry Pi Pico, the Pico W variant
brings wireless connectivity to the table, making it an even more versatile platform for embedded
projects. In this article, we will provide a comprehensive overview of the Raspberry Pi Pico W,
highlighting its key features and capabilities.

Features:

 RP2040 microcontroller with 2MB of flash memory


 On-board single-band 2.4GHz wireless interfaces (802.11n)
 Micro USB B port for power and data (and for reprogramming the flash)
 40 pins 21mm x 51mm 'DIP' style 1mm thick PCB with 0.1" through-hole pins also with
edge castellations
 Exposes 26 multi-function 3.3V general purpose I/O (GPIO)
 23 GPIO are digital-only, with three also being ADC-capable
 Can be surface mounted as a module
 3-pin ARM serial wire debug (SWD) port
 Simple yet highly flexible power supply architecture
 Various options for easily powering the unit from micro-USB, external supplies, or
batteries
 High quality, low cost, high availability
 Comprehensive SDK, software examples, and documentation
 Dual-core Cortex M0+ at up to 133MHz
 On-chip PLL allows variable core frequency
 264kByte multi-bank high-performance SRAM

Raspberry Pi Pico W:

The Raspberry Pi Pico W is based on the RP2040 microcontroller, which was designed by
Raspberry Pi in-house. It combines a powerful ARM Cortex-M0+ processor with built-in Wi-Fi
connectivity, opening up a range of possibilities for IoT projects, remote monitoring, and
wireless communication. The Pico W retains the same form factor as the original Pico, making it
compatible with existing Pico accessories and add-ons.

RP2040 Microcontroller:

At the core of the Raspberry Pi Pico W is the RP2040 microcontroller. It features a dual-core
ARM Cortex-M0+ processor running at 133MHz, providing ample processing power for a wide
range of applications. The microcontroller also includes 264KB of SRAM, which is essential for
storing and manipulating data during runtime. Additionally, the RP2040 incorporates 2MB of
onboard flash memory for program storage, ensuring sufficient space for your code and
firmware.

Wireless Connectivity:

The standout feature of the Raspberry Pi Pico W is its built-in wireless connectivity. It includes
an onboard Cypress CYW43455 Wi-Fi chip, which supports dual-band (2.4GHz and 5GHz) Wi-
Fi 802.11b/g/n/ac. This allows the Pico W to seamlessly connect to wireless networks,
communicate with other devices, and access online services. The wireless capability opens up
new avenues for IoT projects, remote monitoring and control, and real-time data exchange.

GPIO and Peripherals:

Similar to the Raspberry Pi Pico, the Pico W offers a generous number of GPIO pins, providing
flexibility for interfacing with external components and peripherals. It features 26 GPIO pins, of
which 3 are analog inputs, and supports various protocols such as UART, SPI, I2C, and PWM.
The Pico W also includes onboard LED indicators and a micro-USB port for power and data
connectivity.

MicroPython and C/C++ Programming:

The Raspberry Pi Pico W can be programmed using MicroPython, a beginner-friendly


programming language that allows for rapid prototyping and development. MicroPython
provides a simplified syntax and high-level abstractions, making it easy for newcomers to get
started. Additionally, the Pico W is compatible with C/C++ programming, allowing experienced
developers to leverage the rich ecosystem of libraries and frameworks available.

Programmable Input/Output (PIO) State Machines:

One of the unique features of the RP2040 microcontroller is the inclusion of Programmable
Input/Output (PIO) state machines. These state machines provide additional processing power
and flexibility for handling real-time data and timing-critical applications. The PIO state
machines can be programmed to interface with custom protocols, generate precise waveforms,
and offload tasks from the main processor, enhancing the overall performance of the system.

Open-Source and Community Support:

As with all Raspberry Pi products, the Pico W benefits from the vibrant and supportive
Raspberry Pi community. Raspberry Pi provides extensive documentation, including datasheets,
pinout diagrams, and programming guides, to assist developers in understanding the board's
capabilities. The community offers forums, online tutorials, and project repositories, allowing
users to seek help, share knowledge, and collaborate on innovative projects.

Result:
Thus, the study of the Raspberry Pi Pico W microcontroller platform was completed, and the key
features, wireless capabilities, GPIO options, and programming methods were successfully
understood.
EXP NO:7B LED BLINK
DATE

Aim :
To Write a program for blink an LED connected to a microcontroller using Python
programming with the machine and utime modules.

Algorithm :

Step 1: Start
Step 2: Import the pin class from the machine module and the sleep function from the utime
module.
Step 3: Initialise a new pin object named led with pin number 11 and set it as an output pin.
Step 4: Enter an infinite loop.
Step 4.1: Toggle the state of the led connected to pin 11 (if it's on, turn it off, and if It's off, it on).
Step 4.2: Pause the execution for 0.5 seconds using the sleep function to create a blinking
effect.
Step 5: Stop

Program:

from machine import pin

from utime import sleep

Led = pin(11, pin.out)

While true:

Led.toggle()

Sleep(0.5)
Output:

Result :
Thus, the LED blinking program was written, executed, and the LED successfully blinked as
expected.
EXP NO: 7C
DATE PUSH BUTTON AND LED

Aim :

To write a program for control an LED using a push button connected to a microcontroller by
writing a Python program with machine and time modules.

Algorithm :

Step 1 : Start
Step 2 : Initialize LED connected to pin 15 and set it as an output.
Step 3 : Initialise the push button connected to pin 16 and set it as an input.
Step 4 : If the button is pressed (HIGH),then turn the LED on.
Step 5 : Wait for a short duration (0.1 seconds).
Step 6 : Otherwise,turn the LED off.
Step 7 : Stop

Program:

from machine import Pin


from time import sleep
LED = Pin(15, Pin.OUT)
BUTTON = Pin(16, Pin.IN)
while True:
if BUTTON.value() == 1:
LED.on()
sleep(0.1)
else:
LED.off()
Output:

Result :
Thus, the push button and LED control program was written, executed, and the LED responded
to the button press successfully.
EXP NO:7D
DATE MULTIPLE LEDs BLINK

Aim :

To Write a program for blink multiple LEDs connected to GPIO pins of a microcontroller
simultaneously using Python programming with machine and time modules.

Algorithm :

Step 1 : Start
Step 2 : Import the Pin class from the machine module and the sleep function
from the time module.
Step 3 : Define four LED objects (LED1, LED2, LED3, LED4) each connected to
GPIO pins 6, 7, 8, and 9 respectively, all set as output pins.
Step 4 : Turn all LEDs on simultaneously.
Step 5 : Wait for 1 second.
Step 6 : Turn all LEDs off simultaneously.
Step 7 : Wait for 1 second.
Step 8 : Stop.

Program:

from machine import Pin


from time import sleep
LED1 = Pin(5, Pin.OUT)
LED2 = Pin(9, Pin.OUT)
LED3 = Pin(13, Pin.OUT)
LED4 = Pin(15, Pin.OUT)
while True:
LED1.on()
LED2.on()
LED3.on()
LED4.on()
sleep(1)
LED1.off()
LED2.off()
LED3.off()
LED4.off()
sleep(1)

Output:

Result :
Thus, the program for blinking multiple LEDs was written, executed, and the LEDs blinked
simultaneously as intended.

You might also like