1
0
Fork 0

fix software reset

This commit is contained in:
Florian Agbuya 2024-08-28 12:34:31 +08:00
parent 0f628aecc7
commit ba07d6a7de
1 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ def spi_read(spi, address):
return rx_buffer[1] return rx_buffer[1]
def hard_reset(spi): 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_write(spi, 0x00, 0x00) # Release software reset
spi_read(spi, 0x00) # Read reset address (necessary for reset to take effect) 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): def configure_dac(spi):
power_down_reg = spi_read(spi, 0x01) 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, 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, 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, 0x07, 0xA0) # Enable on-chip QRSET (1.6 kΩ for 20mA output)
spi_write(spi, 0x05, 0x00) # Disable internal IRCML spi_write(spi, 0x05, 0x00) # Disable internal IRCML