Hi TI
I had problems on caculate distance using opt9221 outputdata,we designed our board reference to TI CDK.Now I can get PHY_TEST data normally,then I closed PHY_TEST and get real data out,after I cacluate distance from frame data,the following picture shows distance info.It looks like wrong,what should I do?
My board configured as following:
1.Reset TFC OPT9221
2.Set DE register
0x39,0x00000100
0x3c,0x00005000
0x3d,0x00000100
0x3e,0x00000100
0x3f,0x0000010b
3.Set DE register 0x31 = 0x00001803,enable MAC_TEST row ramp pattern.
4.Get one frame data and caculate distance,the following picture shows result.
I use the following formulas to caculate distance of one pixel.
Phase = ((DATA & 0x0fff0000) >> 16); //DATA is 4 byte(4byte mode default)
R = C/(2*MOD_FREQ); //C is light speed, MOD_FREQ is modulation frequency,now is 48MHZ
distance = phase * R/4096;
5.Disable MAC_TEST,get one frame data from opt9221,and caculate distance,the following shows result
But I find most of real phase data are near to zero or 4095,what's wrong?
BR

