CEN 389 Week 4
CEN 389 Week 4
Week 4
TOPICS TO BE DISCUSSED
• Hardware Design
• Serial Interfaces / Communication Interface
• Analog Digital Converters
2
Serial Interfaces / Communication Interface
Communication interface is essential for communicating with various subsystems of
the embedded system and with the external world.
➢ Examples: Serial interfaces like I2C, SPI, UART, 1-Wire etc and Parallel
bus interface
2. Product level communication interface (External
Communication Interface)
• The ‘’Product level communication interface’’ (External
Communication Interface) is responsible for data transfer between
the embedded system and other devices or modules. The external
communication interface can be either wired media or wireless media
and it can be a serial or parallel interface.
➢ Examples for wireless communication interface: Infrared (IR),
Bluetooth (BT), Wireless LAN (Wi-Fi), Radio Frequency waves (RF),
GPRS etc.
➢ Examples for wired interfaces: RS-232C/RS-422/RS 485, USB, Ethernet
(TCP-IP), IEEE 1394 port, Parallel port etc.
2. Product level communication interface (External
Communication Interface)
1. Device/board level communication interface (Onboard
Communication Interface)
• The communication channel which interconnects the various
components within an embedded product is referred as Device/board
level communication interface (Onboard Communication Interface)
• PIC microcontroller offers a choice of serial interfaces. The best one
for any given communication channel depends on the distance
between nodes, the speed, and the number of hardware connections
required.
1. UART (Universal Asynchronous Receiver Transmitter)
2. I2C (Inter Integrated Circuit) Bus
3. SPI (Serial Peripheral Interface) Bus
UART (Universal Asynchronous Receiver Transmitter)
• The universal synchronous/asynchronous receive transmit (USART)
device is typically used in asynchronous mode to implement off-
board, one-to-one connections.
setup_adc_ports(AN0_AN1_AN3); A0 A1 A3
setup_adc_ports(AN0_AN1_VSS_VREF); A0 A1 Vref(+)=A3
setup_adc_ports(AN0_AN1_AN4_VREF_VREF); A0 A1 A5 Vref(+)=A3 Vref(-)=A2
setup_adc_ports(AN0_AN1_VREF_VREF); A0 A1 Vref(+)=A3 Vref(-)=A2
setup_adc_ports(AN0); A0
setup_adc_ports(AN0_VREF_VREF); A0 Vref(+)=A3 Vref(-)=A2
ADC Usage
• #define adc = 10
• set_adc_channel(channel)
• unsigned long int value = read_adc();
• Example;
• set_adc_channel(0);
• value = read_adc();
• delay_us(20);
THANK YOU