PRJ2: ESP2-UC workshop 1 Introductie 1.

Slides:



Advertisements
Similar presentations
Asst. Prof. Dr. Alper ŞİŞMAN
Advertisements

Lecture 1 – Arduino Basics
Lab7: Introduction to Arduino
Chung-Ta King National Tsing Hua University
Slides created by: Professor Ian G. Harris PIC Development Environment MPLAB IDE integrates all of the tools that we will use 1.Project Manager -Groups.
Infineon Technologies Corp. June 99 1 HOT167-1 Version 2.0 F PWMmax = x 50ns = 78 kHz Pulse Width Modulation Unit (PWM) (20 MHz)  4 independent.
Asst. Prof. Dr. Alper ŞİŞMAN
Part 1 Using the ARM board And start working with C Tutorial 5 and 6
Silicon Labs ToolStick Development Platform
2.0 EMBEDDED CONTROLLER Engr. Hj. Mohamad Fauzi bin Zakaria Department of Mechatronics and Robotics Engineering Faculty of Electrical and Electronic Engineering.
ADAM46P20 Simulator V User’s Manual ETA Chips, Co., Kr., 2011 By W.S.YOU.
System Clocks.
1 ARM University Program Copyright © ARM Ltd 2013 General Purpose I/O.
Teachers Name : Suman Sarker Telecommunication Technology Subject Name : Microcontroller & Embedded System Subject Code : 6871 Semester : 7th Department.
Arduino. What is it? A open-source software suite and single-board microcontroller. Allows easy and affordable prototyping of microcontroller applications.
Microprocessors A practical approach Subjects Goals for this module Results Subjects of the module Plans Questions.
1 ARM University Program Copyright © ARM Ltd 2013 General Purpose I/O.
ECS642U Embedded Systems Digital I/O William Marsh.
1 General Purpose and Alternate Function I/O (GPIO and AFIO)
AVR Programming: Digital I/O September 10, What is Digital I/O? Digital – A 1 or 0 Input – Data (a voltage) that the microcontroller is reading.
INTRODUCTION TO PIC MICROCONTROLLER. Overview and Features The term PIC stands for Peripheral Interface Controller. Microchip Technology, USA. Basically.
ECE Lecture 1 1 L15 –I/O Part II Department of Electrical and Computer Engineering The Ohio State University ECE 2560.
1-3 GPIO_Output(LuminaryLibrary) 1.Alter the output current to 4mA 2.Let LED0 turn on but LED 1 turn off. Modify your program in E:\yourname\arm.
ChibiOS/RT Demo A free embedded RTOS
Introduction to the DE0 Board Prof. Taeweon Suh Computer Science & Engineering Korea University COSE221, COMP211 Computer Logic Design.
ARM Embedded Programming Lecture 4 Accessing Memory Mapped Registers.
NAM S.B MDLAB. Electronic Engineering, Kangwon National University 1.
STM32F107VC Datablad Reference manual Schematics.pdf.
1 The LPC1768 Architecture (with focus on Cortex-M3)
Introduction to the ARM mbed Platform– A Hands-on Course
Outline Introduction to NuMaker TRIO Programming environment setup
Outline Introduction to Arduino UNO Programming environment setup GPIO
Chapter 3 General-Purpose Processors: Software
CS4101 嵌入式系統概論 General Purpose IO
Microcontroller basics
The first change to your project files that is needed is to change the device to the correct FPGA. This is done by going to the Assignments tab on the.
Microcontroller basics
TI ARM I/O Programming Chapter 2
Copyright © Infineon Technologies AG All rights reserved.
UTA010 : Engineering Design – II
Chapter 6 General Purpose Input/Output
CS4101 Introduction to Embedded Systems Lab 1: General Purpose IO
UNIT – Microcontroller.
Lesson Outline Peripherals Memory-Mapped IO Ports GPIO Multiplexing
PRJ2UC: Microcontrollers
COMP211 Computer Logic Design Introduction to the DE2 Board
NS Training Hardware.
Programming Microcontroller ADC – Analog Digital Converter
CS4101 嵌入式系統概論 General Purpose IO
Arduino Part 1 Topics: Microcontrollers Programming Basics
Atmel ARM I/O Programming
Freescale ARM I/O Programming
ARM Cortex-M4 Combines DSP and microcontroller features
Embedded Systems Software Training Center
Blinking an LED Using MSP430ware to Control GPIO
Programming Microcontroller GPIO – General Purpose Input/Output
Microcomputer Systems 1
The Arduino Microcontroller: Atmel AVR Atmega 328
STM Arm I/O Programming
UART Serial Port Programming
CS-4540 Robotics - Lab 05 Switch inputs to the Arduino Uno
Baremetal C Programming for Embedded Systems
Designing with ARM Cortex-M4 (and a Real Dev Board)
8051 Micro Controller.
Dale Wheat Dallas Makerspace February 2019
Lab 1. Introduction to the DE2 Board
CS4101 Introduction to Embedded Systems Lab 2: Basic IO and Timer
Lab #1: Getting Started.
Introduction to arduino
ECE 3567 Microcontrollers Lab
Presentation transcript:

PRJ2: ESP2-UC workshop 1 Introductie 1

Hoe dit onderdeel in elkaar zit Tooling GPIO Leerdoelen vandaag Hoe dit onderdeel in elkaar zit Tooling GPIO 2

Overzicht semester Periode 3 en 4 EC’s Embedded Systems Project 2: sensoren en actuatoren (ESP2) Project 2 10 Projectopdracht Projectvaardigheden workshop 32-bit Microcontroller workshop Information Technology 2 Electrical Engineering Fundamentals 2 3

Literatuur Han Scholar: ET-V12-ES 4

Aanschaffen: STM32F0DISCOVERY discovery development kit Benodigde Materiaal Aanschaffen: STM32F0DISCOVERY discovery development kit Zie: www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF253215 ARLE = Applied Reseach Lab Engineering 5 5

praktische opdrachten Werkwijze workshops praktische opdrachten 6

Toetsing Productrapport 25 % Product 25 % Productpresentatie √ Printontwerp √ Professional Skills √ Integrale toets 50 % 7

Onderwerpen Installation and verification of the SDE & GPIO Voorjaarsvakantie Ontwikkelweek Architecture of the STM32F051x & USART Standard Peripheral Driver Library Timers/Counters & PWM ADC/DAC I2C DMA 8

ST32F4 Pebble Time Smartwatch http://www.eevblog.com/2015/07/01/eevblog-761-pebble-time-smartwatch-teardown/

Hoe dit onderdeel in elkaar zit Tooling GPIO Vandaag Hoe dit onderdeel in elkaar zit Tooling GPIO 10

Documents STM32F05xxx Reference Manual http://www.st.com/st-web- ui/static/active/en/resource/technical/document/ref erence_manual/DM00031936.pdf STM32F051R8 Datasheet http://www.st.com/web/catalog/mmc/FM141/SC116 9/SS1574/LN7/PF251901 11

MDK-ARM Microcontroller Development Kit Tools MDK-ARM Microcontroller Development Kit Download vanaf: www.keil.com/arm/mdk.asp Installeer 12

Dit start automatisch de ‘Pack Installer’ Tools Dit start automatisch de ‘Pack Installer’ Installeer ten minste Keil::STM32F0xx_DFP 13

Tools Installeer de ST-LINK/V2 drivers vanaf: http://www.st.com/web/catalog/tools/FM146/C L1984/SC724/SS1677/PF251168 14

Example project Download example ZIP file from Scholar Start μVision by double clicking the file blinky.uvprojx Build the project by pressing F7 or The Build Output should look like this: Connect the STM32F0-Discovery board to your PC/laptop. Program the microcontroller by pressing the load button or from the menu Flash -> Download

Example project Troubles during installation or running the blinky project? 1. See Scholar for additional information. 2. Ask your teacher.

Hoe dit onderdeel in elkaar zit Tooling GPIO Vandaag Hoe dit onderdeel in elkaar zit Tooling GPIO 17

General Purpose Input Output GPIO General Purpose Input Output GPIOx-IDR 16-bits simultaneous GPIOx-MODER input, output, alternate function or analog GPIOx-PUPDR Pull-up, Pull-down, disabled GPIOx-ODR 16-bits simultaneous GPIOx-OTYPER Push-pull, open-drain or disabled GPIOx-BSRR Individual Bit Set Reset

GPIO registers

GPIO registers

stm32f0xx.h typedef struct { __IO uint32_t MODER; /* port mode register */ __IO uint16_t OTYPER; /* port output type register */ uint16_t RESERVED0; __IO uint32_t OSPEEDR; /* port output speed register */ __IO uint32_t PUPDR; /* port pull-up/pull-down register */ __IO uint16_t IDR; /* port input data register */ uint16_t RESERVED1; __IO uint16_t ODR; /* port output data register */ uint16_t RESERVED2; __IO uint32_t BSRR; /* port bit set/reset registerBSRR */ __IO uint32_t LCKR; /* port configuration lock register */ __IO uint32_t AFR[2]; /* alternate function low register */ __IO uint16_t BRR; /* bit reset register */ uint16_t RESERVED3; } GPIO_TypeDef;

CMSIS Compliant ! Code – Register access //in stm32f0xx.h #define GPIOC ((GPIO_TypeDef *) GPIOC_BASE) //0x48000800 //in your code: GPIOC->ODR = 0x00000000; -> : “indirect selection operator” CMSIS Compliant !

Code - Set individual bits #define RCC_AHBENR_GPIOCEN ((uint32_t)0x00080000) //set individual bit: RCC->AHBENR |= RCC_AHBENR_GPIOCEN; Register Mask register |= mask; ≡ register = register | mask; Individual set: bitwise or Example: Register 0b00001111000011110000111100001111 Mask 0b00000000000010000000000000000000 ---------------------------------- OR

Code – Clear individual bits #define GPIO_OTYPER_OT_8 ((uint32_t)0x00000100) #define GPIO_OTYPER_OT_9 ((uint32_t)0x00000200) //clear individual bits: GPIOC->OTYPER &= ~(GPIO_OTYPER_OT_8 | GPIO_OTYPER_OT_9); Register Mask GPIO_OTYPER_OT_8 0b00000000000000000000000100000000 GPIO_OTYPER_OT_9 0b00000000000000000000001000000000 ---------------------------------- OR Mask 0b00000000000000000000001100000000 Individual clear: bitwise and with bitwise inverse Register 0b00001111000011110000111100001111 ~Mask 0b11111111111111111111110011111111 ---------------------------------- AND Register 0b00001111000011110000110000001111

Code – Toggle individual bits GPIOC->ODR ^= GPIO_ODR_0; Register Mask Individual toggle: bitwise xor Example: Register 0b00001111000011110000111100001111 Mask 0b00000000000000000000000000000001 ---------------------------------- XOR Register 0b00001111000011110000111100001110

GPIO example #include "stm32f0xx.h" void delay(const int d);   int main(void) { RCC->AHBENR |= RCC_AHBENR_GPIOCEN; //GPIOC Periph clock enable GPIOC->MODER |= (GPIO_MODER_MODER8_0 | GPIO_MODER_MODER9_0); //PC8 and PC9 output GPIOC->OTYPER &= ~(GPIO_OTYPER_OT_8 | GPIO_OTYPER_OT_9); //Push pull mode selected   GPIOC->OSPEEDR |= (GPIO_OSPEEDER_OSPEEDR8 | GPIO_OSPEEDER_OSPEEDR9); //maximum speed GPIOC->PUPDR &= ~(GPIO_PUPDR_PUPDR8 | GPIO_PUPDR_PUPDR9); //no pull-up or pull-down while(1) GPIOC->BSRR = GPIO_BSRR_BS_9; // Set PC9 GPIOC->BSRR = GPIO_BSRR_BR_8; // Set PC8 delay(SystemCoreClock/8); // delay 1 sec. GPIOC->BSRR = GPIO_BSRR_BR_9; // Reset PC9 GPIOC->BSRR = GPIO_BSRR_BS_8; // Reset PC8 }

Assignment 1 Make the blue LED blink with ~ 2 Hz while the green LED blinks with ~10 Hz.

Assignment 2 So far we have seen how to use outputs. In a similar way inputs can be used. Adapt the project blinky.uvprojx so that: when the blue USER Push button is not pressed, the blue LED blinks with a frequency of ~ 1 Hz. when the blue USER Push button is pressed, the blue LED blinks with a frequency of ~ 10 Hz. Tips: The features of the STM32F0DISCOVERY board are described in the User Manual UM1525, which can be found on the STM32F0DISCOVERY website. In paragraph 4.9 is described which I/O pin is connected to the blue USER Push button. Remember to also enable this I/O pin’s peripheral clock!

Assignment 3 Use a breadboard and connect eight LED’s to PC0 to PC7. Implement a LED chaser that changes direction when pressing the blue USER Push button.