Other Parts Discussed in Thread: TIDA-00643
Hi,
Finding strange issues when modifying registers in my DRV8305 via SPI. When trying to modify in a lab the registers and I read back the same same registers to make sure they have changed, I keep reading deault values. Checked SPI buffer meage is correct, and I doubt it is an SPI protocol issue (otherwise I would be reading 0's instead of deafults). Unfortunately I don't have a scope to show the signals... any ideas of what could be going wrong?
Please find the added code to lab 3a below: (Also modified the SCS function to manual low/high for each SPI transmission in hal.c, as done in reference design TIDA-00643.)
#ifdef DRV8305_SPI
// turn on the DRV8305 if present
HAL_enableDrv(halHandle);
// initialize the DRV8305 interface
HAL_setupDrvSpi(halHandle,&gDrvSpi8305Vars);
#endif
//ADDED:
gDrvSpi8305Vars.Ctrl_Reg_05.IDRIVEP_HS = ISour_HS_0p500_A;
gDrvSpi8305Vars.Ctrl_Reg_05.IDRIVEN_HS = ISink_HS_0p500_A;
gDrvSpi8305Vars.Ctrl_Reg_05.TDRIVEN = TSour_1000_ns;
gDrvSpi8305Vars.Ctrl_Reg_06.IDRIVEP_LS = ISour_LS_0p500_A;
gDrvSpi8305Vars.Ctrl_Reg_06.IDRIVEN_LS = ISink_LS_0p500_A;
gDrvSpi8305Vars.Ctrl_Reg_06.TDRIVEP = TSink_1000_ns;
gDrvSpi8305Vars.Ctrl_Reg_0A.GAIN_CS1 = Gain1_20VpV;
gDrvSpi8305Vars.Ctrl_Reg_0A.GAIN_CS2 = Gain2_20VpV;
gDrvSpi8305Vars.Ctrl_Reg_0A.GAIN_CS3 = Gain3_20VpV;
gDrvSpi8305Vars.Ctrl_Reg_07.DEAD_TIME = DeadTime_2000_ns;
gDrvSpi8305Vars.Ctrl_Reg_09.EN_SNS_CLAMP = 1;
gDrvSpi8305Vars.Ctrl_Reg_09.SLEEP = 0;
gDrvSpi8305Vars.WriteCmd=true;
HAL_writeDrvData(halHandle,&gDrvSpi8305Vars);
gDrvSpi8305Vars.ReadCmd=true;
HAL_readDrvData(halHandle,&gDrvSpi8305Vars);