Skip to main content

Posts

Showing posts with the label PIC16f877a

Temperature Sensor DS18S20 PIC16F877A

Here's a temperature sensor (thermometer) circuit that you can easily build. It uses the popular PIC 16F877A microcontroller. The temperature sensor is DS18S20. The DS18S20 communicates through the one-wire protocol. The PIC16F877A communicates with the DS18S20 with the one-wire protocol and gets the information for the temperature and displays it on the LCD. The temperature range of this circuit is -55'C to +125'C. The methods of communicating with the DS18S20 and sending/receiving commands, and reading the temperature value,  are all explained in the DS18S20 datasheet ( datasheets.maximintegrated.com/en/ds/DS18S20.pdf ). Here is the code for the PIC16F877A: (You can download the source file from: https://rapidshare.com/files/1817975964/DS18S20PIC16F877A.c ) -------------------------------------------------------------------------------------------------------------- //Programmer: Syed Tahmid Mahbub //Compiler: mikroC PRO for PIC v4.60 //Target PIC: PIC16F877A ------------...

Temperature Sensor LM35 PIC16F877A

Here's one temperature sensor (thermometer) circuit that you can easily build. It uses the popular PIC 16F877A microcontroller. The temperature sensor is LM35. The LM35 outputs an analog voltage proportional to the temperature. The output from the LM35 is 0.1V/'C. So, when temperature sensed is 61'C, the output voltage is 0.61V. This analog voltage is read by the PIC and processed to display the corresponding temperature value on the LCD. The temperature range for this circuit is 0'C to 150'C. The analog to digital conversion is done by the PIC ADC module. In the code, I've used the mikroC library function for ADC. You can view the library file here: http://www.mikroe.com/download/eng/documents/compilers/mikroc/pro/pic/help/adc_library.htm However, you should have a knowledge of how the ADC module works and how to use it. I had written a tutorial on modalities of operation of the PIC 16F877A ADC. You can find the tutorial here: http://www.blogspot.com/2016/03/mo...

Turn off Led using PIC16f877a with Assembler Code

Start making a simple program in which we in assembly code using PIC 16F877A to turn on and off an LED by pressing a button as shown in the diagram. We will use two ports of the PIC 16F877A, port B and port D, declare the B port as input and the D port will be configured as an output. In the graph we can see that the pin RB0 is set button and a resistor in a pull-up configuration, when you are not pressing the button it gets a high (5V) to the RB0 input and when pressed he gets a level low (0V). In the output RD0 to turn on the led its output should be at a low level so when developing the program in assembler we test the pin B0 and if a high level put a high value on the output RD0 that will keep off LED, otherwise put a low value on the output RD0 which will cause the LED lights. ASSEMBLER PROGRAM FOR PIC 16F877A To make the program use the MPLABX 2.0 Open the IDE MPLABX program. We click file, select New Project ... In window "Select Project" emerging select "Microchi...