No video

Getting Started with STM32 and Nucleo Part 5: How to Use SPI | Digi-Key Electronics

  Рет қаралды 134,449

DigiKey

DigiKey

Күн бұрын

Пікірлер: 60
@4BohrKid
@4BohrKid Жыл бұрын
Shawn will absolutely go down in the history books.
@sumeetbhanjadeo5994
@sumeetbhanjadeo5994 2 жыл бұрын
These are the best tutorials I have ever come across. You are doing a great contribution to the embedded community. Respect🙌
@LOLukeJamieson
@LOLukeJamieson 4 жыл бұрын
Love this series Shawn and digikey. Keep 'em coming!
@yosefgreen4187
@yosefgreen4187 2 жыл бұрын
Thank you for this useful tutorial. Maybe you do another one on Octo-SPI ? Some bookmarks: 1:51 3 lines SPI configuration! 2:53 daisy chain connection 8:41 note that you can use any gpio pin for your chip select line 9:55 full duplex master 10:45 the spi configuration. 12:44 read status register 13:58 wait until WIP bit is cleared 14:59 a way to do the code non-blocking 17:02 using: HAL_SPI_Transmit_IT() 18:38 HAL_SPI_TxCpltCallback()
@AlexEduardoRR
@AlexEduardoRR 3 жыл бұрын
OMG Shawn, I'm just using this now at work, you're a life saver!
@abutaymiyyahlectures
@abutaymiyyahlectures 3 жыл бұрын
what do u work as?
@Dazza_Doo
@Dazza_Doo Жыл бұрын
@@abutaymiyyahlectures mad scientist - Great Scott!
@ErikLevholt
@ErikLevholt 3 жыл бұрын
Great video. Good pace and explanations. Alot better than the guides ST offers. As for future videos something showing how to find and include 3rd party libraries would be good. And maybe combine that with a small graphic i2c OLED display to print text?
@antonello988
@antonello988 3 ай бұрын
This is an EXCELLENT video. Bravissimo!
@javibaeza2644
@javibaeza2644 3 жыл бұрын
Wow! I subscribed instantly after I watched your video. It´s amazing how you explain everything and so clear!
@paulrudman1349
@paulrudman1349 4 жыл бұрын
Very helpful, especially because you show us how to print to the serial terminal in debug. Thank you!
@danpommerening3490
@danpommerening3490 2 жыл бұрын
Thanks this helped me! I was able to eventually read a RTC chip in half duplex mode based off this example
@MichaelOldfield-dm2hk
@MichaelOldfield-dm2hk Жыл бұрын
Excellent tutorial. Thanks Shawn
@Auddy_s7395
@Auddy_s7395 8 ай бұрын
My problem is solved form this clip many thanks.
@Bravo_L
@Bravo_L 4 ай бұрын
every dude i know named shawn is a fucking genius
@softelectronicsolutions5327
@softelectronicsolutions5327 3 ай бұрын
informative and simple to use
@michaelallport259
@michaelallport259 2 жыл бұрын
These videos are excellent, thank you!
@jamesgoacher1606
@jamesgoacher1606 4 жыл бұрын
:-D :-D I am really glad you made that a simple explanation :-) :-). Sorry I was reminded of some small book from my past entitled RS232 Made Easy. It was 400 pages thick. Forgive me I need to go over it a few more times. Maybe I will want to use the SPI afterwards, maybe not. I also need to get some previous background material. I do not NEED to do these things od course, I am just curious. Regarding burning an EPROM: I made and partially wrote the program for a 2708 and 2716 eprom and to speed things up we used a more rapid burn cycle followed by a read for each bit, maybe byte untill the received equalled the sent then sent a few more burn cycles to make sure. The overall result was a MUCH shorter burn time. Please don't ask me for details it is 40+ yrs ago and more accomplished people did the majority of the work. I think I have come across the comercial version in my junk now and then. Not something Magpies throw away
@leoUFSJ1
@leoUFSJ1 2 жыл бұрын
Excellent tutorial ! Thanks a lot !
@tegu2850
@tegu2850 10 ай бұрын
Very informative. Thank you.
@alfredorabago5537
@alfredorabago5537 2 жыл бұрын
very nice video, Thanks a lot!!!!! Can you show how to use I2C Slave using interruption or DMA in STM32 (non blocking method)
@JoJoNumbarOne
@JoJoNumbarOne Жыл бұрын
You have better video than stm
@ERVE74
@ERVE74 4 жыл бұрын
Thank you! It is useful!
@ordnanceant2254
@ordnanceant2254 4 жыл бұрын
Very useful again any recommendations on which STM32 nucleo board which can be use with your trading demos / future videos CAN bus hint hint....😬
@RenegadeFury
@RenegadeFury 3 жыл бұрын
Great video thanks a lot. And if you get stuck like me where you keep getting 0 for your status register. Make sure you are using a pointer. e.g uint8_t spi_test2; HAL_SPI_Receive(&hspi1, (uint8_t *)&spi_test2, 1, 100); I forgot the &, and it caused some pain ;p
@mumbaiverve2307
@mumbaiverve2307 3 жыл бұрын
Excellent video ! Thanks much Shawn. Is there any tutorial on the interrupt structure of STM32F103xxx ?
@rajeshn2600
@rajeshn2600 2 жыл бұрын
Thanks for the useful tutorial. I just want to ask, what are the best options for TFT display (of at least 4" size) that I can interface with my STM32F401 Nucleo-64 board? Which interface would be better, SPI or parallel?
@carlosmartins7388
@carlosmartins7388 2 жыл бұрын
Very good.
@rickpercy87
@rickpercy87 4 жыл бұрын
Yes!
@barunbasnet
@barunbasnet 2 жыл бұрын
Please do a video for CAN as well using HAL.
@abutaymiyyahlectures
@abutaymiyyahlectures 3 жыл бұрын
continue from 13:30
@goodwill7643
@goodwill7643 3 жыл бұрын
14:18 - You send command to read data from address 5. How EEPROM chip knows that you're expecting 3 bytes to receive, not 7 or 10? I assume that HAL_SPI_Receive command simply waits for data coming in or it is send some short commands as well to EEPROM? Thank you
@aaronartale
@aaronartale Жыл бұрын
The eeprom will keep sending out bites starting from the address you gave it, as long as you keep the clock pulsing (and keep cs low)
@adaminsanoff
@adaminsanoff 4 жыл бұрын
I do not know why, but STM32CubeIDE 1.3.1 it does not show the baud rate when I select the prescaler.
@DavidTLutz
@DavidTLutz 2 жыл бұрын
Why does Fritzing diagram show 25LC040 but you paste in constants for 25AA040A?
@lockiecresswell4629
@lockiecresswell4629 2 жыл бұрын
I am still confused. How do we use SPI2 and SPI3? How can we use them at the same time as SPI1? All my attempts seem to fail miserably, whereas SPI1 seems easy.
@dajianghe
@dajianghe 3 жыл бұрын
There are random spikes in my CS pin signal during HAL_SPI_Transmit operation. Do you know why?
@markusstaden
@markusstaden 2 жыл бұрын
I get 2 extra clock pulses on my very first transmit, all other transmits are fine. Do you have any idea, why this happens?
@varulven5143
@varulven5143 8 ай бұрын
how to do uart configuration manually? in my ide it doesn't come prepared
@Jake_2903
@Jake_2903 8 ай бұрын
for some reason when I use this code and setup on my g474re using lpuart putty always displays nothing at all
@varulven5143
@varulven5143 8 ай бұрын
i've got the same issue
@Jake_2903
@Jake_2903 8 ай бұрын
@@varulven5143 the baud rate was not set correctly in putty, check in cube MX what tje baud rate is set to and put the same into putty
@MichaelOldfield-dm2hk
@MichaelOldfield-dm2hk Жыл бұрын
Anyone else having problems using HAL_SPI_Transmit() and HAL_SPI_Receive() functions for STM32H753 (HAL version 1.11) ? The combined HAL_SPI_TransmitReceive() function works for me but not the individual ones
@khushwantmaan791
@khushwantmaan791 7 ай бұрын
I want to use it with CRC, even I enabled it and then I'm intentionally writing wrong values but CRCERR flag is not set
@fatihe.1338
@fatihe.1338 3 жыл бұрын
Can you explain how you can send dummy data and get garbage data via "Hal Function " ?
@daninwy2681
@daninwy2681 2 жыл бұрын
How do you get CubeMX to generate the SPI transmit/receive functions? It only generates to init.
@daninwy2681
@daninwy2681 2 жыл бұрын
OK, I'm using the STM32F100RB and the file is: \Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_spi.c and the function to use is: HAL_SPI_TransmitReceive().
@midhunkarthi6038
@midhunkarthi6038 2 жыл бұрын
Can I send and receive data to 2 microcontroller ??
@manojsuryawanshi1334
@manojsuryawanshi1334 Жыл бұрын
i am not able to read more than 256 bytes in externnal spi
@elmirqarayev9586
@elmirqarayev9586 2 жыл бұрын
Can you make a video about Can Bus?
@freddycumana2571
@freddycumana2571 4 жыл бұрын
fine!!!
@bennguyen1313
@bennguyen1313 4 жыл бұрын
Why didn't you set the peripheral to automatically control CSN, instead of manually via GPIO? Is it because the CSN line goes goes tri-state when not in use, so without an external pull-up, the only workaround is to manually disable the hardware NSS and manually control it via a GPIO? And so if you are controlling CSN independently, when 'HAL_SPI_Transmit' returns is guaranteed that the transfer has completely finished, or is it possible that it returns, but the peripheral could still be clocking out data? I've also seem some very strange behavior in CubeMX entering User Labels.. after every entry, the caret seems to jump to the character before!
@minhdang6502
@minhdang6502 4 жыл бұрын
This is my 2 cents answer: 1. The hardware CSN is more for when your MCU in slave mode rather than master mode. Because you would get into scenario that needs to control multiple slaves with one SPI peripherals and obviously one hardware CSN is not enough. 2. The function is a polling function with a time wait arguments. It will returns HAL_OK if the peripherals is successfully transmitted the data and HAL_ERROR or HAL_BUSY otherwise (I think). So using this requires setting time good enough to wait the peripherals transmit the data. In basic scenerio like testing out the peripheral, using HAL_MAX_DELAY would suffice. Otherwise adding a bit of waiting would do too or even better, interrupts :))
@davidrathbone6978
@davidrathbone6978 3 жыл бұрын
Found it I was expecting a GIT link
@davidrathbone6978
@davidrathbone6978 3 жыл бұрын
and the code link is?
@ShawnHymel
@ShawnHymel 3 жыл бұрын
Apologies, as it looks like it's buried. It's labeled as "Related Project Link:" www.digikey.com/en/maker/projects/getting-started-with-stm32-how-to-use-spi/09eab3dfe74c4d0391aaaa99b0a8ee17
@kd4pba
@kd4pba 2 жыл бұрын
LOL here I thought SPI was a simple protocol.
@aaronartale
@aaronartale Жыл бұрын
It's a pain in the ass
@DrKnow65
@DrKnow65 3 жыл бұрын
// Print out bytes read uart_buf_len = sprintf(uart_buf, "0xx 0xx 0xx ", (unsigned int)spi_buf[0], (unsigned int)spi_buf[1], (unsigned int)spi_buf[2]); HAL_UART_Transmit(&huart2, (uint8_t *)uart_buf, uart_buf_len, 100); The code on your website is broken, note the hex value characters. :)
@eos1d3
@eos1d3 2 жыл бұрын
The interrupt version never works because the state machine is wrong. The codes always switch to state 1 and never goes to state 2, 3, 4 and 5. And the plus signs are missing here: for (int i = 0; i < 10; i ) { spi_buf[2 i] = i; } I think the code is never tested.
Чёрная ДЫРА 🕳️ | WICSUR #shorts
00:49
Бискас
Рет қаралды 4,7 МЛН
OMG what happened??😳 filaretiki family✨ #social
01:00
Filaretiki
Рет қаралды 12 МЛН
123 GO! Houseによる偽の舌ドッキリ 😂👅
00:20
123 GO! HOUSE Japanese
Рет қаралды 5 МЛН
SPI: The serial peripheral interface
33:00
Ben Eater
Рет қаралды 677 М.
Understanding SPI
11:50
Rohde Schwarz
Рет қаралды 81 М.
How To Write An STM32 SPI Driver (Full-Duplex Master Mode)
27:32
Z-The-Programmer
Рет қаралды 31 М.
How to Send and Receive 16bit Data with SPI STM32 || STM32CubeIDE ||
5:10
void loop Robotech & Automation
Рет қаралды 593
PROTOCOLS: UART - I2C - SPI - Serial communications #001
11:58
Electronoobs
Рет қаралды 1,4 МЛН
Easy & Powerful Arduino Alternative? STM32 Beginner's Guide
9:49
GreatScott!
Рет қаралды 1 МЛН
STM32 Guide #1: Your first STM32 dev board
12:12
Mitch Davis
Рет қаралды 205 М.
Чёрная ДЫРА 🕳️ | WICSUR #shorts
00:49
Бискас
Рет қаралды 4,7 МЛН