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

Ғылым және технология

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.

Пікірлер: 26

  • @KuraldGalain
    @KuraldGalain9 ай бұрын

    Finally some more indepth content with asserts and WITHOUT HAL, thank you!

  • @elektron2kim666
    @elektron2kim66610 күн бұрын

    Very interesting. I'm playing with GPS modules at the moment.

  • @ravitejaj473
    @ravitejaj4736 ай бұрын

    Thanks for Technical information for future and development.

  • @raviupadhyay8034
    @raviupadhyay8034 Жыл бұрын

    Hi This video is very informative and is very much helpful in understanding the concepts .

  • @olivialinden8699
    @olivialinden8699 Жыл бұрын

    Great video 👍

  • @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 :)

  • @michaelnilan7413
    @michaelnilan7413 Жыл бұрын

    Great stuff. Keep it up!! Thank you for your efforts.

  • @artfulbytes

    @artfulbytes

    Жыл бұрын

    Thanks!

  • @MariusHeier1
    @MariusHeier1 Жыл бұрын

    Great video. Subscribed! 👊🙂

  • @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

  • @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 :)

  • @BigA1
    @BigA13 ай бұрын

    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.

  • @NotSionnix
    @NotSionnixАй бұрын

    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

    Ай бұрын

    CP2102 USB to TTL Converter HW-598, yes it should work on those.

  • @NotSionnix

    @NotSionnix

    Ай бұрын

    @@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

  • @vabgat1
    @vabgat15 ай бұрын

    JFYI for noobies like me, the Tx pin of MSP430 to be connected to Rx pin of USB-to-UART converter chip.

  • @artfulbytes

    @artfulbytes

    5 ай бұрын

    Classic

  • @artfulbytes
    @artfulbytes Жыл бұрын

    Mistake: ' ' and ' ' should be in opposite order. I fix it in this video: kzread.info/dash/bejne/fWuZqs2impDdfrw.html.

  • @quoocshuwng7939
    @quoocshuwng7939 Жыл бұрын

    What name is microcontroller?

  • @artfulbytes

    @artfulbytes

    Жыл бұрын

    MSP430G2553, MSP-EXP430G2ET Development kit

Келесі