abhishekdixit
Full Member level 2
- Joined
- Dec 30, 2011
- Messages
- 124
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,296
- Location
- India
- Activity points
- 2,182
#include<htc.h>
#include<string.h>
#define _XTAL_FREQ 20000000
#define RS PORTCbits.RC0
#define RW PORTCbits.RC1
#define EN PORTCbits.RC2
#define LED RA0
void lcd_cmd(unsigned char a);
void lcd_data1(unsigned char b);
//void lcd_write(unsigned char);
//unsigned char name[]="ABHISHEK";
void main()
{
unsigned char i=0;
TRISB=0;
LATB=0;
TRISC=0;
LATC=0;
TRISA=0;
lcd_cmd(0x38);
__delay_ms(10);
lcd_cmd(0x0E);
__delay_ms(10);
lcd_cmd(0x06);
__delay_ms(10);
lcd_cmd(0x01);
__delay_ms(10);
lcd_data1('A');
LED=1;
while(1);
}
void lcd_cmd(unsigned char a)
{
RS=0;
RW=0;
LATC=a;
EN=1;
__delay_ms(10);
EN=0;
}
void lcd_data1(unsigned char b)
{
RS=1;
RW=0;
LATC=b;
EN=1;
__delay_ms(10);
EN=0;
}
Build C:\Documents and Settings\Administrator.BDG\My Documents\Projects\EDAboard\abhishekdixit\abhishekdixit for device 18F4550
Using driver C:\Program Files\HI-TECH Software\PICC-18\PRO\9.66\bin\picc18.exe
Make: The target "C:\Documents and Settings\Administrator.BDG\My Documents\Projects\EDAboard\abhishekdixit\main.p1" is up to date.
Executing: "C:\Program Files\HI-TECH Software\PICC-18\PRO\9.66\bin\picc18.exe" -oabhishekdixit.cof -mabhishekdixit.map --summary=default --output=default main.p1 --chip=18F4550 -P --runtime=default --opt=default -D__DEBUG=1 --rom=default --ram=default -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
HI-TECH C PRO for the PIC18 MCU Family V9.66
Copyright (C) 1984-2011 HI-TECH SOFTWARE
Serial number: HCPIC18P-XXXXXX
Advisory[1233] Employing 18F4550 errata work-arounds:
Advisory[1234] * Corrupted fast interrupt shadow registers
Memory Summary:
Program space used E6h ( 230) of 8000h bytes ( 0.7%)
Data space used 102h ( 258) of 7A0h bytes ( 13.2%)
EEPROM space used 0h ( 0) of 100h bytes ( 0.0%)
ID Location space used 0h ( 0) of 8h nibbles ( 0.0%)
Configuration bits used 0h ( 0) of 7h words ( 0.0%)
Loaded C:\Documents and Settings\Administrator.BDG\My Documents\Projects\EDAboard\abhishekdixit\abhishekdixit.cof.
********** Build successful! **********
Executing: "C:\Program Files (x86)\HI-TECH Software\PICC-18\PRO\9.65\bin\picc18.exe" --pass1 "E:\Embedded Program\PIC18F4550\LCD\lcd_pic.c" -q --chip=18F4550 -P --runtime=default --opt=default -D__DEBUG=1 -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Error [255] E:\Embedded Program\PIC18F4550\LCD\lcd_pic.c; 37.14 not a member of the struct/union ""
Error [182] E:\Embedded Program\PIC18F4550\LCD\lcd_pic.c; 37.16 illegal conversion between types
Error [255] E:\Embedded Program\PIC18F4550\LCD\lcd_pic.c; 38.14 not a member of the struct/union ""
Error [182] E:\Embedded Program\PIC18F4550\LCD\lcd_pic.c; 38.16 illegal conversion between types
Error [255] E:\Embedded Program\PIC18F4550\LCD\lcd_pic.c; 40.14 not a member of the struct/union ""
Error [182] E:\Embedded Program\PIC18F4550\LCD\lcd_pic.c; 40.16 illegal conversion between types
Error [255] E:\Embedded Program\PIC18F4550\LCD\lcd_pic.c; 42.14 not a member of the struct/union ""
Error [182] E:\Embedded Program\PIC18F4550\LCD\lcd_pic.c; 42.16 illegal conversion between types
Error [255] E:\Embedded Program\PIC18F4550\LCD\lcd_pic.c; 47.14 not a member of the struct/union ""
Error [182] E:\Embedded Program\PIC18F4550\LCD\lcd_pic.c; 47.16 illegal conversion between types
Error [255] E:\Embedded Program\PIC18F4550\LCD\lcd_pic.c; 48.14 not a member of the struct/union ""
Error [182] E:\Embedded Program\PIC18F4550\LCD\lcd_pic.c; 48.16 illegal conversion between types
Error [255] E:\Embedded Program\PIC18F4550\LCD\lcd_pic.c; 50.14 not a member of the struct/union ""
Error [182] E:\Embedded Program\PIC18F4550\LCD\lcd_pic.c; 50.16 illegal conversion between types
Error [255] E:\Embedded Program\PIC18F4550\LCD\lcd_pic.c; 52.14 not a member of the struct/union ""
Error [182] E:\Embedded Program\PIC18F4550\LCD\lcd_pic.c; 52.16 illegal conversion between types
********** Build failed! **********
#define RS PORTCbits.RC0
#define RW PORTCbits.RC1
#define EN PORTCbits.RC2
Error [141] C:\Users\ABHISHEK\Desktop\lcd_pic.c; 2.20 can't open include file "p18f4550.h": No such file or directory
.... please tell me, canwhy you used these line in your code. i mean whatis purpose to use these commands
ADCON0 = 0x00;
ADCON1 = 0b00001111;
CMCON = 0x07;
Several PORTA pins are multiplexed with analog inputs,
the analog VREF+ and VREF- inputs and the comparator
voltage reference output. The operation of pins RA5
and RA3:RA0 as A/D converter inputs is selected by
clearing/setting the control bits in the ADCON1 register
(A/D Control Register 1).
Note: On a Power-on Reset, RA5 and RA3:RA0
are configured as analog inputs and read
as ‘0’. RA4 is configured as a digital input.
CLRF PORTA ; Initialize PORTA by
; clearing output
; data latches
CLRF LATA ; Alternate method
; to clear output
; data latches
MOVLW 0Fh ; Configure A/D
MOVWF ADCON1 ; for digital inputs
MOVLW 07h ; Configure comparators
MOVWF CMCON ; for digital input
MOVLW 0CFh ; Value used to
; initialize data
; direction
MOVWF TRISA ; Set RA<3:0> as inputs
; RA<5:4> as outputs
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?