Very educational and straigh-forward video! Learning basics with register handling seems to be easier than prepacked functions from ST, at least you know whats going on in the background...
@wegi96215 жыл бұрын
Eddie is back :] Even show the Startup.S file !
@Synthetech5 жыл бұрын
Great vids! A few topics I would like to see: 1. Read/Write to SPI flash external memory like W25Q32FVSIG chips. 2. Use SPI LCD displays like the cheap 1.8 color panels with ILI9163 or ST7735 driver chips.
@EdwinFairchild5 жыл бұрын
that is very specific, i should set up a patreon for requests. but im too busy lately to make any more videos. maybe next week or the week after that ill make something but definitely not that specific where i have to spend money and order those parts.
@Synthetech5 жыл бұрын
@@EdwinFairchild I have a batch of 10 of the W25Q32 chips that should be here in a week. I could mount one on a breakout board and send it to you if you are interested in tinkering with one. It's a 4MB SPI flash chip.
@EdwinFairchild5 жыл бұрын
@@Synthetech that sounds like fun! Im down for that.
@Synthetech5 жыл бұрын
@@EdwinFairchild OK. I'll get back with you when they arrive..
@Synthetech5 жыл бұрын
@@EdwinFairchild Got the chips from China today. They are clones/fakes! They may work, but I'm forcing a return right now before I solder anything.. most likely they will have to refund and leave them with me.
@andygyakobo71225 жыл бұрын
Man you the best! Please stay motivated making videos! And could you please note your email...
@Bestcuriosity_13 жыл бұрын
sir , what is code size compared to HAL
@EdwinFairchild3 жыл бұрын
i answer it there www.edwinfairchild.com/
@mustafaserhatbeyazay391211 ай бұрын
Hi Eddie thanks for video, I am curious what if i use timer interrupt for falling edge detection and while program runs uart interrupt, edge detection interrupt should come is it cause a problem should we set interrupt periority in that kind of application.
@MilanKarakas5 жыл бұрын
Can you type '{' symbol in Attolic TrueStudio? I installed latest version 9.3.0 but the same thing as previous - unable to type { .
@EdwinFairchild5 жыл бұрын
I have 9.2 version and all keys work fine..
@EdwinFairchild5 жыл бұрын
maybe something to do with keyboard language settings in truestudio i dont know...
@MilanKarakas5 жыл бұрын
@@EdwinFairchild Hmmm... probably Croatian keyboard. Funny thing is that I can type { in their search window and everywhere else, but not in main edit window. Copy/paste of this symbol is possible, but out of question. Thanks anyway.
@MilanKarakas5 жыл бұрын
@@EdwinFairchild Oh, darn! If I switch to EN US keyboard, then it is under letter Đ and other one Ž. Then... if they does not support that keyboard, how I can manage to type it. Learn new keyboard? That is why nobody answers me on their forum. On Croatian keyboard, { is Ctrl+b, so all Ctrl things are probably blocked. Strange. I will continue working in Keil. At least it supports my keyboard.
@EdwinFairchild5 жыл бұрын
@@MilanKarakas have you checked out your keyboard layout in windows settings? maybe its not in english... also on my windows 10 , if i press CTRL + SHIFT i changes my layout for some reason ,this is annoying sometimes
@НиколайКрасиков-ы8й4 жыл бұрын
Why did I replace keil with atollic? Is there a cubemx makefile Converter in Cmake? Share a link pliz if someone knows :)
@EdwinFairchild4 жыл бұрын
I use Keil, Attolic , VisualGDB etc.... But I think Keil and VisualGDB are the best. But Keil is not free and debug code size is limited for most STM32 products except a few. VisualGDB license is only $99 and paired with Visual Studio Community it is a thing of beauty. I will make a video about it soon. As far as CubeMx converter I have no idea, I do not use cube generated code. Sorry.
@niratasatya73154 жыл бұрын
How to store the received data when using interrupt routine
@EdwinFairchild4 жыл бұрын
how to store??? Umm save it in a variable :)
@niratasatya73154 жыл бұрын
@@EdwinFairchild suppose I want to do some thing with received data in main function ; as usart1_irqhandler is a void function ,so how could I get it .
@EdwinFairchild4 жыл бұрын
@@niratasatya7315 pointers will be your friends. And yeah the handler functions don't return anything ever because they are not "called" by anything so who would it return to? Instead the cpu jumps to a given address where it expects the fucntions to be at and and does not handling of returning anything. So yes pointers will be your friend or global variable etc...
@MilanKarakas5 жыл бұрын
Bought new keyboard with ENG layout, and TrueStudio still does not work. How it is even possible to get anything done? Can't find flash tool for ST-Link...
@EdwinFairchild5 жыл бұрын
ill make a quick video tonight on how to set up the st-link . As far as the keyboard issue goes i dont know, did you change the keyboard language on windows settings, its not enough to just change they keyboard
@MilanKarakas5 жыл бұрын
@@EdwinFairchild Thank you very much in advance. The problem with TrueStudio that everything is non/standard. Almost every program uses Ctrl+C and Ctrl+V for copy/paste option, but only Atollic TS uses something else (I think Ctrl+y and Ctrl+W or something similar) for copy/paste. Yes, I did change keyboard layout(s), so now I have ENG and HRV (CRO) layouts. BTW, did you got working I2C on your STM32?
@EdwinFairchild5 жыл бұрын
@@MilanKarakas Maybe your version of atollic is like that, my version has normal ctrl+c and cntrl_v for copy and paste. Igot the i2c working for STM32L0 I gave up on the STM32F1 i2c. Keep getting weird behavior.
@MilanKarakas5 жыл бұрын
@@EdwinFairchild I have latest version 9.3.0. Okay, I will get it working one day. Just need help setting ST-Link. That part is weird. It is strange how some MCU from the same company has okay I2C, some not. Many people complains about I2C on STM32, but not only f103, but others as well. Thank you for help.
@warrenbuckley32673 жыл бұрын
A part 4 could have been combining interrupts with DMA. Thanks for the content
@EdwinFairchild3 жыл бұрын
DMA and interrupts are sort of a weird combination , because DMA is great when you don't want to be interrupted. The only interrupt would be DMA transfer complete . But I have DMA tutorials which should give insight on how to do it for UART .
@pranjalbhagat6675 жыл бұрын
It is not working. My code in while(1) is not working. Interrupt received function was working. But after initialize they interrupt my code not run.
@EdwinFairchild5 жыл бұрын
Start a debug session and find out why . I cannot see your code so idk. Are you using the same chip ?
@cemaldagl1582 жыл бұрын
USART1->CR1 |= USART_CR1_RXNEIE; Just use like this, I have no idea why tx is always interrupting. Maybe try to clear TC bit in the USART_DR.
@ivanrob3924 жыл бұрын
Eddie, how can one verify that the microcontroller is running at a certain speed? For example, if I have a MCU that can run at 100 MHz and I do the config that is needed for the, is there a way to verify the MCU is actually running at that speed? Thanks
@EdwinFairchild4 жыл бұрын
Yes check the "SystemCoreClock" variable . But first call the fun riob UpdateSystemCoreClock or something like that ... CMSIS functions
@ivanrob3924 жыл бұрын
@@EdwinFairchild Where do I check the value of that variable? I found an instance of the same under core_cm4.h I see that by default it's 16MHz. When I run my program to get the clock updated and run the clock update function, the value of that variable is still 16MHz. So I'm not sure if I just messed up and my program is not working oooor if I'm just reading it the wrong way. Thanks!
@EdwinFairchild4 жыл бұрын
@@ivanrob392 you can do anything to check the variable , print it, or add it to variable watch etc... if you call the update function and the variable is still 16mhz then you didnt change the clock properly
@EdwinFairchild4 жыл бұрын
@@ivanrob392 check my blog for some code sample www.edwinfairchild.com/2020/03/changing-clock-frequency-f1-via.html
@ivanrob3924 жыл бұрын
@@EdwinFairchild Hey man. I think I was able to make it c:. I started experimenting a little with Keil's debugger and I saw the system core clock variable changing to 100 MHz. Stmf32f411's are a bit different, but without your code I would not have been able to make it. Once again, thank you very much
@aleksandrkozlov92865 жыл бұрын
Thanks bro!
@ryansy17414 жыл бұрын
Nice tutorial. How do you use UART interrupt to connnect 2 STM32 MCUs. Enabling output of MCU1 using the input of MCU2 and vice-versa. I tried doing it based on your tutorial. It works for a single input/output. However for multiple inputs/outputs it never worked. Do you know how to do this?
@EdwinFairchild4 жыл бұрын
Explain a little more what you mean ? If it works for one output why do you need more is the part I don't understand... ?
@ryansy17414 жыл бұрын
@@EdwinFairchild sorry I did not clearly explain this. Basically I have 2 STM32 MCUs connected through UART. A button on MCU1 will trigger an output on MCU2 and vice versa. Initially I tried a single button from MCU1 which drives a single output in MCU2 and this is OK. However when I added another button2 to MCU1 I could no longer transmit data from Button2 to MCU2. Here's my code for the Transmit MCU1: USART2 -> CR1 |= USART_CR1_UE; USART2 -> CR1 |= USART_CR1_TE; USART2 -> CR1 |= USART_CR1_RE; USART2 -> CR1 |= USART_CR1_RXNEIE; USART2 -> CR1 |= USART_CR1_TXEIE; NVIC_EnableIRQ(USART2_IRQn); . . . void USART2_IRQHandler(void) { HAL_UART_IRQHandler(&huart2); //this is the first transmit code for button1 which is successfully transmitted to MCU2 if(USART2 -> SR & USART_SR_TXE) { { if(!HAL_GPIO_ReadPin(BUTTON1_GPIO_Port, BUTTON1_Pin)) { //transmit this data to MCU2 USART2 -> DR = 0xFF; } else { //transmit this data to MCU2 USART2 -> DR = 0x00; } } } //this is the second transmit code for button2 but this never gets transmitted to MCU2 if(USART2 -> SR & USART_SR_TXE) { { if(HAL_GPIO_ReadPin(BUTTON2_GPIO_Port, BUTTON2_Pin)) { //transmit this data to MCU2 USART2 -> DR = 0xF0; } else { //transmit this data to MCU2 USART2 -> DR = 0x0F; } } } //this is the first receive code from MCU2 and successfully transmitted to MCU1 if(USART2 -> SR & USART_SR_RXNE) { { if(USART2 -> DR == 0xE3) { //enable output HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_SET); } else if(USART2 -> DR == 0x1C) { //disable output HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET); } } } //this is the second receive code from MCU2 but unsuccessfully transmitted to MCU1 if(USART2 -> SR & USART_SR_RXNE) { { if(USART2 -> DR == 0xCC) { HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_SET); } else if(USART2 -> DR == 0x33) { HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_RESET); } } } }
@imwhateverim91873 жыл бұрын
How can I get to IRQ interrupt when I want to send data. And When the USART_CR1_TXEIE flag is enabled, I cannot use the output ports. Can someone help me?
@cemaldagl1582 жыл бұрын
USART1->CR1 |= USART_CR1_RXNEIE; Just use like this, I have no idea why tx is always interrupting. Maybe try to clear TC bit in the USART_DR.
@imwhateverim91872 жыл бұрын
@@cemaldagl158 Reis yıllar sonra döndüğün için sağol :) Bunu çözdüm o zaman ama spı sıkınyılıydı.