Skip to main content

Posts

Showing posts with the label 877

PIC16F887 877 programming in C Tutorial 5 LCD Interfacing

LCD Interfacing: In this tutorial i will show you how to interface 16x2 LCD with micro-controller. 16x2 means there are two rows and each row contain maximum 16 characters.  For more detail refer to the LCD datasheet, which you are using. Basic Connection: Applies 5v to pin 2 and gnd to pins 1 & 5. Use variable resistor at pin 3 to set contrast. Pins 7 to 14 are the data pins,, used to send/rec data. Pin 6 is of enable; every time when you write to lcd you should have to give high to low, to this pin. pin 4 is register select pin use to give commands like clear, home etc.   In this tutorial i will interface lcd in 4-bit instead of 8-bit, so we only required four data pins. Code: Lets write a code that will display the motor status and its direction; it will be fun!!!! Requirements: Design a motor controller circuit using l298 and display its status on lcd. LCD is connected to portb and motor controller circuit is at portd. Required two switches to change motor direction; i...

PIC16F887 877 programming in C Tutorial 1 Getting Started

PIC16F887 and PIC16F877 are the members of PIC16F88X and PIC16F87X families respectively. PIC16F887 is the new version launched by microchip to take place of PIC16F877.For detail information please refer to their datasheets. In this tutorial i will show you how to program PIC16F887/877 in C. So first of all download mikroc pro for pic compiler also download its user manual. After this create a new project choose P16F887 or 877 whatever you have, and 4MHz crystal etc. If you dont know how to create a new project refer to its manual or download document 'how to create first project' from its site. Note that i will use PIC16F887 and 4MHz external crystal (although PIC16F887 also have internal crystal) you can use 8MHz and what so ever. For 4MHz oscillator setting should be XT where as for 8MHz or above it should be HS (see fig below). Lets start with a simple program 'LED Chaser', before we start this lets check out the PIC16F887 pin out. pinout of pic16f887 As you can se...