-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Working with original dvb-usb-dw2104.fw? #7
Comments
I found another difference: The original firmware sets IFCONFIG = 0xcb, where your firmware sets IFCONFIG = 0x03. This means, the original firmware uses asynchronous slave FIFO mode, where your firmware uses synchronous slave mode. For the wiring, this means:
In your schematic, demod Data_Valid is connected to SLWR, so that IFCLK is ignored while SLWR is inactive. I'm not quite sure how the original firmware handles this. Maybe the demod does not use Data_Valid at all - it can just stop CLKOUT when no data is being transmitted, but this might be configurable. But maybe it needs demod Data_Valid connected to SLCS, which would then require a certain output polarity on demod side, because it is not configurable on the FX2 side. |
Oh hi jonny, I am a bit away from the details. In asynchronous mode (IFCONFIG.3 = 1), SLRD and SLWR So i use data_valid to let the clock input the data if active. PORTA alternate Pin configurations is activated when IFCONFIG = 0x03; enabling slave fifo mode. i dont have the original hardware so i dont know if my firmware works on it. i guess not. you seem to have the original sourcecode. ? |
I don't have the original source code, just a disassembly, and the 8051 code is relatively easy to read. Actually I'm designing my own DVB device PCB (also with the FX2 chip), so I'm using any opportunity to study the details, hoping to limit the number of bodge wires necessary. Also I hope that I can reuse some existing FX2 firmware - because getting all the details right seems like a nightmare, and sharing a self-written firmware binary based on the Cypress libraries seems legally questionable. I've digged a little more and can see that the original dvb-usb-dw2104.fw sets PORTACFG = 0, i.e. the SLCS pin function is disabled (even though the CX24116 would allow to adjust the Data_Valid polarity via MPEGConfig/MPGValidPol register to match what the FX2 expects). So, my interpretation is that on the original hardware, Data_Valid is not used and that the demod only generates CLKOUT edges when there is valid data transmitted. The CX24116 allows that by setting the MPEGConfig/MPGClkGap register to 1. The weird thing is that the linux driver (drivers/media/dvb-frontends/cx24116.c, search for CMD_MPEGCONFIG) does NOT set this bit. As you are confirming that you observed data_valid actually toggling, I have no clue how Linux driver can work with the original firmware and hardware... |
Maybe I have found the explanation how it works. The Linux driver sets the MPEGConfig/MPEGSyncPunc bit to 1, which enables "Sync word is punctured" behavior. I admit that I never heard the term "puncture" in context of a digital signal, but I'm guessing that this means that the demod SYNC signal is pulled low when the 188-byte TS packet ends (and the high-low edge triggers sending the packet via USB) and then also KEPT low while the error detection/correction bytes are sent. While I find no clear evidence in the FX2 TRM, I'm assuming that keeping PKTEND low also leads to SLWR edges being ignored. I will base my PCB on that assumption, but also keep all other pins routed to pin headers, just in case. Not sure if you are still working on the project, but maybe this helps you to also switch to the original firmware and frees you from the burden of maintaining your own. |
Thinking some more, I guess demod data_valid is simply connected to FX2 PKTEND. This could make it compatible also to other demods. |
Ok, so you are disassembling the original firmware file to evaluate how it works. |
My primary goal of the disassembly is to make a hardware which is compatible with the existing firmware. It will be based on a different NIM (with Montage tuner & demod). I will probably publish it under an open hardware license, so everybody can adapt it to other NIMs. As DVB usage seems to be declining more and more it might be an opportunity to recycle old hardware. Together with a Raspberry Pi it makes a nice STB - this would have been a popular device in the 2000s and early 2010s, but nowadays I guess not many people will be interested. So now it mainly serves for my self-education with PCB design and switching power supplies and linear voltage regulators... |
yeah DVB usage is declining. |
Does your hardware work with the original dvb-usb-dw2104.fw? From what I can see, the original one uses PA6 for h/v control (instead of PD0 in your schematic). But apart from this, it should work?
The text was updated successfully, but these errors were encountered: