MC33772 GAIN is overwrite unreasonably

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MC33772 GAIN is overwrite unreasonably

2,528 次查看
Sylvia_jiang
Contributor IV

Hi NXP Community,

          I am working with MC33772 ADC2 current.  Debug situation is injecting 390A current under room temperature and ADC_CFG is initialized by 0x093F.  I found that MC33772 gain became 256 occasionally when using GPIO5-6 as inputs to the current sensor PGA with entering into diagonostic mode although gain is set fix 16. As below is procedures of entering into diagnostic mode. Is it correct? what is root cause why MC33772 gain became 256? Looking forward to your reply. 

Sylvia_jiang_0-1694069149084.png

 

0 项奖励
回复
7 回复数

2,500 次查看
JozefKozon
NXP TechSupport
NXP TechSupport

Hi Sylvia, 

please refer to the section 9.6, page 37. in the MC33772C datasheet. The PGA gain can set to fixed gain in the ADC_CFG register, address 0x06, bits [10:8] PGA_GAIN. 

JozefKozon_0-1694086497583.png

JozefKozon_1-1694086530037.png

With Best Regards,

Jozef

0 项奖励
回复

2,476 次查看
Sylvia_jiang
Contributor IV

Hi @JozefKozon ,

        Really appreciate for your reply. Issue is that Gain has been out of control and became 256 although gain is set to fixed value 16 during initialization. I don't understand why fixed gain became 256 (ADC_CFG bits [10:8]=011) ? 

2,452 次查看
JozefKozon
NXP TechSupport
NXP TechSupport

Hi Sylvia, 

please confirm, that the MC33772C is not in sleep mode. In Sleep mode, the PGA gain is constantly equal to 256. This could be a reason why the fixed gain became 256. 

JozefKozon_0-1694156110891.png

JozefKozon_0-1694156347870.png

With Best Regards,

Jozef

 

0 项奖励
回复

2,390 次查看
Sylvia_jiang
Contributor IV

Hi @JozefKozon 

         Thanks for your reply. I am sure that MC33772 is not in sleep mode. I never SPI to  SYS_CFG_GLOBAL to go to sleep mode. I found that fixed gain becoming 256 ocurred only when enable isense adc in diag mode. As below is procedures of entering into diag mode. Looking forward to your reply.

Sylvia_jiang_0-1694569417821.png

 

0 项奖励
回复

2,344 次查看
JozefKozon
NXP TechSupport
NXP TechSupport

Hi Sylvia,

please refer to the section 10.1 in the MC33772C datasheet. According to the datasheet, each message must consists of 48 bits. Do you have a logic analyzer or an oscilloscope? I have tested my FRDM33772CSPIEVB+S32K144 EVB. Each message consists of 48bit. Could you please check it and please share the scope?

JozefKozon_1-1694688520474.png

JozefKozon_0-1694688484793.png

JozefKozon_2-1694688632748.png

With Best Regards,

Jozef

0 项奖励
回复

2,316 次查看
Sylvia_jiang
Contributor IV

Hi @JozefKozon 

      Really appreciate for your promt reply.  It is MC33772B which spi command I used is correct. I have already fetch correct isense adc successfully. Fix gain 16 becoming 256 always occurrs in diag mode. Please help to make sure that procedures of adc by gpio56 in diag mode is corrrect. Looking forward to your reply.

Best Regards

Sylvia

0 项奖励
回复

2,303 次查看
JozefKozon
NXP TechSupport
NXP TechSupport

Hi Sylvia,

I have checked the piece of code you have shared and it is correct. I see you have set I_MEAS_EN bit to 1, in SYS_CFG1 register $03, which is needed to be able to read the PGA_GAIN_S value.  

JozefKozon_3-1694757547015.png

Could you please share the code line, how you set the PGA_GAIN to fixed value? And also the code line how you recognize the PGA_GAIN value? I presume you set the PGA_GAIN in the ADC_CFG register $06 and you also check the PGA_GAIN in the same ADC_CFG register $06? Please share the reading value of the ADC_CFG register $06.

With Best Regards,

Jozef

0 项奖励
回复