Skip to main content

Posts

Showing posts with the label Embedded

Digital Voltmeter using PIC Microcontroller

This is a simple voltmeter which measures 0-5V at a precision of 4.8 mV. This is a simple design using inbuilt ADC of PIC 16F877A. PIC 16F877A have 8 channel 10bit ADC.   Measured voltage is displayed on 16x2 LCD display. Using one of the most popular 8 bit PIC 16f877A, for instance, reading the datasheet , we'll find that the ADC modules (10 bit) are controlled by four different registers. The first two, ADCON0 and ADCON1 , are used to set and start the ADC module. When high level language is used, the programmer doesn't need to care a lot of the register connected to the results because they are normally stored in a variable by a routine of the language itself ( adc_read , for instance, using mikroc). The ADCON0 As we can see this registers are 8 bit registers where. - bit6 and bit 7 are used to set the frequency of the conversions. - bits 3, 4 and 5 are used to select the pins of the microcontroller enabled to theadc conversions. - bit 2 represents the sta...

PIC 4x4 Keypad Interfacing Tutorial - MikroC

Keypad Library The mikroC PRO for PIC provides a library for working with 4x4 keypad. The library routines can also be used with 4x1, 4x2, or 4x3 keypad. For connections explanation see schematic at the bottom of this page. External dependencies of Keypad Library The following variable must be defined in all projects using Keypad Library: Description : Example : extern sfr char keypadPort; Keypad Port. char keypadPort at PORTD; Library Routines Keypad_Init Keypad_Key_Press Keypad_Key_Click Keypad_Init Prototype void Keypad_Init( void ); Returns Nothing. Description Initializes port for working with keypad. Requires Global variable : keypadPort - Keypad port must be defined before using this function. Example // Keypad module connections char keypadPort at PORTD; // End of keypad module connections ... Keypad_Init(); ...