What are the differences between digital and analog?
Digital and analog signals can be used to complete tasks, but they have differences that determine how it is done. Digital signals can only have 2 values, 1 and 0. 1 means on, and 0 means off. Because of this, digital signals cannot be precise as there is only a limited amount of values. For example, a digital watch only shows values of time in hours, minutes, time, seconds, or maybe more. but it does not display the time in between. On the other hand, analog signals have an unlimited amount of values and it is very precise. For example, an analog watch shows an unlimited value of time as the second hand is constantly moving and representing al data in between the seconds.
Compare and contrast the nature and use of I2C, SPI, UART.
I2C, also known as inter-integrated circuits or 2 wire interface, is used for multiple circuits to communicate with each other. This protocol allows “slave” digital integrated circuits to communicate with one or more “master” digital integrated circuits. A “master” can have up to 256 “slaves”. I2C is a synchronous data bus, this means that all devices run at the same clock speed of up to 100kHz. Each slave is given an address in the form of a hexadecimal(base 16) number. These addresses are used to communicate from master to slave. The I2C protocol is intended for short distance communication within a single device. SPI, serial peripheral interface, like I2C is another bus protocol. SPI has a clock speed of 4 MHz, this is much faster than I2C. The reason for this is because slaves can communicate with the master more than once in a cycle. SPI protocol also uses a slave select system rather than addresses, so every slave has a direct slave select line that is in charge of calling it. Although a large difference is that SPI can only have one “master” and a maximum of 4 “slaves”. An example of SPI is an SD card. UART, on the other hand, is not a bus or a protocol. It is used for communication between two devices, and it is a peripheral found on a microcontroller. An example of this is your USB and computer communicating.
Digital Signal Processing within Arduino
In Arduino, the I2C protocol is a peripheral that you will not ever see used in PC-device communication. Although it is popularly used for multiple modules and sensors. So when doing an Arduino project that needs multiple parts to work together, I2C will be very useful as it will potentially connect up 128 devices to your main board. Because of SPI’s great speed, it will be most commonly found in places where speed is crucial. Such as SD cards and display modules. With Arduino, SPI is very useful when information needs to be quickly updated, like when using a temperature sensor. UART is crucial for the Arduino as it is a peripheral found on all serial boards. UART communicates with digital pin 0(rx), and digital pin1(tx). It is also used for the Arduino to communicate directly with the computer via USB so that the code can be uploaded.