Тёмный

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

DigiKey
Подписаться 158 тыс.
Просмотров 136 тыс.
50% 1

Опубликовано:

 

6 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 61   
@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!
@danpommerening3490
@danpommerening3490 2 года назад
Thanks this helped me! I was able to eventually read a RTC chip in half duplex mode based off this example
@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?
@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!
@antonello988
@antonello988 4 месяца назад
This is an EXCELLENT video. Bravissimo!
@MichaelOldfield-dm2hk
@MichaelOldfield-dm2hk Год назад
Excellent tutorial. Thanks Shawn
@Auddy_s7395
@Auddy_s7395 8 месяцев назад
My problem is solved form this clip many thanks.
@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)
@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
@michaelallport259
@michaelallport259 2 года назад
These videos are excellent, thank you!
@softelectronicsolutions5327
@softelectronicsolutions5327 3 месяца назад
informative and simple to use
@leoUFSJ1
@leoUFSJ1 2 года назад
Excellent tutorial ! Thanks a lot !
@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
@tegu2850
@tegu2850 11 месяцев назад
Very informative. Thank you.
@Bravo_L
@Bravo_L 4 месяца назад
every dude i know named shawn is a fucking genius
@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
@Jake_2903
@Jake_2903 9 месяцев назад
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
@varulven5143
@varulven5143 9 месяцев назад
how to do uart configuration manually? in my ide it doesn't come prepared
@ERVE74
@ERVE74 4 года назад
Thank you! It is useful!
@barunbasnet
@barunbasnet 2 года назад
Please do a video for CAN as well using HAL.
@ordnanceant
@ordnanceant 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....😬
@mumbaiverve2307
@mumbaiverve2307 3 года назад
Excellent video ! Thanks much Shawn. Is there any tutorial on the interrupt structure of STM32F103xxx ?
@JoJoNumbarOne
@JoJoNumbarOne Год назад
You have better video than stm
@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
@DavidTLutz
@DavidTLutz 2 года назад
Why does Fritzing diagram show 25LC040 but you paste in constants for 25AA040A?
@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?
@rickpercy87
@rickpercy87 4 года назад
Yes!
@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?
@carlosmartins7388
@carlosmartins7388 2 года назад
Very good.
@dajianghe
@dajianghe 3 года назад
There are random spikes in my CS pin signal during HAL_SPI_Transmit operation. Do you know why?
@fatihe.1338
@fatihe.1338 3 года назад
Can you explain how you can send dummy data and get garbage data via "Hal Function " ?
@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.
@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.
@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 ??
@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)
@elmirqarayev9586
@elmirqarayev9586 2 года назад
Can you make a video about Can Bus?
@nagahemachandchinta5498
@nagahemachandchinta5498 3 дня назад
Every time it transmits, does it transmit data to all the slaves one after the another?
@abutaymiyyahlectures
@abutaymiyyahlectures 3 года назад
continue from 13:30
@manojsuryawanshi1334
@manojsuryawanshi1334 Год назад
i am not able to read more than 256 bytes in externnal spi
@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 :))
@freddycumana2571
@freddycumana2571 4 года назад
fine!!!
@davidrathbone6978
@davidrathbone6978 4 года назад
Found it I was expecting a GIT link
@davidrathbone6978
@davidrathbone6978 4 года назад
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
@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. :)
@kd4pba
@kd4pba 2 года назад
LOL here I thought SPI was a simple protocol.
@aaronartale
@aaronartale Год назад
It's a pain in the ass
@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.
Далее
SPI: The serial peripheral interface
33:00
Просмотров 679 тыс.
Friends
00:32
Просмотров 644 тыс.
How to get Spongebob El Primo FOR FREE!
01:36
Просмотров 16 млн
WAY faster than a Raspberry Pi-but is it enough?
17:26
Просмотров 670 тыс.
SPI Hardware & PCB Design - Phil's Lab #134
33:22
Просмотров 27 тыс.