From: Luis C. <lfc...@lf...> - 2006-07-29 09:27:54
|
Stefan Krister wrote: > Hi all, > > success! > > I have blinking LEDs at the pcf8574 output lines while lcd4linux is > running! My LCD is still 'dark' but that may be a other problem ... > > I'm not 100% sure, but i think, that > > insmod scx200_acb.ko base=0x810,0x820 Yes, that was it! That is why the module we use was modified in the first place. For 2.4 kernels there was no useable module, hence the need to modify it. I now also have my I2C module working as well, and this time also powered by 3.3V, it's blue backlight module i salvaged from an old HP printer (HD66710). Pity it won't do any lowercase characters... I will need something in the lines of a uppercase_all plugin or something similar, that would produce proper text output (everything written in CAPS). Michael, any hints on this? Stefan, i'm also finetuning the driver a bit, try this attached file, where i did some minor changes and bug fixes. Update, sf.net is forbidding .ZIP file extensions, so i'll just copy past my changes here. CHANGELOG: drv_generic_i2c.c: The exit code was not done properly. p.s. there is still a need to properly detect the I2C slave device, which i'll do in some days along with the extension for full 8bit mode using two PCF8574. This is of course just a plan, knowing my previous time-to-market failed objectives :P drv_HD44780.c: The second delay for 4.1ms was wrong 4bit and 8bit code decision and initialization needs to be done also here. ------------------------------- CUT HERE ------------------------------- drv_generic_i2c.c: int drv_generic_i2c_open(const char *section, const char *driver) { int dev; char *bus, *device; udelay_init(); Section = (char *) section; Driver = (char *) driver; bus = cfg_get(Section, "Port", NULL); device = cfg_get(Section, "Device", NULL); dev = atoi(device); info("%s: initializing I2C bus %s", Driver, bus); //info("device %d", dev); if ((i2c_device = open(bus, O_WRONLY)) < 0) { error("%s: I2C bus %s open failed !\n", Driver, bus); goto exit_error; } info("%s: selecting slave device 0x%x", Driver, dev); if (ioctl(i2c_device, I2C_SLAVE, dev) < 0) { error("%s: error selecting slave device 0x%x\n", Driver, dev); goto exit_error; } info("%s: initializing I2C slave device 0x%x", Driver, dev); if (i2c_smbus_write_quick(i2c_device, I2C_SMBUS_WRITE) < 0 ){ error("%s: error initializing device 0x%x\n", Driver, dev); close(i2c_device); } return 0; exit_error: free(bus); free(device); close(i2c_device); return -1; } drv_HD44780.c change init sequence around linen 995 to this: /* initialize display */ drv_HD_I2C_nibble(allControllers, 0x03); udelay(T_INIT1); /* 4 Bit mode, wait 4.1 ms */ drv_HD_I2C_nibble(allControllers, 0x03); udelay(T_INIT2); /* 4 Bit mode, wait 100 us */ drv_HD_I2C_nibble(allControllers, 0x03); udelay(T_INIT1); /* 4 Bit mode, wait 4.1 ms */ drv_HD_I2C_nibble(allControllers, 0x02); udelay(T_INIT2); /* 4 Bit mode, wait 100 us */ drv_HD_I2C_command(allControllers, 0x28, T_EXEC); /* 4 Bit mode,\ 1/16 duty cycle, 5x8 font */ ------------------------------- CUT HERE ------------------------------- Have fun. If I can, i'll prepare a small webcam video to illustrate how slow the I2C bus can be, speccially with scrolling widgets like 'OS'. Luis Correia -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. |