Tag archives for PIC18F Peripheral Libraries
Analog to Digital converters allow analog continuous voltages to be converted into a discreet digital numbers inside the PIC as the PIC can only process digital numbers. This can enable a PIC to be connected to analog sensors such as temperature sensors, pressure sensors, humidity sensors, optical sensors, and power sensors. Any sensor which can generate a voltage between 0V and a maximum 5V can be used. If the output voltage is higher than 5V, a method to step it down should be used such as a voltage divider with resistors.
The I²C or Inter-Integrated Circuit is a serial communication and allows multiple devices to communicate with a micocontroller(s) over only two wires. The devices don't have to be identical as long as they support I²C protocol. In our illustration, the first device with address 1 is a digital temperature sensor, the second one is a real time clock and the third one is a serial LCD display and the bus could carry on even more devices. Communication takes place from the master (PIC) to the individual selected slave only as shown in this illustration. Configuration with PIC18F Peripheral Libraries and MPLAB Code Configurator are discussed in this article