jaya krishna
Member level 1
- Joined
- May 10, 2012
- Messages
- 41
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Location
- India,coimbatore
- Activity points
- 1,770
i want to print hello world in the eeprom memory..but it display on lcd is "0,0,0,0," instead of hello world " any one help me....
PHP:
#include <16F877a.H>
#fuses XT,NOWDT,NOPROTECT,BROWNOUT,PUT,NOLVP
#use delay (clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
#use i2c(MASTER, FAST, SCL=PIN_C3, SDA=PIN_C4, FORCE_HW)
#define EEPROM_SDA PIN_C4
#define EEPROM_SCL PIN_C3
#include <24256.c>
#define rs PIN_C0
#define rw PIN_C1
#define en PIN_C2
void lcdcmd(unsigned char cmd);
void lcddata(unsigned char volt);
char line1[]= {"Hello World"};
void main()
{
int8 i,a;
char buffer[17];
set_tris_b(0x00);
lcdcmd(0x38);
lcdcmd(0x0E);
lcdcmd(0x01);
lcdcmd(0x06);
lcdcmd(0x80);
while(1)
{
// Write "Hello World" to external eeprom chip.
for(i = 0; i < sizeof(line1); i++)
write_ext_eeprom(i, line1[i]);
// Read characters from the external eeprom chip
// and write them into a RAM buffer.
for(i = 0; i < sizeof(line1); i++)
buffer[i] = read_ext_eeprom(i);
a =buffer[i];
//printf("%c",bufferr);
lcddata(a);
// lcdcmd(0x80);
// Display the message on the LCD.
}
}
void lcdcmd(unsigned char cmd)
{
output_b(cmd);
output_low(rs);
output_low(rw);
output_high(en);
delay_ms(1);
output_low(en);
}
void lcddata(unsigned char volt)
{
output_b(volt);
output_high(rs);
output_low(rw);
output_high(en);
delay_ms(1);
output_low(en);
}