Code Monkey home page Code Monkey logo

peripheral_interrupt's Introduction

header


Peripheral Interruption

The goal of this exercise is to pend a USART3 interrupt and the implement the Interrupt Service Routine (ISR).

Interrupt Set-pending Register (ISPR)

Firstly we need to discover wich bit of ISPR is responsable for indicate a pending interruption from USART3. From the STM32F4xxx - Reference Manual 0090, on table 61, we can extract the information that it's the bit 39 from ISRP. But, on the table 4-2 from Generic User Guide, we can see that exists at all 8 registers composing the ISPR, each one with 32 bits, named from NVIC_ISPR0 to NVIC_ISPR7. On the NVIC_ISPR0 are located the bits 0 to 31. Thus, in the NVIC_ISPR1 are located the next 32 bits, starting from 32 to 63, and this logic continues for the remaining registers. Therefore, the bit 39 of ISPR is mapped to the bit 7 of NVIC_ISPR1. On the code was used the Modulus Operator (%) to calculate position of the bit 39 of ISPR on NVIC_ISPR1 register.

It's important to know that, in a real scenario, the peripehals are responsable to pend their interruptions. So the 34th and 35th lines from main.c would not be needed.

In the following lines, the interruption is porperly enabled, and as result, the ISR function for USART3 will be executed. The name for all ISR functions are predefined on startup_stm32f407vetx.s file.

Exercise from Embedded Systems Programming on ARM Cortex-M3/M4 Processor


peripheral_interrupt's People

Watchers

James Cloos avatar Lyang Medeiros avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.