STM32F4 Dev. | #3 - USART with IRQ

  Рет қаралды 18,572

Tony Abboud

Tony Abboud

Күн бұрын

Пікірлер: 43
@kid-vf4lu
@kid-vf4lu 7 жыл бұрын
One of the best STM32F4 tutorials I have seen
@Quiggers1981
@Quiggers1981 9 жыл бұрын
Thank you for a proper tutorial, well recorded, well structured. I was trying to use ST's HAL library to setup an STM32F0 to do this. Your tutorial has answered many of my questions.
@abdullahaydn26
@abdullahaydn26 6 жыл бұрын
Thanks Tony. It was really nice tutorial. You told everything required.
@BR549DBH
@BR549DBH 9 жыл бұрын
Hey Tony, I have a question for you. I have been studying up on interrupt configuration. I noticed in your set up of the NVIC procedure you didn't add NVIC_PriorityGroupConfig(NVIC_PriorityGroup_x) where x is the number of the priority group. I saw in a usart.c or .h file it makes a default of NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2). But you didn't include the library that defaults it. In my research it is hit or miss if a priority group is added or not. So you have any idea where in the world to find the rules on NVIC Priority groups.
@tdabboud
@tdabboud 9 жыл бұрын
+Robert Thomas I did not set the priority group for this example because I am only using 1 interrupt. The default setting for the priority grouping is actually NVIC_PriorityGroup_0, so it get's set regardless. You can find this in the cmsis/include/core_cm4.h file. They don't really mention this in the documentation, but the ARM info center has a good depiction of the NVIC AIRCR register, which is used to set the priority grouping. infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0553a/Cihehdge.html
@BR549DBH
@BR549DBH 9 жыл бұрын
+Tony Abboud hey thanks. I found it a few days ago. I read two places it was PriortiyGroup 2. I. Finally found it in the library. Sorry I for got to let you know. FYI: Feel like some ISP tutorial by any chance?
@MuhsinFatih
@MuhsinFatih 8 жыл бұрын
What determines which pin is rx and which pin is tx here? Just curious, lets say I want to swap the pins
9 жыл бұрын
what did you clock configuration ? Codes are working. Building is succesfull but, Meaningless characters viewing in the Terminal Program..
@basameera
@basameera 9 жыл бұрын
in this program, the IRQ handler directly transmit the data it received. Is there a way to get the received data string out to the main program to use for other purposes.
@tdabboud
@tdabboud 9 жыл бұрын
+Sameera Sandaruwan Sorry for the late reply. Yes there is a way to do what you ask, and there are a few ways to go about it. One way would be to use an extern variable. Declare the variable in the source of your main program, then in the IRQ source declare the variable again using the extern keyword. Then when you place the data into this variable, your main source code would be able to access this
@ucanhtrannhan7558
@ucanhtrannhan7558 8 жыл бұрын
What if i want to usr the USARTPuts function to print an interger something else than a string like printf() function does e.g USARTPuts(USART1, "%d" , number)
@barunastraits9743
@barunastraits9743 8 жыл бұрын
Thanks, Tony.. this tutorial is very helpful.
@NikiRocky
@NikiRocky 6 жыл бұрын
When I try to compile a code I get Error at "USART_puts(USART2, "Test");" : *error: invalid conversion from 'const char*' to 'volatile char*' [-fpermissive]* What is wrong? Why its working by author? Thanks!
@BR549DBH
@BR549DBH 10 жыл бұрын
I have 2 questions. First, when you add a function to stm32f4xx_it.c like, void(USART2_IRQHandler(void). Do you need to declare it in stm32f4xx_it.h? Second, I have tried to get the USART2_IRQHandler() function to pass its data to main.c. I'm not getting it to work. Can you help me please.
@tdabboud
@tdabboud 10 жыл бұрын
1. You do not need to declare the function in the header file for it to work, but it is good practice to do so. 2. In order to "pass" the data from the IRQ, you need to declare the variables inside your main header file, then define them as extern in your IRQ source file. It is also a good idea to declare them as volatile, since they can be changed inside the interrupt. Or you can simply define a function, as I did, declare it as extern in the IRQ source code, and use that to do the processing in main.
@BR549DBH
@BR549DBH 10 жыл бұрын
Tony, I got it to work. I have a small bug, in the very first button press. It takes two or three clicks of the mouse to get it to start. Then it is fine after that. I going to post a tutorial on KZbin and I will be giving you and two others credit. Hopefully this will point people your way. My biggest problem is,"I'm green to programming." I used to be an electronic tech. Now I am a fire fighter and I have a home repair business, (Dr. Brokenhouse). I am really enjoying this. I would like to see you do a tutorial in detail of PWM and how to controll a small servo or 10. Thanks!
@asavinda1
@asavinda1 9 жыл бұрын
What is the serial to usb converter you were using?
@tdabboud
@tdabboud 9 жыл бұрын
+asavinda1 I am using a generic CP2102 usb to uart module. I bought a couple from ebay.
@asavinda1
@asavinda1 9 жыл бұрын
Thank you very much and your tutorial was very helpful. May I know how stm32f4x_it can be added to a project and is it all necessary to add it?
@SeverSpanulescu
@SeverSpanulescu 9 жыл бұрын
I could notice 4 of the 5 mistakes in the main part before compiling, but I missed the capital letter one :). Maybe because I did not use to set the length, as 8 bits is default. You may try to eliminate this, it works. However, I never knew why is the handshaking mandatory when using API. Anyway, good explaining !
@tdabboud
@tdabboud 9 жыл бұрын
+Sever Spanulescu Good catch. I will modify my code!
@zetaconvex1987
@zetaconvex1987 2 жыл бұрын
It's not a good idea to write 10 chars at a time from the interrupt, as you're blocking the whole time you're writing. I did a test where I transmit after receiving, to produce an echo. It works OK when you type stuff in at the keyboard, but I noticed that there were occasional errors when I tried to stress the UART programmatically. I wasn't able to resolve what the problem was.
@rakshith.m.n4011
@rakshith.m.n4011 7 жыл бұрын
I'm using STM32F429i discovery board and had implemented the above code but even after changing the PLL_M value to 8 and HSE value to 8MHz usart2 is not working. when i run the program ,coolterm is getting disconnected and showing break condition error 103. can you please suggest some remedy for this problem
@thtr9647
@thtr9647 8 жыл бұрын
Hi Tony. How can I use ur code through Keil Uvision v5?
@MilanKarakas
@MilanKarakas 5 жыл бұрын
Well, once get into direct addressing, it is painful to go to other way of programming. So confusing. I like to type exactly as is in reference manual for certain chip. If one day I want to change chip, but the same company (STM), then all register names are similar, just structure may be slightly different.
@ayasouei3286
@ayasouei3286 7 жыл бұрын
what is the name of the book you take thois from
9 жыл бұрын
Very good tutororial, it me a lot!
@jonnyreh001
@jonnyreh001 8 жыл бұрын
I am wondering that it is actually working. Because you do *str++; that means content of str increment by 1 ... that will change the first letter in the first byte by one in ASCI isnt it???
@tonyabboud7810
@tonyabboud7810 8 жыл бұрын
Thats not true. The *str++, will increment the str address, and then return the value that str was pointing to before incrementing. This is all about the operator precedence. Since we are not using the value of what str points to in that line, we could change it to just str++, since we only really care about incrementing the address.
@jonnyreh001
@jonnyreh001 8 жыл бұрын
Tony Abboud thanks for answer! so mystery is solved.
@Graham1904
@Graham1904 5 жыл бұрын
Great video but can't see what you are typing as it is not clear.
@malgailany
@malgailany 10 жыл бұрын
Interesting and informative video. However, I struggled trying to read the tiny letters on your screen. Thanks.
@tdabboud
@tdabboud 10 жыл бұрын
I'm glad you liked it. I agree, it is hard to read the code, which is why I have since changed the way I record these videos and also increased the font size on my editor. My recent video on PWM will showcase the new style, which is hopefully better to see. I also link every video to my Github so you can always get the code then follow along.
@sarthak761
@sarthak761 5 жыл бұрын
you should start your course for stm32f4 disc1 board. please i request you to do it. ill join
@seedon
@seedon 9 жыл бұрын
send me a link to your wallpaper :)
@tdabboud
@tdabboud 9 жыл бұрын
seedon dsouza Here you go, vagrantconcept.com/downloads/wallpapers/
@bekirisgor
@bekirisgor 9 жыл бұрын
Hi, i like your thema could you upload or send via mail? Keil\UV4\global.prop. this file
STM32F4 Dev. | #4 - EXTI with Pushbutton
20:01
Tony Abboud
Рет қаралды 8 М.
Serial UART with STM32 Microcontroller-Transmit and Receive Data
18:44
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
I Made The Ultimate Cheating Device
9:39
ChromaLock
Рет қаралды 1,9 МЛН
The RS-232 protocol
26:10
Ben Eater
Рет қаралды 871 М.
What is the Smallest Possible .EXE?
17:04
Inkbox
Рет қаралды 595 М.
STM32 Guide #2: Registers + HAL (Blink example)
30:02
Mitch Davis
Рет қаралды 220 М.
The Perfect Dependency - SQLite Case Study
19:32
Tom Delalande
Рет қаралды 104 М.
Визитка программиста
19:40
Александр Красников
Рет қаралды 241 М.
I made maps that show time instead of space
10:44
Václav Volhejn
Рет қаралды 1,3 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН