From ba07d6a7defe5b7ec2334caf485b675d7ee7733c Mon Sep 17 00:00:00 2001 From: Florian Agbuya Date: Wed, 28 Aug 2024 12:34:31 +0800 Subject: [PATCH] fix software reset --- fast-servo/pyfastservo/dac.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fast-servo/pyfastservo/dac.py b/fast-servo/pyfastservo/dac.py index 49319d8..cb9d5a7 100644 --- a/fast-servo/pyfastservo/dac.py +++ b/fast-servo/pyfastservo/dac.py @@ -46,7 +46,7 @@ def spi_read(spi, address): return rx_buffer[1] def hard_reset(spi): - spi_write(spi, 0x00, 0x10) # Software reset + spi_write(spi, 0x00, 0x20) # Software reset spi_write(spi, 0x00, 0x00) # Release software reset spi_read(spi, 0x00) # Read reset address (necessary for reset to take effect) @@ -58,7 +58,7 @@ def check_version(spi): def configure_dac(spi): power_down_reg = spi_read(spi, 0x01) spi_write(spi, 0x01, power_down_reg & ~(1 << 0)) # Clear EXTREF bit for internal reference - # spi_write(spi, 0x0D, 0x00) # Set RREF to 10 kΩ for 1.0V reference + spi_write(spi, 0x0D, 0x00) # Set RREF to 10 kΩ for 1.0V reference spi_write(spi, 0x04, 0xA0) # Enable on-chip IRSET (1.6 kΩ for 20mA output) spi_write(spi, 0x07, 0xA0) # Enable on-chip QRSET (1.6 kΩ for 20mA output) spi_write(spi, 0x05, 0x00) # Disable internal IRCML