Difference between revisions of "Quantek QT1010"

From LinuxTVWiki
Jump to: navigation, search
m (set_parameters)
m (set_parameters)
Line 262: Line 262:
 
* write freq_slot8 to tuner register 28
 
* write freq_slot8 to tuner register 28
 
* write 0xFD to tuner register 17*
 
* 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
  
 
[[Category:Tuners]]
 
[[Category:Tuners]]

Revision as of 21:52, 28 December 2009

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)
  • 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