<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://wiki2.arcoslab.org/dokuwiki/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://wiki2.arcoslab.org/dokuwiki/feed.php">
        <title>ArcosWiki teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery</title>
        <description></description>
        <link>https://wiki2.arcoslab.org/dokuwiki/</link>
        <image rdf:resource="https://wiki2.arcoslab.org/dokuwiki/lib/exe/fetch.php?media=favicon.ico" />
       <dc:date>2026-05-14T20:08:45+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:compilador&amp;rev=1663632524&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:conclusiones&amp;rev=1663632524&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:controlador&amp;rev=1663632524&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:interrupt&amp;rev=1663632524&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:introduccion&amp;rev=1663632524&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:makefile&amp;rev=1663632524&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:objectives&amp;rev=1663632524&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:pwm_c&amp;rev=1663632524&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:pwm_h&amp;rev=1663632524&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:referencias&amp;rev=1663632524&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:resultados&amp;rev=1663632524&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:setup&amp;rev=1663632524&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:stm32&amp;rev=1663632524&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://wiki2.arcoslab.org/dokuwiki/lib/exe/fetch.php?media=favicon.ico">
        <title>ArcosWiki</title>
        <link>https://wiki2.arcoslab.org/dokuwiki/</link>
        <url>https://wiki2.arcoslab.org/dokuwiki/lib/exe/fetch.php?media=favicon.ico</url>
    </image>
    <item rdf:about="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:compilador&amp;rev=1663632524&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-09-20T00:08:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:compilador</title>
        <link>https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:compilador&amp;rev=1663632524&amp;do=diff</link>
        <description>Summmon-arm-toolchain, libopencm and stlink

For the stm32f4 we have to do a cross-compilation, the cross-compiler that we used is summon-arm-toolchain.

Installing summon-arm-toolchain

	*  Download it:  
  cd local/src/
  git clone https://github.com/esden/summon-arm-toolchain.git # or --&gt; git clone git://github.com/esden/summon-arm-toolchain.git</description>
    </item>
    <item rdf:about="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:conclusiones&amp;rev=1663632524&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-09-20T00:08:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:conclusiones</title>
        <link>https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:conclusiones&amp;rev=1663632524&amp;do=diff</link>
        <description>Conclusions

	*  We were able to create an open loop speed controller for the BLDC motor, for this we used the libopencm3 firmware library for ARM Cortex-M4 controllers and the ST-LINK  debugger and programmer for the STM32 microcontrollers. 
	*  We used the user&#039;s button of the stm32f4-discovery as the external interruption, so if it is pressed an interruption is activated and it increases or decreases the frequency of the sine wave.</description>
    </item>
    <item rdf:about="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:controlador&amp;rev=1663632524&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-09-20T00:08:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:controlador</title>
        <link>https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:controlador&amp;rev=1663632524&amp;do=diff</link>
        <description>Synchronous Motor

First is important to understand how a synchronous motor works...

A synchronous electric motor is an AC motor in which the rotation of the shaft is synchronized with the frequency of the AC supply current; the rotation period is exactly equal to an integral number of AC cycles. Synchronous motors contain electromagnets on the stator of the motor that create a magnetic field which rotates in time with the oscillations of the line current. The rotor turns in step with this fiel…</description>
    </item>
    <item rdf:about="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:interrupt&amp;rev=1663632524&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-09-20T00:08:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:interrupt</title>
        <link>https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:interrupt&amp;rev=1663632524&amp;do=diff</link>
        <description>Interrupt_handler.c
        void exti0_isr(void)//EXTI, or external interruption function, this one would be called if the interruption was generated by external means, in our case, the User Button
        {
        	exti_reset_request(EXTI0);//resets the EXTI interruption so it can be called again
        	gpio_toggle(GPIOD, GPIO13);//this toggles the orange led on or off upon entering the EXTI interruption 
        	
        if (direction==UP) //this checks if the interruption should increment…</description>
    </item>
    <item rdf:about="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:introduccion&amp;rev=1663632524&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-09-20T00:08:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:introduccion</title>
        <link>https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:introduccion&amp;rev=1663632524&amp;do=diff</link>
        <description>Introduction

This project was proposed thanks to the need of controling a BLDC motor to use it for a quad-copter that is being build in ARCOS-LAB using a new ARM microcontroller, the STM32F4-discovery. This hasn&#039;t been used for this purpose yet, and it has some differences from his predecessor, the stm32f1vl-discovery</description>
    </item>
    <item rdf:about="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:makefile&amp;rev=1663632524&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-09-20T00:08:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:makefile</title>
        <link>https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:makefile&amp;rev=1663632524&amp;do=diff</link>
        <description>Makefile
   ##
   ## This file is part of the libopencm3 project.
   ##
   ## Copyright (C) 2009 Uwe Hermann &lt;uwe@hermann-uwe.de&gt;
   ##
   ## This library is free software: you can redistribute it and/or modify
   ## it under the terms of the GNU Lesser General Public License as published by
   ## the Free Software Foundation, either version 3 of the License, or
   ## (at your option) any later version.
   ##
   ## This library is distributed in the hope that it will be useful,
   ## but WITHOUT…</description>
    </item>
    <item rdf:about="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:objectives&amp;rev=1663632524&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-09-20T00:08:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:objectives</title>
        <link>https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:objectives&amp;rev=1663632524&amp;do=diff</link>
        <description>OBJECTIVES

General Objective

	*  Control the speed of a synchronous motor using the microcontroller stm32f4-discovery. 

Specific Objectives

	*  Generate PWM waves to simulate triphasic waves that are needed by the motor to rotate.
	*  Using the user&#039;s button of the microcontroller increase or decrease the motor speed in a unit yet to be define.</description>
    </item>
    <item rdf:about="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:pwm_c&amp;rev=1663632524&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-09-20T00:08:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:pwm_c</title>
        <link>https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:pwm_c&amp;rev=1663632524&amp;do=diff</link>
        <description>Pwm_6step_experiment.c
    /*
     * This file is part of the libopencm3 project.
     *
     * Copyright (C) 2011 Piotr Esden-Tempski &lt;piotr@esden.net&gt;
     *
     * This library is free software: you can redistribute it and/or modify
     * it under the terms of the GNU Lesser General Public License as published by
     * the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     *
     * This library is distributed in the hope that it wil…</description>
    </item>
    <item rdf:about="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:pwm_h&amp;rev=1663632524&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-09-20T00:08:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:pwm_h</title>
        <link>https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:pwm_h&amp;rev=1663632524&amp;do=diff</link>
        <description>Pwm_6step_experiment.h
 
       #ifndef PWM_6STEP_EXPERIMENT_H
       #define PWM_6STEP_EXPERIMENT_H
       
       #include &lt;libopencm3/stm32/f4/rcc.h&gt;
       #include &lt;libopencm3/stm32/f4/gpio.h&gt;
       #include &lt;libopencm3/stm32/f4/timer.h&gt;
       #include &lt;libopencm3/stm32/nvic.h&gt;
       #include &lt;libopencm3/stm32/exti.h&gt;
       #include &lt;math.h&gt;
       
       #define system_freq 	168000000 			                //168MHz, System Clock frequency  
       #define pwm_freq 		64000				        //64…</description>
    </item>
    <item rdf:about="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:referencias&amp;rev=1663632524&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-09-20T00:08:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:referencias</title>
        <link>https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:referencias&amp;rev=1663632524&amp;do=diff</link>
        <description>References

	*  stm32f4-discovery &lt;http://www.st.com/internet/evalboard/product/252419.jsp&gt;

	*   Reference manual: [here]. Useful pages: Timer 300, Complementary outputs and dead-time 323, 
	*  Datasheet: [here]. Useful pages: Clock diagram 18, Alternate functions 48.

	*  Synchronous motor: &lt;http://en.wikipedia.org/wiki/Synchronous_motor&gt;

	*  PWM: &lt;http://en.wikipedia.org/wiki/Pulse-width_modulation&gt;

INDEX</description>
    </item>
    <item rdf:about="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:resultados&amp;rev=1663632524&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-09-20T00:08:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:resultados</title>
        <link>https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:resultados&amp;rev=1663632524&amp;do=diff</link>
        <description>Results

To show some of the results we have some captures taken from the oscilloscope, so we used a higher frecuency in order to being able to distinguish the duty cycles of the PWM, of course we didin´t use the motor for these, because the rotating speed was higher than the one it can handle, so we only measure the outputs of the microcontroller. The next figure shows the captures:</description>
    </item>
    <item rdf:about="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:setup&amp;rev=1663632524&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-09-20T00:08:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:setup</title>
        <link>https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:setup&amp;rev=1663632524&amp;do=diff</link>
        <description>Set_up.c
    void clock_setup(void) //this sets and starts the global clock on the microcontroller to 168MHz
    {
    	rcc_clock_setup_hse_3v3(&amp;hse_8mhz_3v3[CLOCK_3V3_168MHZ]);	
    }
    
    void gpio_setup(void) // Enable GPIO clock and sets the leds to output push-pull mode
    {
    	/* Enable GPIOC clock. */
    	rcc_peripheral_enable_clock(&amp;RCC_AHB1ENR, RCC_AHB1ENR_IOPDEN);		
    
    	/* Set GPIOs (in GPIO port D) to &#039;output push-pull&#039;. */
    	gpio_mode_setup(GPIOD, GPIO_MODE_OUTPUT,GP…</description>
    </item>
    <item rdf:about="https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:stm32&amp;rev=1663632524&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-09-20T00:08:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:stm32</title>
        <link>https://wiki2.arcoslab.org/dokuwiki/doku.php?id=teaching:ie0117:proyectos:2012:i:final:stm32f4-discovery:stm32&amp;rev=1663632524&amp;do=diff</link>
        <description>Stm32f4-discovery

The STM32F4DISCOVERY helps you to discover the STM32F4 high-performance features and to develop your applications easily. It includes everything required for beginners and experienced users to get started quickly.

Based on the STM32F407VGT6, it includes an ST-LINK/V2 embedded debug tool, two ST MEMS, digital accelerometer and digital microphone, one audio DAC with integrated class D speaker driver, LEDs and push buttons and an USB OTG micro-AB connector.</description>
    </item>
</rdf:RDF>
