Archive for 2014

GSoC Project Report: VGA capture expansion board for HDMI2USB on Digilent Atlys

GSoC Project Report: VGA capture expansion board for HDMI2USB on Digilent Atlys

GSoC Result Summary


Original Goals

The goal of this project was to develop a VGA Capture expansion board for HDMI2USB on Digilent Atlys. The deliverables for the project were usable product with associated hardware, software and documentation.

Fine details of original goals were:
  • Working PCB for VGA Capture
  • Working VGA Capture code for the hardware
  • Integration of this code with HDMI2USB
  • EDID Capability for the VGA Capture expansion board
  • Documentation for all the code and hardware
Original Proposal: http://goo.gl/rRtSrS

Final Outcome:

I achieved quite significant success, along with associated failures, in this project. While I failed to reach all the original proposed goal I have succeeded in getting the following working:
  • Nice and working PCB for VGA Capturing using Atlys
  • Working, but not perfect, VGA Capture HDL code
  • Integrated the VGA capture code into HDMI2USB.

The Expansion PCB features a VGA digitizing IC from Analog Devices, AD9984A and has support for auto-detection and as well as EDID. Its design is production-ready unless issues crop in future during continued development on this project.
top.pngbottom.png
DSC00446.JPG
The VGA capture code, on other hand, needs improvement and ruggedness to field working environment. It is currently working very well with the latest PCB version, but continued development is required on it.


Community Outcome

With this project. I was able to get VGA capture working, albeit not perfectly. Most of the project time duration was spent on PCBv01, which was later realized to be buggy, after testing the PCBv02. I created a new PCB design which was fabricated by hackvana and I tested it. It has significant improvements over previous design namely test pads, intuitive layout, length-matched traces, VGA splitter output, autodetection capability, EDID capability and friendly silkscreen. Most importantly, it works much better than previous version!
The code is rudimentary, but it works. It is able to capture digitized VGA sent by AD9984A and output it using HDMI. It also features a picoblaze core for I2C configuration of AD9984A. Missing  features are autodetection, EDID hacking capability and most important, automated test infrastructure.
Upon completion, the major benefit this project provides is giving VGA capture capability to HDMI2USB hardware using expansion board. Minor benefits it provides are autodetection feature for boards, UART-I2C bridge, EDID hacking & logging and test infrastructure (not yet

How to replicate results


Required:
  1. Digilent Atlys
  2. Properly set up Xilinx and Digilent toolchain. Refer to HDMI2USB Wiki for this
  3. VGA Capture Expansion PCB

Repositories:


One can either directly order PCBs using the Gerbers present in the repository or modify the KiCad files and generate own gerbers. The silkscreen is labelled with each component and values for easier assembly.

Once the PCB is successfully assembled, its time to test them. Start with testing power supplies at the labelled test points (VD, PD & OVDD). They should be 1.8V, 1.8V & 3.3V respectively.

Now one can load the bitfile from HDMI_Test_v06 repo or HDMI2USB-vModVGA-TestBitFiles repo. The name of bitfile is hdmi_test_v06.bit.
For those willing to modify/edit/improve the code, use the HDMI_Test_v06  repository and load the project into Xilinx ISE, modify code as per your ideas and generate bitfile for flashing into Atlys.
There is no need for any I2C initialization for AD9984A as I’ve added I2C core into the projects. Even then if you want to see I2C Initialization scripts for BeagleBoneBlack, then they are located in i2c directory.
For any issues or help you can contact me on IRC: rohitksingh on #timvideos channel or Email: rohit.singh@gmx.com. I would be very happy to help

To Do / How to help?

There are quite a few issues still remaining with VGA Capture HDL code. I encourage everyone to fork and develop code for the VGA capture. I have 11 spare Rev02 PCBs remaining with me, and would happily courier one to anyone interested in contributing in development.

Here are issues remaining:
  • Major:
    • Improve/cleanup the VGA Capture code
    • Add automated test & verification feature
  • Minor:
    • Add EDID hack feature
    • Add Autodetection code.
    • Add UART-I2C bridge

Documentation:


Learnings

I have to admit I learned *significantly* during the whole project duration. Learnings I would cherish lifelong are Git(Hub), KiCad, improved SMD soldering skills, vast VHDL experience especially on clock issues etc and finally basics of open-source development and community culture! I wonder how I survived without Github until now. Having used KiCad so much during these months, I feel like an outsider to Eagle now. I made many new wonderful friends during the project duration! And best of all, I’m now officially a hardware hacker of HDMI2USB!




Posted in | Leave a comment

[GSoC Daily Log]

Monday, 18th August 2014:

  • Tested VGA Capture code using Rev02 PCB.
  • My initial code (non-FIFO implementation) is working excellent!
  • But ironically, the FIFO implementation is not working on new PCB!

Posted in , | Leave a comment

[GSoC Daily Log]

Sunday, 17th August 2014:
 
  • Soldered the remaining components like Bypass caps and VHDCI connector.
  • IC is responding to I2C Hurray! :)

Posted in , | Leave a comment

[GSoC Daily Log]

Tuesday, 12th August, 2014:

  • Had to go to college. So, no work planned for today

Posted in , | Leave a comment

[GSoC Daily Log]

Monday, 11th August, 2014:

  • Tried using replacing the IC on assembled PCB from my spare AD9984A IC. In the process a pad on PCB got broken! :( Will have to do complete assembly from scratch on new PCB. Also got a burn injury on my finger when accidently touched the soldering iron. In short, Bad day!

Posted in , | Leave a comment

[GSoC Daily Log]

Sunday, 10th August, 2014:

  • Assembling completed. One PCB got damaged, due to its pad getting broken. (Either the PCB is slightly delicate or I’ve forgotten my soldering techniques :/ )
  • Power supplies working fine, but IC is not respnding to I2C.Very discouraging!  I was really excited to try work with my new board. Anyways, time for debugging.

Posted in , | Leave a comment

[GSoC Daily Log]

Saturday, 9th August 2014:

  • Received the PCBs!
  • Went shopping for some out-of-stock passives for assembling the PCBs. 10nf, 100nf, 22uF and 47uF SMD caps and 4.7K SMD resistors
  • Started assembling a PCB




Posted in , | Leave a comment

[GSoC Daily Log]

Friday, 8th August 2014:

  • Went to college. Wasn’t able to do any work

Posted in , | Leave a comment

[GSoC Daily Log]

Thursday, 7th August 2014:
  • Went to college. Wasn’t able to do any work

Posted in , | Leave a comment

[GSoC Daily Log]

Wednesday, 6th August 2014:

  • Went to college. Wasn’t able to do any work.

Posted in , | Leave a comment

[GSoC Weekly Overview]

This week although started great, ended becoming most unsatisfactory and least productive week of my GSoC duration!

I2C & VGA Capture

As mentioned in previous weekly overview, PCBs, have been sent for fabrication. After that I set on fixing the I2C part so that my mentor can try my bitfiles without much headache. I had purchased a logic analyser just a week back, specially for I2C debugging and, God!, it was really helpful in identifying problems in code. I fixed the I2C code and added it to VGA Capture code, thus eliminating need for any other setup for AD9984A initialization.
I also tried I2C using picoblaze, which interestingly used same resources as standalone I2C core.
Rest of the week was unproductive with respect to my project as my college has opened, and almost 4 days were lost to semester registrations, assignments,  and training conducted by Training & Placement (TnP) department.

Although, I was able to complete the 2-FIFO implementation, and simulate it. On, actual hardware, every alternate line is skipped by it on the screen, which it shouldn’t. As of writing this post, I’m currently testing the code on Atlys and trying to ascertain it reason.

Update: Just now I found out the reason for every alternate skipped lines. It was due to incorrect FIFO switching.
There is also a new weird issue. If the screen has only a background and no windows, then the video captured is very stable, but if I drag a window to the screen, the capture becomes unstable, and also some pixels are shifted! I’ll add a video of this phenomenon later today.

Upcoming Week:

I’ll be focussing on completing the code this week, so that the final week could be used for finishing touches and documentation. Also, upon receiving the PCBs, I’ll assemble and test them. They should hopefully offer better performance and color clarity than current PCB.

Posted in , | Leave a comment

[GSoC Daily Log]

Sunday, 3rd August 2014:

  • Simulating the 2-FIFO implementation. Problem in switching FIFO. Will have to look at code again
  • Update: Okay. It was the testbench’s fault;  never lowered down the reset! Silly mistake #facepalm

Posted in , | Leave a comment

[GSoC Daily Log]

Saturday, 2nd August, 2014:

  • Completed assignment, went to college for its submission

Posted in , | Leave a comment

[GSoC Daily Log]

Friday, 1st August, 2014:

  • Did the pending college assignment

Posted in , | Leave a comment

[GSoC Daily Log]

Thursday, 31st July 2014:

  • Worked on 2-FIFO implementation

Posted in , | Leave a comment

[GSoC Daily Log]: Fixed I2C Problems in VHDL


Wednesday, 30th July 2014:

  • Fixed I2C problem with code.
  • Also, tried I2C using Picoblaze softcore processor. Seems good. Uses similar resources.

Posted in , | Leave a comment

[GSoC Weekly Overview]: PCB sent for Fab!

The biggest news of this week was PCB being sent for Fab to Hackvana!

Here is the design sent to Fab: http://gerblook.org/pcb/JB6z7ixXL2hbVSKhU6CjCk

KiCad Design files are on the repository: https://github.com/rohit91/HDMI2USB-vmodvga

Pictures:


Front:

PCB Front


Back:
 
PCB Back

Upcoming Week:

With the PCB sent for fab, I’ll order 0.1uF 0805 caps, since I don’t have them and they are required in PCB Rev02. Some other components required will also be ordered. And, I’ll be moving back to working on VGA capture and fixing I2C problem.

Posted in , | Leave a comment

[GSoC Daily Log]

Saturday, 26th July 2014:

  • Felt unwell. (Maybe due to drinking chilled water in monsoons? This one gets added to my ‘Things to avoid’ list). Slept a lot.

Posted in , | Leave a comment

[GSoC Daily Log]:

Friday, 25th July 2014:

  • Completed routing of PCB (w/o length-matching). Fixed Issues with silkscreen, ground plane and other issues listed on github. Now trying length-matching

Posted in , | Leave a comment

[GSoC Daily Log]:

Thursday, 24th July 2014:

  • Looked on various ways to do length-matching. Tried Freerouter. Unsuccessful. Patched KiCad’s source with code from https://bugs.launchpad.net/kicad/+bug/594089. Compilation (make clean)  failed 3 times. Succeeded on last try. But ate up most of the time. Also, it turned out to be not too intuitive.

Posted in , | Leave a comment

[GSoC Daily Log]:

Wednesday, 23rd July 2014:

  • PCB Design started from scratch. Changed components placement, PCB dimensions, and layout. Initial routing 40% done. Without length-matching.
  • Fixed some issues listed on github

Posted in , | Leave a comment

[GSoC Weekly Overview]: PCB!

This week was all about PCBs. Although I did work first 2 days of the week on VGA Capture code, but once the components ordered from Mouser arrived, I had to get to the task of assembling the PCB. I also got inducted into TimVideos Hardware Hackers Team! Wooohooo!! Felt awesome! But, that also means I have to get a deeper understanding of git. I got reminded of this quote (from Spiderman I guess?) “With great power comes great responsibility”

PCB v01:

The most difficult part in the soldering the PCB were the 0402 package resistor networks. They were  huge pain. Whatever and however you do the soldering, some pads would either get bridged or remain unconnected at all! Due to repeated soldering, the remaining components and PCB were also getting heat stressed, which is not a good thing to happen.
Once satisfactorily soldered the resistor networks, I soldered the remaining components namely ADP3334 voltage regs, ferrite beads and some decoupling caps.
After the soldering and cleaning (since huge amount of flux remained stuck after soldering), it was time to test the board.
Upon connecting it with power supply, all the voltages were normal. Next job was to check if the chip was responding or not. I soldered 2 wires on I2C_SDA and I2C_SCL lines and connected them to BeagleboneBlack and ran the python scripts for AD9984A initialization and reading. Yeah, the chip was working fine. Next job was to test the signals coming out of the IC. I loaded the AD9984A test bitfiles I had created previously. The HSOUT, VSOUT and DATACK signals were fine. So, the PCB was working fine and was ready to ship.

I shipped the PCB using DHL to my mentor yesterday itself. Now the time was to focus on PCB-v02. Tracking Link

PCB v02:

The third day of week was mostly spent of schematic and netlist parts association. Having finalized the footprint that I would be using, it was time for PCB routing. In the meantime, after discussion from Joelw on IRC I got to know that those (tiny monsters) resistor networks were redundant since Atlys already has 50ohms resistors on each lines of VHDCI signals. Happy with the information, I quickly removed the resistor networks and associated standalone resistors. The last 2 days were spent routing and correcting the schematic. Yeah, while routing, I encountered at least 7 errors(better word: mistakes) in schematic, like I2C pullup resistors accidently connected to same line! The PCB is now fully routed. Some tweaks and changes might be done before sending it for fab. I used same design rules and track-width and drills as in Jahanzeb’s version. All DRC errors are resolved now. The VHDCI connector, although, seems treacherous. It has very tight clearances, pushing the DRC to limits. But, I suppose I have to contend with it. Hopefully the fab correctly routes it.

The current design looks like this:
Screenshot - 22_07_2014 , 2_24_00 AM.png


Upcoming Week:

With the PCB sent to fab after slight tweaks etc, I’ll get time to work on VGA Capture. I couldn’t work on that in this week due to more attention provided to the PCB. But, now I can work on the capture. The FIFO based implementation looks promising. I’m planning a 2-FIFO based buffer this week to see if I can perfectly stabilize the capture or not. If it works then I’ll integrate I2C with the code. After that, I’ll move onto integration with current HDMI2USB. Although, a better way would be to say testing with code integrated on HDMI2USB since I’ve already integrated the capture module into HDMI2USB, so only testing with perfect capture is required. But, the most important task is to get capture perfect, which is still eluding me!

Posted in , | Leave a comment

[GSoC Daily Log]:

Monday, 21st July 2014:

  • PCB Routing complete. Ready for review. Some minor changes & tweaks may be done before sending for Fab. Github

Posted in , | Leave a comment

[GSoC Daily Log]:

Sunday, 20th July 2014:

  • PCB Routing: 70% ratsnest routed. Fine tuning remaining. Commit

Posted in , | Leave a comment

[GSoC Daily Log]:

Saturday, 19th July 2014:

  • All soldering done. Power Supply fix done. Voltages Normal
  • Next Job: Check if IC is responding using I2C.
  • Update: I2C Test Done. AD9984A Responding properly. Initialization and configuration using I2C successfully done. Connected to Atlys. DATACK, VSOUT & HSOUT Test OK.
  • That means, the second PCB of version 1 is officially now ready to ship.

Posted in , | Leave a comment

[GSoC Daily Log]:

Friday, 18th July 2014:

  • Got the package from Mouser
  • Soldered the ICs, Beads and the 0402 Resistor Networks.
  • 0603 0.1uf Caps, and then power supply ‘fix’ and then testing is remaining

Posted in , | Leave a comment

[GSoC Daily Log]:

Thursday, 17th July 2014:

  • Worked on PCB’’s schematic.
  • Added headers for unused signals.

Posted in , | Leave a comment

[GSoC Daily Log]:

Wednesday, 16th July 2014:

  • Reordered the components through Mouser. Should be delivered by Friday. Hugh shipping and customs :/
  • Writing code for 2-FIFO implementation. Tomorrow, will work on PCB

Posted in , | Leave a comment

[GSoC Weekly Overview]: Change of Plan

Big news of the week is: I have changed to Plan B implementation for capturing VGA. This change was forced due to narrowing road in the first implementation. The final nail in coffin was when even Xilinx’s AD9984A code (from UG458) gave the exact same result as my code. Gah! So, I decided enough is enough, lets move to plan B. And the results do look promising!

What’s exactly is Plan B?

In this implementation, I’m using a 24-bit wide and 4096 dept FIFO with independent read and write clocks.
Why independent clocks? Thats because the DATACK and the img_pclk are different, even though supposedly at same frequency, but they drift over time. So, I’ll be pushing data into the FIFO first using DATACK, then after slight delay, I’ll start reading it using the accurate clock img_pclk (which would be driving the whole HDMI encoder). The problem of FIFO overflow and underflow is eliminated by a simple realization that out of the complete line-scan period (1344) only 1024 cycles are the active ones. That means, I can use rest of the cycles to synchronize and reset the FIFO at the appropriate time.
I have done the simulations and just at the time of this writing, ran it on Atlys! And lo! The flickerings are gone!! The image looks perfect from a distance, but when I go near, I see the pixels shaking by 1 (or max 2) pixels. I think I can correct this using a 2-FIFO pipeline, where 1 one written and the other one is read.
I’m pretty much happy with the result of 4 days of coding and simulation.

PCBv02

Unfortunately, due to my priority to VGA Capturing (due to less and less time remaining), the target for at least a partially routable PCB was not achieved. But, the schematic is pretty much up for review. After some changes if required, I will finalize it and move to PCB routing.
Also, this week I bought my first ever Hot-Air Soldering Machine for soldering the AD9984A and other ICs to the second prototype of PCBv01. The prototype has been partially soldered. Parts remaining to be soldered are AD3334 voltage reg, Ferrite Beads and Resistor Network. I’m awaiting their delivery from Element14.

In all, I’m happy with this week. Very good progress in the capturing and some in PCB area.

Upcoming Week:

This week my goal will be to finalize the PCB and and get the VGA capture rock solid. And, I’m confident [yeah, confidence returned after 3 weeks of almost continuous failures! :) B-) ] that I’ll complete this goal. The PCB might get delayed by 1-2 days max. After that, my focus in remaining weeks would be PCBv02 testing (after receiving from fab), HDMI2USB integration (which is going to give some headache, so I’m taking some buffer time for that). Minor issues like, I2C and autodetection features are 1 or 2 day jobs max.

So, after much delay due to capturing (&timing?) headache, the project is back on track!! Feels awesome!

Posted in , | Leave a comment

Search

Swedish Greys - a WordPress theme from Nordic Themepark. Converted by LiteThemes.com.