Asst. Prof. Dr. Alper ŞİŞMAN

Slides:



Advertisements
Similar presentations
Chapter 6 General Purpose Input/Output
Advertisements

Khaled A. Al-Utaibi Interfacing an LED The Light Emitting Diode (LED) Applications DC Characteristics & Operation Interfacing to.
Button Input: On/off state change Living with the Lab Gerald Recktenwald Portland State University
Getting the O in I/O to work on a typical microcontroller Activating a FLASH memory “output line” Part 1 Main part of Laboratory 1 Also needed for “voice.
Press any key to continue by Marc Ruocco 1 High-Speed Interfaces: FPDP and RACEway RACE, RACEway and RACE++ are trademarks of Mercury Computer Systems,
Asst. Prof. Dr. Alper SISMAN
OUTPUT INTERFACE – Microprocessor Asst. Prof. Dr. Choopan Rattanapoka and Asst. Prof. Dr. Suphot Chunwiphat.
Chung-Ta King National Tsing Hua University
C Examples 1.
Mark Neil - Microprocessor Course 1 Decoding and Using a 4x4 Keyboard.
Refer to Chapter 6, 9 in the reference book
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.
Getting the O in I/O to work on a typical microcontroller Activating a FLASH memory “output line” Part 1 Main part of Laboratory 1 Also needed for “voice.
Multiplexed External Bus Interface-MEBIV3 By: Prof. Mahendra B. Salunke Asst. Prof., Department of Computer Engg., SITS, Pune-41
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
1 ARM University Program Copyright © ARM Ltd 2013 General Purpose I/O.
F.F. - 18/07/ User Guide of the Input Trigger Multiplexer unit with input signal rate counters.
The miniDragon+ Board and CodeWarrior Lecture L2.1.
1 ARM University Program Copyright © ARM Ltd 2013 General Purpose I/O.
ECS642U Embedded Systems Digital I/O William Marsh.
1 LHO 13 The 8051CF020 and the University Daughter Card.
1 General Purpose and Alternate Function I/O (GPIO and AFIO)
ECS642U Embedded Systems Cyclic Execution and Polling William Marsh.
Embedded Network Interface (ENI). What is ENI? Embedded Network Interface Originally called DPO (Digital Product Option) card Printer without network.
7/23 Coldfire 5211 Signals and IO Multiplexing Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee
Automatic accident avoiding system PROJECT MEMBERS MUTHUKUMAR.K (05ME33) SAKTHIDHASAN.S (05ME39) SAKTHIVEL.N (05ME40) VINOTH.S (05ME56) PROJECT GUIDE:
7 - 1 Texas Instruments Incorporated Module 7 : Serial Peripheral Interface C28x 32-Bit-Digital Signal Controller TMS320F2812.
Input Interface – Microprocessor
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.
EE365 - Microprocessors period 26 10/23/00 D. R. Schertz # Parallel Ports.
C Examples 1. Download Links dsPIC30F4011/4012 Data Sheet dsPIC30F4013/3014 dsPIC30F Family Reference Manual MikroC MikroC Manual MikroC Quick Reference.
Lecture 4 General-Purpose Input/Output NCHUEE 720A Lab Prof. Jichiang Tsai.
Arduino libraries Datatekniker Udvidet hardware/software.
NET+OS 6.1 Training. GPIO APIs NET+OS 6.1 Signal Multiplexing System tradeoffs affecting pin count at design-time. –NS9750 unit cost reduced by conserving.
Mark Neil - Microprocessor Course 1 Decoding and Using a 4x4 Keyboard.
Introduction to the DE0 Board Prof. Taeweon Suh Computer Science & Engineering Korea University COSE221, COMP211 Computer Logic Design.
Memory Organisation & Modes of Operations By: Prof. Mahendra B. Salunke Asst. Prof., Department of Computer Engg, SITS, Pune-41
ARM Embedded Programming Lecture 4 Accessing Memory Mapped Registers.
STM32F107VC Datablad Reference manual Schematics.pdf.
Team 7 Chaofan Chen Dhruvmin Gandhi Larry Gerhardt Pulse-width Modulation with the TIVA C.
PRJ2: ESP2-UC workshop 1 Introductie 1.
8255 Programmable Peripheral Interface
Outline Introduction to NuMaker TRIO Programming environment setup
CS4101 嵌入式系統概論 General Purpose IO
4-Integrating Peripherals in Embedded Systems (cont.)
TI ARM I/O Programming Chapter 2
Chapter 6 General Purpose Input/Output
CS4101 Introduction to Embedded Systems Lab 1: General Purpose IO
Lesson Outline Peripherals Memory-Mapped IO Ports GPIO Multiplexing
PRJ2UC: Microcontrollers
Refer to Chapter 10 in the reference book
COMP211 Computer Logic Design Introduction to the DE2 Board
NS Training Hardware.
CS4101 嵌入式系統概論 General Purpose IO
MDIO & PHY on AMIC110 April 27, 2017 Garrett Ding.
Blinking an LED Using MSP430ware to Control GPIO
How to avoid catching things on fire.
The Arduino Microcontroller: Atmel AVR Atmega 328
Chapter 2 Push button and Potentiometer
STM Arm I/O Programming
Architectural Features
AT91 Memory Interface This training module describes the External Bus Interface (EBI), which generatesthe signals that control the access to the external.
A register design with parallel load input
8051 Micro Controller.
Lab 1. Introduction to the DE2 Board
CHAPTER HARDWARE CONNECTION.
CS4101 Introduction to Embedded Systems Lab 2: Basic IO and Timer
XC9500 Architectural Features
Decoding and Using a 4x4 Keyboard
Presentation transcript:

Asst. Prof. Dr. Alper ŞİŞMAN Practice 2 Asst. Prof. Dr. Alper ŞİŞMAN

GPIO Module Output states: push-pull or open drain + pull-up/down Output data from output data register (GPIOx_ODR) or peripheral (alternate function output) Speed selection for each I/O Input states: floating, pull-up/down, analog Input data to input data register (GPIOx_IDR) or peripheral (alternate function input) Bit set and reset register (GPIOx_BSRR) for bitwise write access to GPIOx_ODR

Locking mechanism (GPIOx_LCKR) provided to freeze the I/O configuration Analog function Alternate function input/output selection registers (at most 16 AFs per I/O) Fast toggle capable of changing every two clock cycles Highly flexible pin multiplexing allows the use of I/O pins as GPIOs or as one of several peripheral functions During and just after reset, the alternate functions are not active and the I/O ports are configured in input floating mode.

The configuration steps of GPIO pin The clock signal of corresponding GPIO HW must be activated: RCC->AHB1ENR: Reset&Clock control reg.->AHB1 enable register. The pins must be defined as input or output GPIOD->MODER: Mode register 32-bit for 16 pins:

The output type must be configured GPIOD=>OTYPER: The output speed must be configured GPIOD=>OSPEEDR: 32 bit register for 16 pins.

The pull up resistor configuration mus be set GPIOD=>PUPDR: 32 bit reg.16 pins

Read/Write Registers GPIO port input data register: GPIOD=>IDR GPIO port output data reg.:GPIOD=>ODR GPIO port bit set/reset reg.: GPIOD=>BSRR

Other GPIO Registers GPIO port configuration lock reg. GPIO alternate function low reg. GPIO alternate function high reg. Further information can be seen on page 278. (ref manual RM0090)

Blinking LED #include "STM32F4xx.h” void SystemInit() { Run in DEBUG mode step by step and see four LED in on and off. #include "STM32F4xx.h” void SystemInit() { (*((int*)0xE000ED88))|=0x0F00000; // Floating Point donanimini aktiflestir. RCC->AHB1ENR |= 0x00000008; // GPIOD donaniminin clock sinyalini uygulayalim GPIOD->MODER = 0x55000000; // GPIOD nin 15, 14, 13, 12 pinleri cikis tanimlandi (Ledler bu pinlerde) GPIOD->OSPEEDR= 0xFFFFFFFF; // GPIOD nin tum cikislari en yuksek hizda kullanacagiz }

int main() { while(1) GPIOD->ODR= 0x0000F000; // Ledler yansin GPIOD->ODR= 0x00000000; // Ledler sonsun }

Add a delay subrotine void delayy(){ int delay0 = 0x000FFFFF; while (delay0--){ }

Call delayy from main int main() { while(1) GPIOD->ODR= 0x0000F000; // Ledler yansin delayy(); GPIOD->ODR= 0x00000000; // Ledler sonsun }

Read Button Activate GPIOA clock Configure A0 as input (it is default), bus speed and no pull up/down void SystemInit() { (*((int*)0xE000ED88))|=0x0F00000; // Floating Point donanimini aktiflestir. RCC->AHB1ENR |= 0x00000009; // GPIOD &A donaniminin clock sinyalini uygulayalim GPIOD->MODER = 0x55000000; // GPIOD nin 15, 14, 13, 12 pinleri cikis tanimlandi (Ledler bu pinlerde) GPIOD->OSPEEDR= 0xFFFFFFFF; // GPIOD nin tum cikislari en yuksek hizda kullanacagiz GPIOA->OSPEEDR= 0xFFFFFFFF; // GPIOA nin tum girisleri en yuksek hizda kullanacagiz GPIOA->PUPDR = 0x00000000; }

Stop blinking When button is pressed the blinking will stop: int main() { while(1) while ((GPIOA->IDR & 0x1) == 0){ } GPIOD->ODR= 0x0000F000; // Ledler yansin delayy(); GPIOD->ODR= 0x00000000; // Ledler sonsun

Define D0 as output&observe it void SystemInit() { (*((int*)0xE000ED88))|=0x0F00000; // Floating Point donanimini aktiflestir. RCC->AHB1ENR |= 0x00000009; // GPIOD &A donaniminin clock sinyalini uygulayalim GPIOD->MODER = 0x55000001; // GPIOD nin 15, 14, 13, 12 ve 0. pinleri cikis tanimlandi (Ledler bu pinlerde+0. pin) GPIOD->OSPEEDR= 0xFFFFFFFF; // GPIOD nin tum cikislari en yuksek hizda kullanacagiz GPIOA->OSPEEDR= 0xFFFFFFFF; // GPIOA nin tum girisleri en yuksek hizda kullanacagiz GPIOA->PUPDR = 0x00000000;}

HW#2 Connect a 7-segment to the STM32F4x board Write a number between 1-9 on the 7-segment When user button is pressed number 0 should be seen on the 7-segment.