Re: Brightness auto adjusting to ambient light level
Posted: Tue Jul 05, 2011 1:04 pm
Configurable on atmega usb too.erdem_ua wrote:It's configurable on V-USB approach.
I don't know if it's same on hardware based MCUs.
Samsung TV Firmware on the GO
https://forum.samygo.tv/
Configurable on atmega usb too.erdem_ua wrote:It's configurable on V-USB approach.
I don't know if it's same on hardware based MCUs.
Code: Select all
In our product, light sensor operates only "Standard" mode.
Eco Sensor
step1 : Read the Lux five times as the unit of 400ms.
step2 : Transfrom the taken Lux to 20 level.
step3 : Get the most frequent grade, them set up the current level.
step4 : If |current level| - |previous level| > 1 , change the level
step5 : Refresh the Backlight set-up as the 200ms.
Lux > 200 190 ... 10 0
Sensor Backlight 20 19 .... 1 0
Code: Select all
step2 : Transfrom the taken Lux to 20 level.
But it makes sense to use sensor only in "Standard" mode. If you set "film" mode you should darken the roomsbav1 wrote: In our product, light sensor operates only "Standard" mode (???) - is it actually true in C-Series?
edit: apparently no; eco sensor operation is not restricted to Standard mode only..
Well, in theory we can read configuration settings from I2C EEPROM..erdem_ua wrote: @sbav1 I think this as command line program... Easier to run/debug
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/mman.h>
#include "sdp_i2c_io.h"
#define FATAL do { fprintf(stderr, "Error at line %d, file %s (%d) [%s]\n", \
__LINE__, __FILE__, errno, strerror(errno)); exit(1); } while(0)
#define SADDR_ID_PANEL_TYPE 0x6911
#define SADDR_ID_MODEL 0x6912
#define SADDR_ID_PANELTIME 0x691c
int i2c_eeprom_comb_read(int fd, unsigned short subaddr, unsigned short len, unsigned char *buf) {
struct sdp_i2c_packet_t iicp;
unsigned char pSA[2];
pSA[0]=(unsigned char)((subaddr >> 8) & 0xff);
pSA[1]=(unsigned char)(subaddr & 0xff);
printf("### i2c_eeprom_comb_read(): SA[0]=0x%02x SA[1]=0x%02x len=%d\n", pSA[0], pSA[1], len);
iicp.slaveAddr=0xa0;
iicp.subAddrSize=2;
iicp.udelay=50;
iicp.speedKhz=400;
iicp.dataSize=len;
iicp.pSubAddr=pSA;
iicp.pDataBuffer=buf;
iicp.reserve[0]=iicp.reserve[1]=iicp.reserve[2]=iicp.reserve[3]=0;
return(ioctl(fd, I2C_CMD_COMBINED_READ, &iicp));
}
int main(int argc, char **argv) {
int fd;
unsigned char buf[64];
// AT24C256B: I2C bus 1; slave 0xA0; 32kB
if ((fd=open("/dev/sdp_i2c1", 0x1002)) == -1) FATAL;
memset(buf, 0, sizeof(buf));
int res=i2c_eeprom_comb_read(fd, SADDR_ID_MODEL, 1, buf);
printf("### ioctl result=%d; ID_MODEL setting: %d (0x%02x)\n", res, buf[0], buf[0]);
unsigned utmp=0;
res=i2c_eeprom_comb_read(fd, SADDR_ID_PANELTIME, 4, (unsigned char *)&utmp);
printf("### ioctl result=%d; ID_PANELTIME setting: %d (0x%08x) == %d (?) hours\n", res, utmp, utmp, utmp/6);
close(fd);
return 0;
}
Can't find an exact location in SM; I guess it's on "Function & IR" board (panel keys + IR sensor).tom_van wrote:sbav, does service manual show where is the sensor located?
Well, I'm mostly using "Movie" (decent color rendition, nearly no banding), even in broad daylightBut it makes sense to use sensor only in "Standard" mode. If you set "film" mode you should darken the room
Aye, to prevent AE/AWB from working we will need some reference light source (small white LED ?) shining on the 2/3 of the sensor and read the ambient light from the remaining 1/3 or so.tom_van wrote:I'm sure that typical webcam has exposure auto setting, so the overall light level is intentionally removed from output.
I looked into this webcam (TC102 Titanum ???) again; photoresistor is most probably just a part of (very simple) circuit for backlight LED[s] driver. It's not readable from USB, unless I'm very much mistakenThere might be some special readings but I doubt if on "el cheapo".