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.
@abdullahaydn266 жыл бұрын
Thanks Tony. It was really nice tutorial. You told everything required.
@BR549DBH9 жыл бұрын
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.
@tdabboud9 жыл бұрын
+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
@BR549DBH9 жыл бұрын
+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?
@MuhsinFatih8 жыл бұрын
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..
@basameera9 жыл бұрын
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.
@tdabboud9 жыл бұрын
+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
@ucanhtrannhan75588 жыл бұрын
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)
@barunastraits97438 жыл бұрын
Thanks, Tony.. this tutorial is very helpful.
@NikiRocky6 жыл бұрын
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!
@BR549DBH10 жыл бұрын
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.
@tdabboud10 жыл бұрын
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.
@BR549DBH10 жыл бұрын
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!
@asavinda19 жыл бұрын
What is the serial to usb converter you were using?
@tdabboud9 жыл бұрын
+asavinda1 I am using a generic CP2102 usb to uart module. I bought a couple from ebay.
@asavinda19 жыл бұрын
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?
@SeverSpanulescu9 жыл бұрын
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 !
@tdabboud9 жыл бұрын
+Sever Spanulescu Good catch. I will modify my code!
@zetaconvex19872 жыл бұрын
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.n40117 жыл бұрын
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
@thtr96478 жыл бұрын
Hi Tony. How can I use ur code through Keil Uvision v5?
@MilanKarakas5 жыл бұрын
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.
@ayasouei32867 жыл бұрын
what is the name of the book you take thois from
9 жыл бұрын
Very good tutororial, it me a lot!
@jonnyreh0018 жыл бұрын
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???
@tonyabboud78108 жыл бұрын
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.
@jonnyreh0018 жыл бұрын
Tony Abboud thanks for answer! so mystery is solved.
@Graham19045 жыл бұрын
Great video but can't see what you are typing as it is not clear.
@malgailany10 жыл бұрын
Interesting and informative video. However, I struggled trying to read the tiny letters on your screen. Thanks.
@tdabboud10 жыл бұрын
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.
@sarthak7615 жыл бұрын
you should start your course for stm32f4 disc1 board. please i request you to do it. ill join
@seedon9 жыл бұрын
send me a link to your wallpaper :)
@tdabboud9 жыл бұрын
seedon dsouza Here you go, vagrantconcept.com/downloads/wallpapers/
@bekirisgor9 жыл бұрын
Hi, i like your thema could you upload or send via mail? Keil\UV4\global.prop. this file