STM32 for Arduino - Connecting an RC receiver via input capture mode

preview_player
Показать описание
In this video I'm connecting a 6 channel RC receiver via the input capture mode. As always I will explain some background information about the STM32 timers and registers.

Another important step in creating a STM32 flight controller for quadcopters.

Video 1 - Getting started with the STM32 microcontroller - STM32F103C8T6 via Arduino:

Video 2 - STM32 for Arduino - Connecting a RC receiver should be easy, right?:

Video 3 - Improve your Arduino programming skills - The qualifier volatile explained:

The Arduino STM32 project on GitHub:

I bought the STM32F103C8T6 here:

And also the FTDI programmer:

You can download the Arduino code via this link:

Music:
Рекомендации по теме
Комментарии
Автор

Seriously i have learnt more by following this video than taking some course, you make me love datasheets. These videos are the most information-dense videos ever.

mouli
Автор

Thank You for creating this video series. It's so helpful.
The videos are so well explained but not in the proper queue. It becomes challenging for people like me( _who are new to this_ ) to navigate.

rahuls
Автор

I didn't understand (as i am medical student), but your work is really awesome. Keep it up brother. You are born with extremely high IQ. Apple needs person like you (they don't have any after Steve Jobs).

ng
Автор

First time I m very much confused after watching 3 to 4 times i got the idea.. good video. Keep on posting joop. It may increase my programming skills. Thank you, hope you see new date soon.

Pavana_sai
Автор

Best explanation ever! Thank you so much!

VictorNoelCoryPaz
Автор

can you make a ppm reader tutorial or library? thankyou!

GeorgeInAShed
Автор

Brilliant stuff Joop! You are a real register 'detective' I think :-)
Also nice to point out the fine STM32 work by Roger Clark. Never new of this.
Now to find that STM32 board I bought a few months ago!

philbx
Автор

Hey Joop, I just can't thank you enough for your contributions to community through your videos, you took the YouTube tutorials on embedded systems to next level.
Just want to give a small suggestion, in your new quadcopter flight controller, use one separate stm32 microcontroller for reading the gyro data, and transmitting it to main stm32, as you know there are tons of different IMUs available, and tons of different ways to extract and filter data, so, if a user decides to add a different IMU or modify the code for IMU to add functionalities such as Extended Kalman Filter, they will not have to tweek the main algorithm which will not only reduce the processing load on main processor but will give a lot of room(space) and processing power to users for better customization and flexibility of choosing their own IMUs and things like sensor fusion of other sensors such as Magnetometer.

TanishqIsHere
Автор

In your algorithm to calculate the time duration, there may be two possible cases that make your method fail.
1. The counter has been cleared more than once.
2. The counter has been cleared but the value of the counter is greater than the start value.
I think it would be better if the counter reset flag can be monitored so that such two scenarios cannot happen.

_a_x_s_
Автор

I'm starting to mess around with the stm32 arm microcontroller using the keil mdk and man this video is helpful xD Thanks!

trt
Автор

your videos are very detailed nice work! Just one piece of feedback coming from someone that knows nothing about drones yet and is focused on learning more about the firmware implementation than building it. I have missed videos covering the source code basic functionality. It would be nice to see more videos like your "Altitude hold programming and implementation" video, where you show more code. But also explaining more about the code basics. For example, how the commands from the Remote Control are received, processed and forwarded to the right functions in charge of moving the drone? I actually am trying to find more related videos covering those things but seems like nobody that builds drones seems to cover too much of those subjects, mainly about communication and control with MAVlink and QGroundControl. I couldn't find a single video showing how MAVlink interfaces with the control movements of the drones in the firmware source code. I actually have a more specific taste because I am developing a open source framework that abstracts all communication between PC, Smartphone and embedded devices with embedded devices as well as hardware abstraction layers of the ESP32 and also STM32 cortex M0 and cortex M4, more specifically but portable to any embedded device. Is something far more advanced and wide than both MAVlink and QGroundControl and all other solutions together but I am trying to understand more about MAVlink and QGroundControl and drones as my framework will solve the same problems that those projects solve. I want to make sure that my framework will be at least much easier to use for developers than those solutions that are already in the market. So I am trying to understand how they interface with the embedded system to make sure my solution will be able better cover those integrations. Is a very generic framework, it covers basically everything, from drones and drone swarms - that not only can be unmanned but also talk and interact to each other or even control each other as the protocol allows - to smart factories and IoT devices, all through Ethernet, Wifi, Wireless radio mesh or RS485. To ensure it is going to be generic for drones I need to better understand the existing solutions for controlling and monitoring manned and unmanned flights and better understand drone users, that's why I decided to write this crazy long text to you. Maybe you will be able to give me some kind of feedback also and help me to understand drone users and developers. In my case I also started building my own drone, very low cost (and small) with an STM32F030C8T6 but I was making the firmware from scratch, all coded by me, so stopped on PWM the motors and communication protocol a long time ago due to lack of time to work on this project. Just made it lift and stopped there, something pretty simple as I was just testing the also generic board I developed for the STM32F030C8T6 MCU at that time.

WillianMai
Автор

Hi, Joop, in this tutorial your explaining very good the PWM, but for your latest project YMFC32 autonomous you 're using the PPM solution.
In that program, I don't find where the signal detection mode changes from rising edge, to falling edge.

That "change" command is well present, but as a comment ...

hierryh
Автор

hi, could you link the datasheet please, the only STM32F103C8T6 datasheet i can find is different to the one you show here. Thanks for the amazing videos

johns
Автор

Hi, Very Nice explanation. I have utilised this Concept for the Measurement of the Pulse Width & Frequency. It works fine. But at low Frequency I need to change the Pre scalar Value . How to do this ?? Thanks in advance .
Ravi

ravirao
Автор

Really cool way to explain an elegant solution. Thank you very much!

omarroldan
Автор

I hope that this comment/question finds you well. I am going to be using your videos to build my own quadcopter, and 2 of my children will be building with me. I saw your video about why you are using the STM32F103C8T6 vs. an Arduino Uno, as the STM32 is faster. I found a faster unit and it's by Adafruit called Metro M4 and it uses the ATSAMD51J19 Chip, which is 120MHz vs the 72MHz -- I am having a hard time finding the Timer addressing. Do I want the TC or the TCC? Could you give me a general idea on how I would go about addressing properly for the program?

payne
Автор

On this receiver you showed the rising edge is the same for all. I'd make the code interrupt for one channel going high and then switch to interrupts for all channels going low. But your code is more flexible, it will work for the non-aligned rises on the other receiver. It is a more generic handler.

markramsell
Автор

Joop, I made an error in my sketch, I'm sorry. I love your effort in this. You have taught me a lot. Thanks again!

ajbeal
Автор

Hi mate. Big JB fan here from Argentina, watched all your videos (many many times) and used your code on several projects. There's a very nice plane that flies on your PID code, I should upload a video about it soon.
In regards to this particular vide for the capture interrupt, I'm noticing that the code you finally used on the source files does not match the video. Actually, in the handler_channel_1 source code I noticed that you don't change between raising and falling edges... but it works! So... why does it still work? I'm trying to adapt your code to a STM32F401 but can't figure it out. Any help will be much appreciated. Thanks,

bigbernie
Автор

@Joop Brokking, big fan btw, I am building a rocket and would like to self land it using jets and elevons, but I very little experience with self balancing, gps, etc. Where should I start? Do you have a tutorial that shows how to self pilot a drone?

ernestosaboia
join shbcf.ru