c - LCD only showing black blocks when built - *** simulation on Proteus works fine *** -
i coding program displays time on lcd. i'm using lm016l (16x2 lcd display) simulations works fine in proteus when build it not work , on powering lcd shows black blocks across whole top row. using mcc18 complier. using pic18f2620 have tried pic18f4520 still having same issues. using ds1307 real time clock , crystal real time clock (not sure if matters). assuming pic working correctly because when press button in circuit led lights lcd still remains nothing display black blocks. have tried adjusting manual contrast of lcd no luck.
here frame.c lcd initialised , used
#include <xlcd.h> #include <delays.h> #include "frame.h" #include "misc.h" #include "i2c.h" #include "eeprom.h" void initlcd() { openxlcd(four_bit & lines_5x7); while (busyxlcd()); writecmdxlcd(0x06); // entry mode (increment ddraam loc) writecmdxlcd(0b00001100); } void splash(int* frame) { int c; char namemsg[] = "** medisync **"; char loadingmsg1[] = "loading"; char loadingmsg2[] = "loading."; char loadingmsg3[] = "loading.."; char loadingmsg4[] = "loading..."; setddramaddr(0x01); putsxlcd(namemsg); setddramaddr(0x44); putsxlcd(loadingmsg1); (c = 0; c <= 10; c++) delay10ktcyx(6); setddramaddr(0x44); putsxlcd(loadingmsg2); (c = 0; c <= 10; c++) delay10ktcyx(5); setddramaddr(0x44); putsxlcd(loadingmsg3); (c = 0; c <= 10; c++) delay10ktcyx(5); setddramaddr(0x44); putsxlcd(loadingmsg4); (c = 0; c <= 10; c++) delay10ktcyx(5); // writeds1307(0x02, 0b0010001); // set hour 11 //writeds1307(1, 0b01011001); // set minute 59 ap = 1; // reminder saved in memory count_min = count_min_tmp = eeprom_read(mem_minutes); count_hr = count_hr_tmp = eeprom_read(mem_hours); // time saved in ds1307 hour_bcd = readds1307(0x02); minute_bcd = readds1307(0x01); hour = bcd2bin(hour_bcd); minute = bcd2bin(minute_bcd); writeds1307(0, 0x00); // reset seconds 0 tmr0l = 0; writeds1307(7, 0b00010010); // start square wave on ds1307 & 8.192khz *frame = home; gmode = mode_default; }
help appreciated!
if need more information please let me know.
Comments
Post a Comment