UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Adam Taylor’s MicroZed Chronicles, Part 126: More Python 1300C Features in the EVK

by Xilinx Employee on ‎04-12-2016 09:52 AM (18,366 Views)

 

By Adam Taylor

 

 

With the Avnet EVK (Embedded Vision Kit) demo up and running, I thought it would be a good idea to explore more of the Python 1300C image sensor’s capabilities in depth because it is packed full of features. First we are going to look at some status reporting we can add.

 

Our initial design got the camera up and running. However, it does not provide much information on the status of the Python camera receiver module. Knowing the status of the camera receiver module is useful because it provides us with information on black lines and pixels, the number of frames sent by the sensor, and information on the number of windows (I’ll explain later). Most importantly, sensor status tell us how well our implementation is performing. This is especially helpful if we are trying to debug and establish our system.

 

The API provided to drive the camera module has a function called onsemi_vita_get_status(), which gets the Python receiver status. To read this status, we need to use the existing pointer to the Python receiver and a new pointer to the status type:

 

 

Image1.jpg

 

Receiver Status Type

 

 

To use this in our code, we need to update our demo type where we declare instances and pointers for each of the peripherals within our design:

 

 

Image2.jpg

 

 

Demo Structure of peripherals

 

 

Notice that I have used the onsemi_python_status_t in place of the onsemi_vita_status_t as shown in the receiver type. This is because the header file for the API maps these for us. Within the code all I had to do then was call the function and tell it to be verbose so that it would print out the status over the RS232 link.

 

 

onsemi_vita_get_status( pdemo->pPython_receiver, pdemo->pPython_status, 1 )

 

 

When I added this into the code we developed last week, I obtained the following results in the terminal window:

 

 

Image3.jpg 

Results from running the updated code

 

 

It is pretty simple to interpret most of this information. However, for the sake of clarity I am going to explain what these statistics mean:

 

  • Black Lines – The sensor calibrates the black level for each frame. This allows the receiver to determine what the black level is for that frame.
  • Image Lines – The number of lines detected in the images received from the camera module.
  • Black Pixels – The number of black pixels contained within the Black Lines .
  • Image Pixels – The number of image pixels contained within the image lines.
  • Frames – The number of frames received when the status was gathered.
  • Start and End lines – The number of frame starts and frame ends received.
  • End Start Difference – The difference between the number of received frame starts and ends. This number should be zero.
  • Clocks – The number of clocks per frame.

 

 

This leaves the window parameter. What is really cool about the Python 1300C and most CMOS devices is that we can configure a smaller region of interest in the array and just read that out. This allows us to create smaller video frames and, as such, a faster read out.

 

 

Image4.jpg

 

Example of the Window within the image array

 

 

You can configure the Python 1300C with as many as eight windows using the SPI interface. Seeing the number of windows in the sensor status tells us if our windowing has been correctly configured.

 

I have updated the code example from last week to periodically (approx. once a second) update the status and output it over the serial link. The code is available on the GitHub.

 

Incidentally I am attending the Embedded Systems Conference in Boston this week. If you want to learn more about high-level synthesis using the Xilinx SDSoC development environment and how you can apply lessons learned from space FPGA development here on earth, come along and say hello.

 

 

 

 

The code is available on Github as always.

 

If you want E book or hardback versions of previous MicroZed chronicle blogs, you can get them below.

 

 

 

  • First Year E Book here
  • First Year Hardback here.

 

 

MicroZed Chronicles hardcopy.jpg 

 

 

 

  • Second Year E Book here
  • Second Year Hardback here

 

 

MicroZed Chronicles Second Year.jpg 

 

 

 

You also can find links to all the previous MicroZed Chronicles blogs on my own Web site, here.

 

 

 

 

 

Labels
About the Author
  • Be sure to join the Xilinx LinkedIn group to get an update for every new Xcell Daily post! ******************** Steve Leibson is the Director of Strategic Marketing and Business Planning at Xilinx. He started as a system design engineer at HP in the early days of desktop computing, then switched to EDA at Cadnetix, and subsequently became a technical editor for EDN Magazine. He's served as Editor in Chief of EDN Magazine, Embedded Developers Journal, and Microprocessor Report. He has extensive experience in computing, microprocessors, microcontrollers, embedded systems design, design IP, EDA, and programmable logic.