Android攝像頭調試分析

前些天在展訊6825C 上調試gc2115攝像頭,發現後攝顯示效果非常的差,出現很嚴重的整個預覽界面豎條紋現象,但是對光線變化還是有反應的,初步判斷是sensor上電不對!後來經過測量各個管腳的電壓,發現是PowerDown腳的電壓不正常,導致切換攝像頭失敗,最後還是修改AVDD電壓算是解決瞭!過程甚是糾結!

vcD4KPHA+ICAgICDSu7Djc2Vuc29yyc+157fWzqpBVkRExKPE4rXn0bmjrERWRETK/dfWtefRuaOsSU9WRERJb7/atefRuaOs1eLI/bj2tefRubHY0OvJ6NbD1f3It7LFxNzV/bOjtcS08r+qyePP8c23o6zQwmljvObI3dDo0qrF5NbDyePP8c23xeTWw87EvP4ssqLH0tTayePP8c23x/22r87EvP7W0NDeuMRtYWtlZmlsZSy4/LjExeTWw87EvP6jrLHg0uvQwmlj1LTC66Os1fvA7c3qsc+686OsseDS68n6s8m2r8ysv+KjrLW8yOtzeXN0ZW0vbGliL2h3LNbYxvS9+MjryePP8c23o6y3os/Wz9TKvrK71f2zo6OstffK1MvjysfV/cq9v6rKvMHLo6E8L3A+CjxwPiAgICDK18/IysfXpcihtPK/qsnjz/HNt8qxtcRsb2cst6LP1srHyePP8c23aWO1xGkyY82o0MXT0Mqxu+HKp7Dco6y1q8rHv8nS1LbByKG1vbbU06a1xMnjz/HNt2lko6zWpMP3aTJjzajQxdbBydnKx8Gszai1xKOs07K8/snPyse/ydLUzajQxbXEo6zWu8rHxLPW1tSt0vK1vNbCwctpMmPNqNDFu+HKp7DcO73T18XKx8G/yKHJ48/xzbdpY8nP1vfSqrXEudy9xbXEtefRuaOsx9C7u8njz/HNt7eiz9axvtOmuMPArbjftcRQb3dlckRvd2653L3FsqLDu9PQwK2436Os1eK/ycTctbzWwsHLx9C7u8njz/HNt8qxu+G4xcLK0NSz9s/Wz+C7+tLRzaPWubXEzsrM4qOhPC9wPgo8cD4gICDNqLn9t9bO9rT6wuujrLeiz9bH0Lu7yePP8c23yrHIt8q1ysfNqLn9R1BJT7LZ1/dQb3dlckRvd27AtMq1z9bH0Lu7LMfQu7uz9s/Wz+C7+s2j1rm/ycTcuPrH0Lu7uf2zzNPQudijrLb4x9K0+sLrwO/It8q1ysfV4tH50LS1xKO6PC9wPgo8cD48L3A+CjxwcmUgY2xhc3M9″brush:java;”>LOCAL int _Sensor_K_PowerDown(BOOLEANpower_level)
{
SENSOR_PRINT(“SENSOR:_Sensor_K_PowerDown -> main: power_down %d\n”,
power_level);
/*
SENSOR_PRINT(“SENSOR:_Sensor_K_PowerDown PIN_CTL_CCIRPD1-> 0x8C000344 0x%x\n”,
_pard(PIN_CTL_CCIRPD1));
SENSOR_PRINT(“SENSOR:_Sensor_K_PowerDown PIN_CTL_CCIRPD0-> 0x8C000348 0x%x\n”,
_pard(PIN_CTL_CCIRPD0));
*/
switch(Sensor_K_GetCurId()) {
caseSENSOR_MAIN:
{
gpio_request(GPIO_MAIN_SENSOR_PWN,”main camera”);
if(0 == power_level) {
gpio_direction_output(GPIO_MAIN_SENSOR_PWN,0);

}else {
gpio_direction_output(GPIO_MAIN_SENSOR_PWN,1);
}
gpio_free(GPIO_MAIN_SENSOR_PWN);
break;
}
caseSENSOR_SUB:
{
gpio_request(GPIO_SUB_SENSOR_PWN,”sub camera”);
if(0 == power_level) {
gpio_direction_output(GPIO_SUB_SENSOR_PWN,0);
}else {
gpio_direction_output(GPIO_SUB_SENSOR_PWN,1);
}
gpio_free(GPIO_SUB_SENSOR_PWN);
break;
}
default:
break;
}
returnSENSOR_K_SUCCESS;
}

切換過程代碼不出現,那就是ic上電代碼會不會出現問題導致上電ic出現異常,根據FAE提供的參考,將上電代碼改成分步式上電,避免芯片突然上電概率性的斷電保護!

         Sensor_SetVoltage(SENSOR_AVDD_CLOSED,SENSOR_AVDD_CLOSED,SENSOR_AVDD_CLOSED);       
                   Sensor_PowerDown(power_down);
                   Sensor_SetVoltage(dvdd_val,SENSOR_AVDD_1800MV, SENSOR_AVDD_1200MV);
                     SENSOR_Sleep(80);
                   Sensor_SetVoltage(dvdd_val,SENSOR_AVDD_2500MV, SENSOR_AVDD_1500MV);
                     SENSOR_Sleep(80);
                   Sensor_SetVoltage(dvdd_val,SENSOR_AVDD_2800MV, SENSOR_AVDD_1800MV);
                     SENSOR_Sleep(80);
                  
                   //Open Mclk in default frequency
                   Sensor_SetMCLK(12);
                   Sensor_PowerDown(!power_down);
       SENSOR_Sleep(20); 
                   Sensor_SetResetLevel((BOOLEAN)!reset_level);
                   SENSOR_Sleep(20); 
                   Sensor_SetResetLevel((BOOLEAN)reset_level);
                   SENSOR_Sleep(60); 
                   Sensor_SetResetLevel((BOOLEAN)!reset_level);
                   SENSOR_Sleep(20);

測試發現還是概率性的打不開前攝,而且後攝也還是花屏的,仔細看瞭gc2235的datasheet,發現AVDD工作電壓是1.7V—3V,拉不高管腳電壓可能時電壓設置的不夠高,修改後發現後攝終於正常顯示瞭,而且切換到前攝發現也是可以進去瞭,隻是發現還是會概率性的出現前攝相機已停止的現象,甚是奇怪,到現在還是沒弄清楚這是為什麼?

以後有時間還是會繼續關註這個相機概率性停止的問題—未完待續!!!

發佈留言