I'm using two ADV212 devices on a prototype board, one as an encoder and one as a decoder. They are both set up with a video interface (PAL 4:2:2) and both use the JDATA mode for transferring the data to/from an FPGA. The host ports are 16 bit and connect to a PIC microcontroller. The firmware is stored in the flash memory of the micocontroller.
The firmware files are:
After some experimenting (to sort out the big endian stuff, which got very confusing) I can now load both devices with their respective firmware and get to the point where the software ID verifies.
The one thing that didn't work for me, following the procedure given in the ADV212_ProgrammingGuide_2.0.pdf for JDATA encode, was the instruction to set EDMOD=0x061B BEFORE checking the ID. Setting it after, as shown in the ADV202 programming guide, did work.
The encoder seems to work: if I pull a JP2 file out of the memory where it is stored and look at it on a PC I see a reasonable looking picture. However, if I give that image to the decoder it won't decode it. I say the encode SEEMS to work because one viewer I have won't display the file. The Kakadu viewer displays the file ok; Paintshop Pro shows the file ok; but the OpenJPEG viewer doesn't (the application crashes).
What I'm seeing with the decoder is that the valid signal goes active, stays active for about 75.89uS (that works out at something like 2049 cycles of my 27MHz MCLK), and then goes inactive for about 1.3mS before trying again (the FPGA can supply data continuously at the MCLK rate without having to hold off the decoder). Obviously the decoder doesn't like the data, but does the behaviour here give any clues as to why not? Is the decoder trying to pull in the amount of data it thought was specified in the header or am I looking at some kind of timeout where it just gives up after a certain set period?
In reality, it's most likely that the problem lies with my memory controller and the path to the decoder, but it would be a shame to spend a lot of time on that only to find that the real problem was on the encoder side of things, so any thoughts on how to approach this would be appreciated. (I did wonder about trying to display an image created on the PC, but there's a question mark in my mind over whether any of these applications would generate the video 4:2:2 image properly and whether they might use features of JPEG2000 that maybe weren't supported by the decoder.)