TTL Serial Communication Explained | Part 2
HTML-код
- Опубликовано: 5 сен 2024
- 🤩 FREE Arduino Crash Course 👇👇
bit.ly/get_Ard...
Want to learn more? Check out our courses! bit.ly/3B8YW3y
**Get the code, transcript, challenges, etc for this lesson on our website**
bit.ly/3B19py9
SERIAL READ VIDEO:
• Using Serial.read() wi...
SERIAL BEGIN:
• What is Serial.begin(9...
We designed this circuit board for beginners!
Kit-On-A-Shield: amzn.to/3lfWClU
SHOP OUR FAVORITE STUFF! (affiliate links)
---------------------------------------------------
Get your Free Trial of Altium PCB design Software
www.altium.com...
We use Rev Captions for our subtitles
bit.ly/39trLeB
Arduino UNO R3:
Amazon: amzn.to/37eP4ra
Newegg: bit.ly/3fahas8
Budget Arduino Kits:
Amazon:amzn.to/3C0VqsH
Newegg:bit.ly/3j4tISX
Multimeter Options:
Amazon: amzn.to/3rRo3E0
Newegg: bit.ly/3rJoekA
Helping Hands:
Amazon: amzn.to/3C8IYXZ
Newegg: bit.ly/3fb03X1
Soldering Stations:
Amazon: amzn.to/2VawmP4
Newegg: bit.ly/3BZ6oio
AFFILIATES & REFERRALS
---------------------------------------------------
►Audible Plus Free trial: amzn.to/3j5IGrV
►Join Honey- Save Money bit.ly/3xmj7rH
►Download Glasswire for Free:bit.ly/3iv1fql
FOLLOW US ELSEWHERE
---------------------------------------------------
Facebook: / programmingelectronics...
Twitter: / progelecacademy
Website: www.programmin...
SO WHAT IS THIS U(S)ART THING?
Many microcontrollers come equipped with a simple way to communicate serially - using a USART. USART stands for Universal Synchronous/Asynchronous Receiver/Transmitter.
Wow - that’s one heck of a name! But let’s dive in - it actually way more reasonable than at first glance.
A USART is a piece of hardware. You’ll find it as either a stand-alone integrated circuit, or built right into a microcontroller.
An Arduino UNO for example uses an ATMEGA328P microcontroller which has a built-in USART.
This built-in USART (which uses the RX/TX pins on the Arduino) can send bytes of data serially to a different microcontroller on the Arduino UNO board, the ATMEGA16U2, which is used to handle the serial communication over USB.
USARTs allow us to take data in parallel from one device, convert it into a serial transmission, and then transform it back again into parallel data.
Now I want to draw attention to the Synchronous/Asynchronous part of USART for a moment - because that I think is most confusing. When serial communication protocols are synchronous (for example I2C, SPI) they use a clock signal for synchronizing the transmission from the sender to the receiver. The clock signal is what actively keeps the two in unison.
With an asynchronous protocol, there is no clock signal to synchronize the communication - which is why it requires a baud rate the receiver and the transmitter agree upon beforehand. We’ll be talking more about baud rate in just a moment.
The flavor of serial communication between these two USARTS is often referred to as TTL serial. TTL stands for Transistor-Transistor-Logic (We will not be diving into the details of TTL in this discussion).
It’s this TTL serial communication that we will use as a basis for our discussion of serial communication.
THE NITTY GRITTY OF TTL SERIAL COMMUNICATION
How does it work? Well it’s pretty cool.
Each USART has a TX and RX pin. The TX pin of the sending device is connected to the RX pin of the receiving device and vice versa.
By modulating the TX pin state (Making it HIGH to send a 1, or LOW to send a 0), the sender is able to send a message over a connecting wire. The receiver reads the pin state at its RX pin to determine what was sent.
The serial communication protocol goes something like this…
Send a start bit (0 - LOW) “Hey, I’m getting ready to send a message!”
Followed by a set number of bits (often 8) “Here is my message…”
Optionally a parity bit “You sure you got this right?”
And finally a stop bit (1 - HIGH) “That’s all she wrote”
This is the kind of serial communication that is taking place when using the Arduino serial library, for example with functions like Serial.begin() and serial.print().
Thanks
Thanks for watching!
Nooooo way too short, I was just settling in my seat gearing up to learn.
Well good news, we have lots of content to watch and a whole website full of extended learning! What do you want to know?
@@programmingelectronics there is nothing in particular I need to know at the moment, as I have just finished writing the code for my home automation system. I probably know 80% of what you teach, but it is the odd gem that I don't know that makes them all that more enjoyable. I just found the last video a bit short, I was just getting into it and it ended. Keep up the great work and I look forward to the next installment, whatever it may be.
Thanks @@DodgyBrothersEngineering !
Part 3 never came?
Waiting for part 3. Delay=?
It is on its way! check back next Friday!
@@programmingelectronics nice one.
👌
Thanks!
Ok I found the playlist. But the playlist is out of order!
Thanks