ni_pcimio: fix minimum AO period for NI 625x and NI 628x
authorIan Abbott <abbotti@mev.co.uk>
Wed, 2 Jan 2013 14:56:36 +0000 (14:56 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Wed, 2 Jan 2013 14:56:36 +0000 (14:56 +0000)
Follow patch submitted to the "staging" sources by Éric Piel, who writes:

The minimum period was set to 357 ns, while the divider for these boards
is 50 ns. This prevented to output at maximum speed as ni_ao_cmdtest()
would return 357 but would not accept it.

Not sure why it was set to 357 ns (this was done before the git history,
which starts 5 years ago). My guess is that it comes from reading the
specification stating a 2.8 MHz rate (~ 357 ns). The latest
specification states a 2.86 MHz rate (~ 350 ns), which makes a lot more
sense.

Tested on a pci-6251.

Thanks for the fix, Éric!

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
comedi/drivers/ni_pcimio.c

index b2025f6b4b0be8c894c812641537dd3d3f9525be..b2126df3d62b071bd075724e64cf5c9c808f9007 100644 (file)
@@ -1021,7 +1021,7 @@ static const ni_board ni_boards[] = {
                        .ao_range_table = &range_ni_M_625x_ao,
                        .reg_type = ni_reg_625x,
                        .ao_unipolar = 0,
-                       .ao_speed = 357,
+                       .ao_speed = 350,
                        .num_p0_dio_channels = 8,
                        .caldac = {caldac_none},
                        .has_8255 = 0,
@@ -1040,7 +1040,7 @@ static const ni_board ni_boards[] = {
                        .ao_range_table = &range_ni_M_625x_ao,
                        .reg_type = ni_reg_625x,
                        .ao_unipolar = 0,
-                       .ao_speed = 357,
+                       .ao_speed = 350,
                        .num_p0_dio_channels = 8,
                        .caldac = {caldac_none},
                        .has_8255 = 0,
@@ -1059,7 +1059,7 @@ static const ni_board ni_boards[] = {
                        .ao_range_table = &range_ni_M_625x_ao,
                        .reg_type = ni_reg_625x,
                        .ao_unipolar = 0,
-                       .ao_speed = 357,
+                       .ao_speed = 350,
                        .num_p0_dio_channels = 8,
                        .caldac = {caldac_none},
                        .has_8255 = 0,
@@ -1095,7 +1095,7 @@ static const ni_board ni_boards[] = {
                        .ao_range_table = &range_ni_M_625x_ao,
                        .reg_type = ni_reg_625x,
                        .ao_unipolar = 0,
-                       .ao_speed = 357,
+                       .ao_speed = 350,
                        .num_p0_dio_channels = 32,
                        .caldac = {caldac_none},
                        .has_8255 = 0,
@@ -1114,7 +1114,7 @@ static const ni_board ni_boards[] = {
                        .ao_range_table = &range_ni_M_625x_ao,
                        .reg_type = ni_reg_625x,
                        .ao_unipolar = 0,
-                       .ao_speed = 357,
+                       .ao_speed = 350,
                        .num_p0_dio_channels = 32,
                        .caldac = {caldac_none},
                        .has_8255 = 0,
@@ -1150,7 +1150,7 @@ static const ni_board ni_boards[] = {
                        .ao_range_table = &range_ni_M_628x_ao,
                        .reg_type = ni_reg_628x,
                        .ao_unipolar = 1,
-                       .ao_speed = 357,
+                       .ao_speed = 350,
                        .num_p0_dio_channels = 8,
                        .caldac = {caldac_none},
                        .has_8255 = 0,
@@ -1169,7 +1169,7 @@ static const ni_board ni_boards[] = {
                        .ao_range_table = &range_ni_M_628x_ao,
                        .reg_type = ni_reg_628x,
                        .ao_unipolar = 1,
-                       .ao_speed = 357,
+                       .ao_speed = 350,
                        .num_p0_dio_channels = 8,
                        .caldac = {caldac_none},
                        .has_8255 = 0,
@@ -1205,7 +1205,7 @@ static const ni_board ni_boards[] = {
                        .ao_range_table = &range_ni_M_628x_ao,
                        .reg_type = ni_reg_628x,
                        .ao_unipolar = 1,
-                       .ao_speed = 357,
+                       .ao_speed = 350,
                        .num_p0_dio_channels = 32,
                        .caldac = {caldac_none},
                        .has_8255 = 0,