Quantek QT1010: Difference between revisions

From LinuxTVWiki
Jump to navigation Jump to search
(QT1010 add tuner on / off, not complete though)
Line 358: Line 358:


* if curr is 1
* if curr is 1
** read tuner register 17 into reg17
** read tuner register 17 into tmp
** write reg17 logical and 0xF0 into reg17
** write tmp logical and 0xF0 into tmp
** write reg17 to tuner register 17
** write tmp to tuner register 17
* write 0x7F to tuner register 2
* write 0x7F to tuner register 2
* read tuner register 5 into tmp
* read tuner register 5 into tmp

Revision as of 13:19, 13 January 2010

The Quantek QT1010 is a wideband tuner chip.

Features

  • 48MHz-860MHz frequency range (bands I, II, III, IV).
  • 30MHz-60MHz IF output range.
  • NTSC, PAL, SECAM broadcast formats.
  • DVB-C, DVB-T, ATSC and ISDB-T support.

External Links

QT1010 Product page at qantek-inc.com

Description of how to program the chip

Tuner context

The tuner has a global context for some variables. They can be used anytime in the init and set methods.

  • reg31
  • reg32
  • reg34
  • reg34_1
  • reg34_2
  • reg34_3
  • reg34_4
  • reg34_5
  • reg34_6
  • reg34_7
  • reg34_8
  • reg37
  • reg38

Tuner Init

This method has no arguments.

  • write 0x80 to tuner register 1
  • write 0x84 to tuner register 13
  • write 0xB4 to tuner register 14* (or 0xB7 might work better on some older devices) LNA
  • write 0x23 to tuner register 42
  • write 0xDC to tuner register 44
  • write 0x40 to tuner register 37
  • write 0x00 to tuner register 30
  • write 0x81 to tuner register 30
  • loop 30 times
    • read tuner register 37 into reg37
    • if reg37 bit 8 is set
      • break out of loop
  • read tuner register 37 into reg37
  • write 0x00 to tuner register 30
  • write 0x23 to tuner register 42
  • write 0x70 to tuner register 43
  • write 0x08 to tuner register 38
  • write 0x00 to tuner register 30
  • write 0x82 to tuner register 30
  • loop 30 times
    • read tuner register 38 into reg38
    • if reg38 bit 5 is set
      • break out of loop
  • read tuner register 38 into reg38
  • write 0x00 to tuner register 30
  • write 0x14 to tuner register 5
  • write 0x44 to tuner register 6
  • write 0x28 to tuner register 7
  • write 0x0B to tuner register 8
  • write 0xFD to tuner register 17*
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • write 0x0D to tuner register 34
  • write 0x00 to tuner register 30
  • write 0xD0 to tuner register 30
  • loop 30 times
    • read tuner register 34
    • if register 34 bit 6 is set
      • break out of loop
  • write 0x00 to tuner register 30
  • write 0x40 to tuner register 6
  • write 0xF0 to tuner register 22
  • write 0x38 to tuner register 2
  • write 0x19 to tuner register 3
  • write 0x20 to tuner register 31
  • write 0xE0 to tuner register 32
  • write 0x00 to tuner register 30
  • write 0x84 to tuner register 30
  • loop 30 times
    • read tuner register 31 into reg31
    • if register 31 bit 7 is set
      • break out of loop
  • read tuner register 31 into reg31
  • read tuner register 32 into reg32
  • write 0x00 to tuner register 30
  • write 0x3F to tuner register 2
  • write 0x53 to tuner register 33
  • read tuner register 33 into reg33
  • write 0xFD to tuner register 17*
  • write 0x34 to tuner register 5
  • write 0x44 to tuner register 6
  • write 0x31 to tuner register 7
  • write 0x08 to tuner register 8
  • write 0xD0 to tuner register 34
  • write 0x00 to tuner register 30
  • write 0xD0 to tuner register 30
  • loop 30 times
    • read tuner register 34
    • if register 34 bit 6 is set
      • break out of loop
  • write 0x00 to tuner register 30
  • read tuner register 34 into reg34_1
  • write 0x32 to tuner register 7
  • write 0xD0 to tuner register 34
  • write 0x00 to tuner register 30
  • write 0xD0 to tuner register 30
  • loop 30 times
    • read tuner register 34
    • if register 34 bit 6 is set
      • break out of loop
  • write 0x00 to tuner register 30
  • read tuner register 34 into reg34_2
  • write 0x33 to tuner register 7
  • write 0xD0 to tuner register 34
  • write 0x00 to tuner register 30
  • write 0xD0 to tuner register 30


  • loop 30 times
    • read tuner register 34
    • if register 34 bit 6 is set
      • break out of loop
  • write 0x00 to tuner register 30
  • read tuner register 34 into reg34_3
  • write 0x34 to tuner register 7
  • write 0xD0 to tuner register 34
  • write 0x00 to tuner register 30
  • write 0xD0 to tuner register 30
  • loop 30 times
    • read tuner register 34
    • if register 34 bit 6 is set
      • break out of loop
  • write 0x00 to tuner register 30
  • read tuner register 34 into reg34_4
  • write 0x35 to tuner register 7
  • write 0xD0 to tuner register 34
  • write 0x00 to tuner register 30
  • write 0xD0 to tuner register 30


  • loop 30 times
    • read tuner register 34
    • if register 34 bit 6 is set
      • break out of loop
  • write 0x00 to tuner register 30
  • read tuner register 34 into reg34_5
  • write 0x36 to tuner register 7
  • write 0xD0 to tuner register 34
  • write 0x00 to tuner register 30
  • write 0xD0 to tuner register 30
  • loop 30 times
    • read tuner register 34
    • if register 34 bit 6 is set
      • break out of loop
  • write 0x00 to tuner register 30
  • read tuner register 34 into reg34_6
  • write 0x37 to tuner register 7
  • write 0xD0 to tuner register 34
  • write 0x00 to tuner register 30
  • write 0xD0 to tuner register 30


  • loop 30 times
    • read tuner register 34
    • if register 34 bit 6 is set
      • break out of loop
  • write 0x00 to tuner register 30
  • read tuner register 34 into reg34_7
  • write 0x38 to tuner register 7
  • write 0xD0 to tuner register 34
  • write 0x00 to tuner register 30
  • write 0xD0 to tuner register 30
  • loop 30 times
    • read tuner register 34
    • if register 34 bit 6 is set
      • break out of loop
  • write 0x00 to tuner register 30
  • read tuner register 34 into reg34_8
  • write 0x39 to tuner register 7
  • write 0xD0 to tuner register 34
  • write 0x00 to tuner register 30
  • write 0xD0 to tuner register 30
  • loop 30 times
    • read tuner register 34
    • if register 34 bit 6 is set
      • break out of loop
  • write 0xD0 to tuner register 30
  • read tuner register 34 into reg34

Tuner set frequency

The frequency set method has one sub-method and one subsub-method.

set_frequency

This method has the frequency argument, called freq and in kHz.

  • call set_parameters with freq and try_count equal to 0
  • if reg35 equal to 0xE0
    • call set_parameters with freq and try_count equal to 2
  • if reg35 equal to 0xFF
    • call set_parameters with freq and try_count equal to 3
  • if reg34 equal to 0xFF
    • call set_parameters with freq and try_count equal to 1

set_parameters

arguments freq and try_count

  • call calculate_parameters with freq and try_count
  • write 0x80 to tuner register 1
  • write 0x3F to tuner register 2
  • if try_count is equal to 1
    • if reg5 is less then 0x74
      • set reg5_1 to reg_5 plus 0x20
  • write reg5_1 to tuner register 5
  • write 0x44 to tuner register 6
  • write freq_slot2 to tuner register 7
  • write freq_slot1 to tuner register 8
  • write freq_slot4 to tuner register 9
  • write freq_slot5 to tuner register 10
  • write freq_slot6 to tuner register 11
  • write 0xE1 to tuner register 12
  • write freq_slot7 to tuner register 26
  • write 0x00 to tuner register 27
  • write freq_slot8 to tuner register 28
  • write 0xFD to tuner register 17*
  • write 0x91 to tuner register 18*
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • write 0x80 to tuner register 1
  • if reg5_1 is equal to 0x34
    • if freq_slot12 is larger equal to 0xF0
      • if freq_slot12 is less equal to 0xFA
        • write freq_slot12 minus 0x20 into freq_slot12
      • else
        • write 0xDA into freq_slot12
    • else
      • write 0xD0 into freq_slot12
    • write freq_slot12 into tmp_var1
  • else
    • write 0xD0 into tmp_var1
  • write tmp_var1 to tuner register 34
  • write 0x00 to tuner register 30
  • write 0xD0 to tuner register 30
  • loop 30 times
    • read tuner register 34
    • if register 34 bit 6 is set
      • break out of loop
  • write 0x00 to tuner register 30
  • read tuner register 34 into reg34
  • if reg34 is less equal to 0xFE
    • write reg34 plus 1 to tuner register 34
  • read tuner register 5 into reg5
  • read tuner register 34 into reg34
  • write 0xD0 to tuner register 35
  • write 0x00 to tuner register 30
  • write 0xE0 to tuner register 30
  • loop 30 times
    • read tuner register 35
    • if register 35 bit 6 is set
      • break out of loop
  • read tuner register 35 into reg35
  • write 0x00 to tuner register 30
  • write 0xD0 to tuner register 36
  • write 0x00 to tuner register 30
  • write 0xF0 to tuner register 30
  • loop 30 times
    • read tuner register 36
    • if register 36 bit 6 is set
      • break out of loop
  • write 0x00 to tuner register 30
  • write 0x7F to tuner register 20
  • write 0x7F to tuner register 21
  • if try_counter is equal to 1
    • if reg5 is less equalt to 0x74
      • write reg5 minus 4 into reg5_3
  • write reg5_3 to tuner register 5
  • write 0x00 to tuner register 6
  • write 0x1F to tuner register 21
  • write 0xFF to tuner register 22
  • write 0xFF to tuner register 24
  • if reg31 is greater equal to 0x50
    • write 0x50 into reg31
  • if reg32 is greater equal to 0x12
    • write 0x12 into reg32
  • write reg31 plus freq_slot10 to tuner register 31
  • write reg32 plus freq_slot11 to tuner register 32
  • write reg33 to tuner register 33
  • write reg37 to tuner register 37
  • write reg38 to tuner register 38
  • write 0x96 to tuner register 0
  • write 0x00 to tuner register 2
  • write 0x00 to tuner register 1


Tuner On/Off

This method has 1 argument, curr set to either 0 or 1

set_tuner_off

  • write 0x80 to tuner register 1
  • if curr is 1
    • read tuner register 17 into tmp
    • write tmp logical and 0xF0 into tmp
    • write tmp to tuner register 17
  • write 0x7F to tuner register 2
  • read tuner register 5 into tmp
  • write tmp logical or 0xF into tmp
  • write tmp to tuner register 5
  • write 0xFF to tuner register 6
  • write 0x00 to tuner register 1

set_tuner_on

  • write 0x80 to tuner register 1
  • write 0x00 to tuner register 2
  • read tuner register 5 into tmp
  • write tmp logical and 0xF0 into tmp
  • write tmp to tuner register 5
  • write 0x00 to tuner register 6
  • write 0x00 to tuner register 1