mrjohnk / ADNS-9800

Avago ADNS-9800 Test
94 stars 41 forks source link

Setting sensor resolution #11

Open kabrio opened 6 years ago

kabrio commented 6 years ago

It would be great if someone could confirm my thoughts here:

If I want to set the sensor resolution using Teensy example (ADNS9800test.ino) to a (higher) value, I would write:

  //set sensor resolution: Configuration_I for x-Axis, Configuration_V for y-Axis
  //0x12 = 3600 cpi 
  adns_write_reg(REG_Configuration_I, 0x12 );
  adns_write_reg(REG_Configuration_V, 0x12 );

in performStartup() after the laser is set & delay(1)?

And if I want to check i could then call

adns_read_reg(REG_Configuration_I);

Could someone please confirm, I am uneasy in these things : |

kabrio commented 6 years ago

Okay, seems to work. Greatly improves the sensor's working (at least in our case.).

sharlalka commented 6 years ago

Can you detail on how you set the value of 0x12 to 3600?

was it just adns_write_reg(REG_Frame_Capture ,3600) ? I am trying to do the same and am not sure if this is the correct way

mrjohnk commented 6 years ago

You would write this value in hexidecimal like this:

digitalWrite(ncs,LOW); adns_write_reg(REG_Configuration_I, 0x12); digitalWrite(ncs,HIGH);

3600 / 200 = 18 (base 10) 18 = 12 (hexidecimal)

Some example values:

Configuration_I Register ValueApproximate Resolution (cpi) Description 0x01 200 Minimum 0x09 1800 Default 0x24 7200 0x29 8200 Maximum

On Sat, Jun 2, 2018, 11:11 PM sharlalka notifications@github.com wrote:

Can you detail on how you set the value of 0x12 to 3600?

was it just adns_write_reg(REG_Frame_Capture ,3600) ? I am trying to do the same and am not sure if this is the correct way

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mrjohnk/ADNS-9800/issues/11#issuecomment-394133663, or mute the thread https://github.com/notifications/unsubscribe-auth/ABG0-WAf4V6Oigjww87VOV2qnzYnu3xXks5t42IJgaJpZM4Teio3 .