Write a UART driver (Polling and Interrupt) | Embedded System Project Series #18

  Рет қаралды 13,775

Artful Bytes

Artful Bytes

Күн бұрын

I explain what UART is and show how I use it to print text from my microcontroller to my desktop computer. I first implement a UART driver based on polling and then improve on it by making it interrupt-driven with a ring buffer. This driver will serve as the foundation for when I implement log tracing (printf) in my next video.
0:00 Goal
0:50 Outline
2:30 What is UART?
4:25 RS232
5:43 Why UART?
6:48 USB-to-UART bridge
8:42 Implement polling driver
10:45 Start, data, parity, stop bits
11:50 New project
15:40 Initialize UART peripheral
20:15 Compile
25:46 UART send function
27:35 Print to terminal
30:15 Interrupt + Ring buffer
36:00 Implement ring buffer
40:40 Implement interrupt driver
49:00 Verify interrupt driver
51:40 Move to robot project
53:15 Commit
#embeddedsystems #cprogramming #microcontroller
🌍 Links related to this video
code - github.com/artfulbytes/nsumo_...
circular buffer - en.wikipedia.org/wiki/Circula...
circular buffer - embeddedartistry.com/blog/201...
datasheet - www.ti.com/lit/ug/slau144k/sl...
🌍 Find me here
GitHub - github.com/artfulbytes
Instagram - / artfulbytescom
Website - www.artfulbytes.com
👨‍💻 About me
Hi and welcome. I'm Niklas, an embedded systems engineer from Sweden. On this channel, I make practical videos about embedded systems or, in general terms, about building and programming hardware.

Пікірлер: 25
@KuraldGalain
@KuraldGalain 9 ай бұрын
Finally some more indepth content with asserts and WITHOUT HAL, thank you!
@olivialinden8699
@olivialinden8699 Жыл бұрын
Great video 👍
@MariusHeier1
@MariusHeier1 Жыл бұрын
Great video. Subscribed! 👊🙂
@alphaomega6023
@alphaomega6023 Жыл бұрын
As a EE student who's trying to get more into the "hobbyist" side of electronics, this channel is gold. Keep it up! There isn't much good content out there about embedded systems on YT.
@artfulbytes
@artfulbytes Жыл бұрын
Great to hear, this video series is software heavy but I plan on also doing more electronics later :)
@ravitejaj473
@ravitejaj473 6 ай бұрын
Thanks for Technical information for future and development.
@raviupadhyay8034
@raviupadhyay8034 11 ай бұрын
Hi This video is very informative and is very much helpful in understanding the concepts .
@michaelnilan7413
@michaelnilan7413 Жыл бұрын
Great stuff. Keep it up!! Thank you for your efforts.
@artfulbytes
@artfulbytes Жыл бұрын
Thanks!
@aryangupta4252
@aryangupta4252 Жыл бұрын
You content it true gold and it must be preserved, but some things are hard to understand, my be one day you will make another series for the absolute beginners who is in transition from an Arduino.
@artfulbytes
@artfulbytes Жыл бұрын
Thank you! I will keep that in mind when I'm done with this video series :)
@ramankumargautam1122
@ramankumargautam1122 Жыл бұрын
Your content is hit, you would definitely be one of the most sought-after channel on embedded system, I would urge you to put more frequent videos and slow down a bit if you could, Thanks for such amazing content
@artfulbytes
@artfulbytes Жыл бұрын
Thanks! When you say slow down, you mean talk slower?
@ramankumargautam1122
@ramankumargautam1122 Жыл бұрын
​@@artfulbytes Thanks for replying, Ya I meant that you can talk a little slow
@NotSionnix
@NotSionnix 25 күн бұрын
Hi, what is the model number of that USB to UART chip you used in the video and would it work on other Texas MCUs like the TIVAC123G?
@artfulbytes
@artfulbytes 21 күн бұрын
CP2102 USB to TTL Converter HW-598, yes it should work on those.
@NotSionnix
@NotSionnix 21 күн бұрын
@@artfulbytes thanks for the reply! I got confused on which converter to buy and I will try this one. Also, do you have any suggestions for alternative motors that would work with your PCB? I've been checking the motors linked in your second video but they've been out of stock for a while now
@BigA1
@BigA1 2 ай бұрын
Do you ever work with PIC microcontrllers? I like what you are doing but I need to get my head around understanding it for PICs.
@artfulbytes
@artfulbytes 2 ай бұрын
I haven't worked with PIC even though it's still heavily used in the industry. From what I've heard, the software ecosystem around PIC is quite bad, so I try to stay away. Anyway, microcontrollers fundamentally work the same way so the workflow I explain here also applies to PICs even if the peripherals and registers obviously are different.
@vabgat1
@vabgat1 5 ай бұрын
JFYI for noobies like me, the Tx pin of MSP430 to be connected to Rx pin of USB-to-UART converter chip.
@artfulbytes
@artfulbytes 4 ай бұрын
Classic
@artfulbytes
@artfulbytes Жыл бұрын
Mistake: ' ' and ' ' should be in opposite order. I fix it in this video: kzbin.info/www/bejne/gWjIeZ6fn5KqhLs.
@quoocshuwng7939
@quoocshuwng7939 11 ай бұрын
What name is microcontroller?
@artfulbytes
@artfulbytes 11 ай бұрын
MSP430G2553, MSP-EXP430G2ET Development kit
Printf on a Microcontroller | Embedded System Project Series #19
38:22
OMG🤪 #tiktok #shorts #potapova_blog
00:50
Potapova_blog
Рет қаралды 18 МЛН
路飞被小孩吓到了#海贼王#路飞
00:41
路飞与唐舞桐
Рет қаралды 46 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:25
CRAZY GREAPA
Рет қаралды 16 МЛН
I Can't Believe We Did This...
00:38
Stokes Twins
Рет қаралды 85 МЛН
Interrupt Safe Ring Buffer :: Bare Metal Programming Series 6
59:49
Low Byte Productions
Рет қаралды 8 М.
Microcontroller Interrupts | Embedded System Project Series #17
54:40
Why Function Pointers are Awesome
11:11
Jacob Beningo
Рет қаралды 4,8 М.
The RS-232 protocol
26:10
Ben Eater
Рет қаралды 824 М.
Extracting Firmware from Embedded Devices (SPI NOR Flash) ⚡
18:41
Flashback Team
Рет қаралды 553 М.
How I program GPIOs in C | Embedded System Project Series #12
30:00
Understanding the Structure of a Linux Kernel Device Driver
58:30
Sergio Prado
Рет қаралды 37 М.
Спутниковый телефон #обзор #товары
0:35
Product show
Рет қаралды 2,2 МЛН
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 4 МЛН
Easy Art with AR Drawing App - Step by step for Beginners
0:27
Melli Art School
Рет қаралды 7 МЛН
تجربة أغرب توصيلة شحن ضد القطع تماما
0:56
صدام العزي
Рет қаралды 6 МЛН
Tag her 🤭💞 #miniphone #smartphone #iphone #samsung #fyp
0:11
Pockify™
Рет қаралды 25 МЛН