Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Re: LCD WITH PIC 16f877a
I think your problem is Port setting.
Your source code
#define Data PORTB
Simulator’s LCD module Data Line set to PORTD
Data Lines -----> PORTD
Use
Data Lines -----> PORTB
sbit LCD_RS at RB2_bit;
sbit LCD_EN at RB3_bit;
sbit LCD_D4 at RB4_bit;
sbit LCD_D5 at RB5_bit;
sbit LCD_D6 at RB6_bit;
sbit LCD_D7 at RB7_bit;
sbit LCD_RS_Direction at TRISB2_bit;
sbit LCD_EN_Direction at TRISB3_bit;
sbit LCD_D4_Direction at TRISB4_bit;
sbit LCD_D5_Direction at TRISB5_bit...
Hi!
WStevens_sa
unsigned int x=0;
void main(){
while(Button(&PORTC,2,1,0)){
x++;
Delay_ms(1000); //Increment value of x every second.........
}
if(x<3){/*your code*/} //If less than 3 seconds
else if(x>=3){/*your code*/} //After 3...
I think this is the solution.
/*
Date: 25-01-2011
Project name: 8bit LCD
Author: Denshil
MCU: PIC16F877A
LCD: Lcd 2x16
Compiler: mikroC PRO
*/
sbit LCD8_RS at RB2_bit;
sbit LCD8_RW at RB3_bit;
sbit LCD8_EN at RB4_bit;
sbit LCD8_D7 at RD7_bit;
sbit LCD8_D6 at RD6_bit;
sbit...
HI skyassasin16
This is mikroC pro code. 16f877a
void main(){
TRISB0_bit=1; //PORTB0 set to input
TRISC1_bit=0; //PORTC1 set to output
PORTB=0;
PORTC=0;
while(PORTB==0);
while(1){
PORTC.F1=1; //PORTC1 set to high
Delay_ms(200);
PORTC.F1=0; //PORTC1 set to low
Delay_ms(200);
}
}
Hi WStevens_sa!
I am tried to develop custom character display program.
This is the program. It’s working.
Hi world!
Try to develop more…. Send to edaboard.
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7...
I think problem … built in functions you are redefined.
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit...
Hi WStevens_sa!
That example I modified to four 7segment. I Used 16f877,MikroC.
Now it’s working properly.
unsigned short mask(unsigned short num);
unsigned short digit_no,digit1000,digit100, digit10, digit1, digit, i;
void interrupt() {
if (digit_no==0) {
PORTA = 0...
I think mikroC auto convert, unsigned char to unsigned long int.
Don’t want to explicitly convert like that.
unsigned char charValue;
unsigned long int output;
void main(){
charValue=50;
output=0;
output= EEPROM_Read(charValue)/charValue;
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.