MX53 CSI/IDMAC config for Aptina 12-bit grayscale camera?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MX53 CSI/IDMAC config for Aptina 12-bit grayscale camera?

Jump to solution
6,525 Views
EdMenard
Contributor I

Hi,

I'm having a problem configuring the MX53 CSI/IDMAC properly for a 12-bit Aptina camera - the data values are showing up in memory in bits 4-15 rather than 0-11. Here's the scenario:

     MT9P031M 12-bit mono camera

     parallel data connected to data 8-19

CSI0_SENS_CONF:

     protocol: gated

     format: generic

     data width: 16 bits

     data dest: IDMAC

CPMEM (interleaved):

     BPP: 3 (12 bits per pixel)

     NPB: 31

     PFS: 6 (generic data)

Compander is disabled

I put the camera into test mode, generating a walking 1's pattern.

Here are the data values that are put in memory, which are shifted left by 4 bits:

     0020

     0040

     0080

     0100

     0200

     0400

     0800

     1000

     2000

     4000

     8000

     0010

     0020

     ...

It's my understanding that I should be able to have 12-bit camera data show up in the lower 12 bits of memory - what additional/different settings are needed to do that...?

Thanks,

--Ed

Labels (2)
Tags (2)
0 Kudos
Reply
1 Solution
1,295 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

I think you also need set BPP to 16 bits per pixel in CPMEM.
For generic mode, when you set 16 bits data width in CSI, it will capture 16 bits each clock. And when use CPMEM to save them to memory, with your setting, 12 bits will be saved each time, but the captured data has 4 bits unused data, it will also be saved to memory, so there will be 4 bits shift.
And if you wants to save the 12 bits gray data to memory bits[0~11], I think you should connect the data pins to CSI_DATA15 ~ CSI_DATA4.
Otherwize, when convert from 16bits to 12bits, LSB will be dropped, so the 12 bits data will always kept in memory bits[4-15].

View solution in original post

0 Kudos
Reply
2 Replies
1,296 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

I think you also need set BPP to 16 bits per pixel in CPMEM.
For generic mode, when you set 16 bits data width in CSI, it will capture 16 bits each clock. And when use CPMEM to save them to memory, with your setting, 12 bits will be saved each time, but the captured data has 4 bits unused data, it will also be saved to memory, so there will be 4 bits shift.
And if you wants to save the 12 bits gray data to memory bits[0~11], I think you should connect the data pins to CSI_DATA15 ~ CSI_DATA4.
Otherwize, when convert from 16bits to 12bits, LSB will be dropped, so the 12 bits data will always kept in memory bits[4-15].

0 Kudos
Reply
1,295 Views
EdMenard
Contributor I

Thanks - that's the conclusion we reached as well.

For now we are shifting the bits down in software - next rev of the hardware we'll connect as you suggest.

0 Kudos
Reply