This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

question about dm643x ccdc hd/vd polarity configuration

I am interfacing the dm6435 ccdc to a raw image sensor, and had a question about how to set the polarity of hd & vd.  My device provides a "frame valid" signal that is active high during data output and low otherwise, and a "line valid" signal that is active high during valid data for each row.  Looking at SPRU977a, page 35, figure 8, this seems to be the exact opposite of what the ccdc expects.  What should the polarity of hd & vd be set to?

frame valid (vd)   0001111111111111111111111111111000

line valid (hd)      00000111100111100111100111100

 

  • This is a good question, figure 8 is not as clear as it could be on this so I am not surprised to see the confusion (you are not the first to grapple with the meaning of this figure), the HD and VD signals are actually edge triggered as opposed to level triggered, meaning if you use 'line valid' as HD it reacts to the change from 'line invalid' to 'line valid' (or vice versa with the opposite polarity) in this case followed by counting off the length of the line to capture as opposed to capturing only while 'line valid' is active. The same applies to the frame valid signal with VD, it is the edge that tells the CCDC to prepare to begin clocking in image data, not the fact that it is held in an active state. In the case of figure 8 that you mention it is actually showing a positive polarity, where the start of the frame is shown by the rising edge of HD and VD, at which point the CCDC waits SLVn lines and SPH pixels before actually capturing data, if it was negative polarity the 'valid data area' would be shifted down by SLVn and over by SPH.To put it another way, even though this diagram lines up such that it appears the width of the HD and VD pulses determines the start of the valid data area, there is actually no correlation.

    I apologize if this sounds sort of convoluted, this can be hard to explain without a whiteboard :), so to put it more simply, in the case you describe you would want to set the polarity to positive for both HD and VD (i.e. SYN_MODE.HDPOL = SYN_MODE.VDPOL = 0). This implies that the HD and VD signals will go high when you want to capture image data.

  • Thanks for the explanation.  I ask because I have been looking at the psp vpfe driver for the dm6437 to try and understand how it determines when a frame is finished capturing.  My guess is that it uses the vdint0 or 1.  I found the function in the driver source used to set this value, but I haven't tracked down any calls to it yet.  I want to take single images and start image processing them asap, so its important to know when a new frame is ready.

  • The driver seems to use VDINT as you suggest (not sure if 0 or 1) so that it knows when a frame has completed (or more specifically that the configured number of lines has been captured since VD), and can react accordingly. What you end up doing is configuring the VDINT register such that the interrupt happens after the appropriate number of lines have been captured based on your incoming image format, so looking back on figure 8 as we were discussing this means that the VDINT register VDINTn field should be set to a value of the sum of SLVn (number of lines from VD to valid data) and NLV (number of lines of valid data) such that you get an interrupt just after the last line of the frame is captured.

    If you want to get fancy you can go into modifying the driver to use both interrupts, and tweak when the events come in with the VDINT register so you could theoretically start processing part of the image before all of it is captured, of course this depends on your algorithm's requirements and system level issues and is getting beyond the scope of what I have seen done before, I assume this is the sort of optimization you are suggesting by this inquiry?

  • DM6437 PSP VPFE driver uses VDINT0 to process frame capture.