This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] ADS7138-Q1:如何使用 ADS7138 自主模式

Guru**** 2491575 points
Other Parts Discussed in Thread: ADS7138

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/data-converters-group/data-converters/f/data-converters-forum/1531237/ads7138-q1-how-to-use-ads7138-autonomous-mode

器件型号:ADS7138-Q1
主题中讨论的其他器件:ADS7138

工具/软件:

大家好!

如何使用 ADS7138 自主模式

遵循数据表第 25 页的流程图后、我注意到、当我将阈值设置为低于当前输入电压时、警报信号不会改变。 我还检查了 EVENT_FLAG 寄存器、但没有触发标志。
您能帮我检查以下初始化步骤是否有任何问题吗? 谢谢你。

GR、

HC

static void ADS7138_Alert_Test_Init(void)
{
	ads7138RegWrite.pinConfig.u8 		= 0x00;
	ads7138RegWrite.autoSeqChSel.u8		= 0xFF;
	ads7138RegWrite.sequenceConfig.bits.SEQ_MODE = SET_AUTO;
	ads7138RegWrite.eventRgn.u8 = 0xFF;
	ads7138RegWrite.hysteresisCh[0].bits.HYSTERESIS = 0xF;
	ads7138RegWrite.hysteresisCh[0].bits.H_TH_LSB = 0xF;
	ads7138RegWrite.highThCh[0].H_TH_MSB = 0xFF;
	ads7138RegWrite.eventCountCh[0].bits.EVENT_COUNT = 0x00;
	ads7138RegWrite.eventCountCh[0].bits.L_TH_LSB = 0xD;
	ads7138RegWrite.lowThCh[0].L_TH_MSB = 0xFA;

	ads7138RegWrite.hysteresisCh[1].bits.HYSTERESIS = 0xF;
	ads7138RegWrite.hysteresisCh[1].bits.H_TH_LSB = 0x1;
	ads7138RegWrite.highThCh[1].H_TH_MSB = 0xAE;
	ads7138RegWrite.eventCountCh[1].bits.EVENT_COUNT = 0x00;
	ads7138RegWrite.eventCountCh[1].bits.L_TH_LSB = 0xE;
	ads7138RegWrite.lowThCh[1].L_TH_MSB =0xA3;

	ads7138RegWrite.hysteresisCh[2].bits.HYSTERESIS = 0x8;
	ads7138RegWrite.hysteresisCh[2].bits.H_TH_LSB = 0xF;
	ads7138RegWrite.highThCh[2].H_TH_MSB = 0x27;
	ads7138RegWrite.eventCountCh[2].bits.EVENT_COUNT = 0x00;
	ads7138RegWrite.eventCountCh[2].bits.L_TH_LSB = 0xE;
	ads7138RegWrite.lowThCh[2].L_TH_MSB = 0x24;

	ads7138RegWrite.hysteresisCh[3].bits.HYSTERESIS = 0x8;
	ads7138RegWrite.hysteresisCh[3].bits.H_TH_LSB = 0x8;
	ads7138RegWrite.highThCh[3].H_TH_MSB = 0x2B;
	ads7138RegWrite.eventCountCh[3].bits.EVENT_COUNT = 0x00;
	ads7138RegWrite.eventCountCh[3].bits.L_TH_LSB = 0x0;
	ads7138RegWrite.lowThCh[3].L_TH_MSB = 0x29;

	ads7138RegWrite.hysteresisCh[4].bits.HYSTERESIS = 0xA;
	ads7138RegWrite.hysteresisCh[4].bits.H_TH_LSB = 0xE;
	ads7138RegWrite.highThCh[4].H_TH_MSB = 0x3A;
	ads7138RegWrite.eventCountCh[4].bits.EVENT_COUNT = 0x00;
	ads7138RegWrite.eventCountCh[4].bits.L_TH_LSB = 0xC;
	ads7138RegWrite.lowThCh[4].L_TH_MSB = 0x35;

	ads7138RegWrite.hysteresisCh[5].bits.HYSTERESIS = 0xA;
	ads7138RegWrite.hysteresisCh[5].bits.H_TH_LSB = 0xB;
	ads7138RegWrite.highThCh[5].H_TH_MSB = 0x5E;
	ads7138RegWrite.eventCountCh[5].bits.EVENT_COUNT = 0x00;
	ads7138RegWrite.eventCountCh[5].bits.L_TH_LSB = 0x9;
	ads7138RegWrite.lowThCh[5].L_TH_MSB = 0x59;

	ads7138RegWrite.hysteresisCh[6].bits.HYSTERESIS = 0xA;
	ads7138RegWrite.hysteresisCh[6].bits.H_TH_LSB = 0xE;
	ads7138RegWrite.highThCh[6].H_TH_MSB = 0x3A;
	ads7138RegWrite.eventCountCh[6].bits.EVENT_COUNT = 0x00;
	ads7138RegWrite.eventCountCh[6].bits.L_TH_LSB = 0xC;
	ads7138RegWrite.lowThCh[6].L_TH_MSB = 0x35;


	ads7138RegWrite.hysteresisCh[7].bits.HYSTERESIS = 0xF;
	ads7138RegWrite.hysteresisCh[7].bits.H_TH_LSB = 0xF;
	ads7138RegWrite.highThCh[7].H_TH_MSB = 0xFF;
	ads7138RegWrite.eventCountCh[7].bits.EVENT_COUNT = 0x00;
	ads7138RegWrite.eventCountCh[7].bits.L_TH_LSB = 0xD;
	ads7138RegWrite.lowThCh[7].L_TH_MSB = 0xFA;

	ads7138RegWrite.alertChSel.u8 = 0xFF;
	ads7138RegWrite.alertPinConfig.bits.ALERT_DRIVE = PUSH_PULL;
	ads7138RegWrite.alertPinConfig.bits.ALERT_LOGIC = ACTIVE_LOW;

	ads7138RegWrite.opmodeConfig.bits.OSC_SEL = SET_HIGH_SPEED;
	ads7138RegWrite.opmodeConfig.bits.CLK_DIV = 0x00;

	ads7138RegWrite.generalConfig.bits.DWC_EN = SET_ENABLE ;
	ads7138RegWrite.sequenceConfig.bits.SEQ_START = SET_START;

	ads7138RegWrite.sequenceConfig.bits.SEQ_START = SET_START;
	ads7138RegWrite.opmodeConfig.bits.CONV_MODE = SET_AUTONOMOUS_MODE;
	ads7138RegWrite.generalConfig.bits.STATS_EN = SET_ENABLE;
	ads7138RegWrite.generalConfig.bits.CNVST = 1;

	TS_ADS7138_HANDLE ads7138TestWrite[ADS7138HANDLESIZE] = {
		{ true, 	 true, 		ADS7138_SERVICE_WRITE_PIN_CFG			},
		{ true, 	 true, 		ADS7138_SERVICE_WRITE_AUTO_SEQ_CH_SEL	},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_SEQUENCE_CFG		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_RGN			},

		{ true,		 true, 		ADS7138_SERVICE_WRITE_HYSTERESIS		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_HIGH_TH			},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_COUNT		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_LOW_TH			},

		{ true,		 true, 		ADS7138_SERVICE_WRITE_HYSTERESIS		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_HIGH_TH			},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_COUNT		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_LOW_TH			},

		{ true,		 true, 		ADS7138_SERVICE_WRITE_HYSTERESIS		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_HIGH_TH			},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_COUNT		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_LOW_TH			},

		{ true,		 true, 		ADS7138_SERVICE_WRITE_HYSTERESIS		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_HIGH_TH			},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_COUNT		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_LOW_TH			},

		{ true,		 true, 		ADS7138_SERVICE_WRITE_HYSTERESIS		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_HIGH_TH			},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_COUNT		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_LOW_TH			},

		{ true,		 true, 		ADS7138_SERVICE_WRITE_HYSTERESIS		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_HIGH_TH			},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_COUNT		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_LOW_TH			},

		{ true,		 true, 		ADS7138_SERVICE_WRITE_HYSTERESIS		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_HIGH_TH			},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_COUNT		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_LOW_TH			},

		{ true,		 true, 		ADS7138_SERVICE_WRITE_HYSTERESIS		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_HIGH_TH			},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_COUNT		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_LOW_TH			},

		{ true,		 true, 		ADS7138_SERVICE_WRITE_ALERT_CH_SEL		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_ALERT_PIN_CFG		},

		{ true,		 true, 		ADS7138_SERVICE_WRITE_OPMODE_CFG		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_SEQUENCE_CFG		},
		{ true,		 true, 		ADS7138_SERVICE_WRITE_GENERAL_CFG		},
		{false,		false, 		ADS7138_BlankFunc						},
		{false,		false, 		ADS7138_BlankFunc						},
		{false,		false, 		ADS7138_BlankFunc						},
		{false,		false, 		ADS7138_BlankFunc						},
		{false,		false, 		ADS7138_BlankFunc						}
	};

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Hi Hsuan Chia、

    您是否能够发送配置序列的逻辑捕获来探测 I2C 线路、而不是发送代码? 这有助于验证代码是否正在低级执行预期值。

    此致、
    Joel

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、Joel

    以下是设置和操作方法。 每次写入 I2C 时、都会读取 I2C。  附加 LA LOG。

    static void ADS7138_Alert_Test_Init(void)
    {
    	ads7138RegWrite.pinConfig.u8 		= 0x00;		
    	ads7138RegWrite.autoSeqChSel.u8		= 0xFF;		
    	ads7138RegWrite.sequenceConfig.bits.SEQ_MODE = SET_AUTO;		
    
    	ads7138RegWrite.eventRgn.u8 = 0xFF;
    	ads7138RegWrite.hysteresisCh[0].bits.HYSTERESIS = 0xF;
    	ads7138RegWrite.hysteresisCh[0].bits.H_TH_LSB = 0xF;
    	ads7138RegWrite.highThCh[0].H_TH_MSB = 0xFF;
    	ads7138RegWrite.eventCountCh[0].bits.EVENT_COUNT = 0x00;
    	ads7138RegWrite.eventCountCh[0].bits.L_TH_LSB = 0xD;
    	ads7138RegWrite.lowThCh[0].L_TH_MSB = 0xFA;
    
    	ads7138RegWrite.hysteresisCh[1].bits.HYSTERESIS = 0xF;
    	ads7138RegWrite.hysteresisCh[1].bits.H_TH_LSB = 0x1;
    	ads7138RegWrite.highThCh[1].H_TH_MSB = 0xAE;
    	ads7138RegWrite.eventCountCh[1].bits.EVENT_COUNT = 0x00;
    	ads7138RegWrite.eventCountCh[1].bits.L_TH_LSB = 0xE;
    	ads7138RegWrite.lowThCh[1].L_TH_MSB =0xA3;
    
    	ads7138RegWrite.hysteresisCh[2].bits.HYSTERESIS = 0x8;
    	ads7138RegWrite.hysteresisCh[2].bits.H_TH_LSB = 0xF;
    	ads7138RegWrite.highThCh[2].H_TH_MSB = 0x27;
    	ads7138RegWrite.eventCountCh[2].bits.EVENT_COUNT = 0x00;
    	ads7138RegWrite.eventCountCh[2].bits.L_TH_LSB = 0xE;
    	ads7138RegWrite.lowThCh[2].L_TH_MSB = 0x24;
    
    	ads7138RegWrite.hysteresisCh[3].bits.HYSTERESIS = 0x8;
    	ads7138RegWrite.hysteresisCh[3].bits.H_TH_LSB = 0x8;
    	ads7138RegWrite.highThCh[3].H_TH_MSB = 0x2B;
    	ads7138RegWrite.eventCountCh[3].bits.EVENT_COUNT = 0x00;
    	ads7138RegWrite.eventCountCh[3].bits.L_TH_LSB = 0x0;
    	ads7138RegWrite.lowThCh[3].L_TH_MSB = 0x29;
    
    	ads7138RegWrite.hysteresisCh[4].bits.HYSTERESIS = 0xA;
    	ads7138RegWrite.hysteresisCh[4].bits.H_TH_LSB = 0xE;
    	ads7138RegWrite.highThCh[4].H_TH_MSB = 0x3A;
    	ads7138RegWrite.eventCountCh[4].bits.EVENT_COUNT = 0x00;
    	ads7138RegWrite.eventCountCh[4].bits.L_TH_LSB = 0xC;
    	ads7138RegWrite.lowThCh[4].L_TH_MSB = 0x35;
    
    	ads7138RegWrite.hysteresisCh[5].bits.HYSTERESIS = 0xA;
    	ads7138RegWrite.hysteresisCh[5].bits.H_TH_LSB = 0xB;
    	ads7138RegWrite.highThCh[5].H_TH_MSB = 0x5E;
    	ads7138RegWrite.eventCountCh[5].bits.EVENT_COUNT = 0x00;
    	ads7138RegWrite.eventCountCh[5].bits.L_TH_LSB = 0x9;
    	ads7138RegWrite.lowThCh[5].L_TH_MSB = 0x59;
    
    	ads7138RegWrite.hysteresisCh[6].bits.HYSTERESIS = 0xA;
    	ads7138RegWrite.hysteresisCh[6].bits.H_TH_LSB = 0xE;
    	ads7138RegWrite.highThCh[6].H_TH_MSB = 0x3A;
    	ads7138RegWrite.eventCountCh[6].bits.EVENT_COUNT = 0x00;
    	ads7138RegWrite.eventCountCh[6].bits.L_TH_LSB = 0xC;
    	ads7138RegWrite.lowThCh[6].L_TH_MSB = 0x35;
    
    
    	ads7138RegWrite.hysteresisCh[7].bits.HYSTERESIS = 0xF;
    	ads7138RegWrite.hysteresisCh[7].bits.H_TH_LSB = 0xF;
    	ads7138RegWrite.highThCh[7].H_TH_MSB = 0xFF;
    	ads7138RegWrite.eventCountCh[7].bits.EVENT_COUNT = 0x00;
    	ads7138RegWrite.eventCountCh[7].bits.L_TH_LSB = 0xD;
    	ads7138RegWrite.lowThCh[7].L_TH_MSB = 0xFA;
    
    	ads7138RegWrite.alertChSel.u8 = 0xFF;
    	ads7138RegWrite.alertPinConfig.bits.ALERT_DRIVE = PUSH_PULL;
    	ads7138RegWrite.alertPinConfig.bits.ALERT_LOGIC = ACTIVE_LOW;
    
    	ads7138RegWrite.opmodeConfig.bits.OSC_SEL = SET_HIGH_SPEED;
    	ads7138RegWrite.opmodeConfig.bits.CLK_DIV = 0x00;
    
    	ads7138RegWrite.generalConfig.bits.DWC_EN = SET_ENABLE ;
    	ads7138RegWrite.sequenceConfig.bits.SEQ_START = SET_START;
    
    	ads7138RegWrite.sequenceConfig.bits.SEQ_START = SET_START;		
    	ads7138RegWrite.opmodeConfig.bits.CONV_MODE = SET_AUTONOMOUS_MODE;	
    	ads7138RegWrite.generalConfig.bits.STATS_EN = SET_ENABLE;		
    	ads7138RegWrite.generalConfig.bits.CNVST = 1;				
    
    	TS_ADS7138_HANDLE ads7138TestWrite[ADS7138HANDLESIZE] = {
    	    // enable, event, handle
    		{ true, 	 true, 		ADS7138_SERVICE_WRITE_PIN_CFG			},
    		{ true, 	 true, 		ADS7138_SERVICE_WRITE_AUTO_SEQ_CH_SEL	},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_SEQUENCE_CFG		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_RGN			},
    
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_HYSTERESIS		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_HIGH_TH			},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_COUNT		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_LOW_TH			},
    
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_HYSTERESIS		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_HIGH_TH			},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_COUNT		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_LOW_TH			},
    
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_HYSTERESIS		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_HIGH_TH			},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_COUNT		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_LOW_TH			},
    
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_HYSTERESIS		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_HIGH_TH			},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_COUNT		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_LOW_TH			},
    
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_HYSTERESIS		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_HIGH_TH			},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_COUNT		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_LOW_TH			},
    
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_HYSTERESIS		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_HIGH_TH			},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_COUNT		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_LOW_TH			},
    
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_HYSTERESIS		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_HIGH_TH			},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_COUNT		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_LOW_TH			},
    
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_HYSTERESIS		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_HIGH_TH			},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_EVENT_COUNT		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_LOW_TH			},
    
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_ALERT_CH_SEL		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_ALERT_PIN_CFG		},
    
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_OPMODE_CFG		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_SEQUENCE_CFG		},
    		{ true,		 true, 		ADS7138_SERVICE_WRITE_GENERAL_CFG		},
    		{false,		false, 		ADS7138_BlankFunc						},
    		{false,		false, 		ADS7138_BlankFunc						},
    		{false,		false, 		ADS7138_BlankFunc						},
    		{false,		false, 		ADS7138_BlankFunc						},
    		{false,		false, 		ADS7138_BlankFunc						}
    	};
    
    	TS_ADS7138_HANDLE ads7138TestRead[ADS7138HANDLESIZE] = {
    			{ true, 	false, 		ADS7138_SERVICE_READ_SYSTEM_STATUS		},
    			{ true, 	false, 		ADS7138_SERVICE_READ_PIN_CFG			},
    			{ true,		false, 		ADS7138_SERVICE_READ_AUTO_SEQ_CH_SEL	},
    			{ true,		false, 		ADS7138_SERVICE_READ_SEQUENCE_CFG		},
    			{ true,		false, 		ADS7138_SERVICE_READ_RECENT 			},
    
    			{true,		true, 		ADS7138_SERVICE_READ_EVENT_RGN			},
    
    			{true,		true, 		ADS7138_SERVICE_READ_HYSTERESIS			},
    			{true,		true, 		ADS7138_SERVICE_READ_HIGH_TH			},
    			{true,		true, 		ADS7138_SERVICE_READ_EVENT_COUNT		},
    			{true,		true, 		ADS7138_SERVICE_READ_LOW_TH				},
    
    			{true,		true, 		ADS7138_SERVICE_READ_HYSTERESIS			},
    			{true,		true, 		ADS7138_SERVICE_READ_HIGH_TH			},
    			{true,		true, 		ADS7138_SERVICE_READ_EVENT_COUNT		},
    			{true,		true, 		ADS7138_SERVICE_READ_LOW_TH				},
    
    			{true,		true, 		ADS7138_SERVICE_READ_HYSTERESIS			},
    			{true,		true, 		ADS7138_SERVICE_READ_HIGH_TH			},
    			{true,		true, 		ADS7138_SERVICE_READ_EVENT_COUNT		},
    			{true,		true, 		ADS7138_SERVICE_READ_LOW_TH				},
    
    			{true,		true, 		ADS7138_SERVICE_READ_HYSTERESIS			},
    			{true,		true, 		ADS7138_SERVICE_READ_HIGH_TH			},
    			{true,		true, 		ADS7138_SERVICE_READ_EVENT_COUNT		},
    			{true,		true, 		ADS7138_SERVICE_READ_LOW_TH				},
    
    			{true,		true, 		ADS7138_SERVICE_READ_HYSTERESIS			},
    			{true,		true, 		ADS7138_SERVICE_READ_HIGH_TH			},
    			{true,		true, 		ADS7138_SERVICE_READ_EVENT_COUNT		},
    			{true,		true, 		ADS7138_SERVICE_READ_LOW_TH				},
    
    			{true,		true, 		ADS7138_SERVICE_READ_HYSTERESIS			},
    			{true,		true, 		ADS7138_SERVICE_READ_HIGH_TH			},
    			{true,		true, 		ADS7138_SERVICE_READ_EVENT_COUNT		},
    			{true,		true, 		ADS7138_SERVICE_READ_LOW_TH				},
    
    			{true,		true, 		ADS7138_SERVICE_READ_HYSTERESIS			},
    			{true,		true, 		ADS7138_SERVICE_READ_HIGH_TH			},
    			{true,		true, 		ADS7138_SERVICE_READ_EVENT_COUNT		},
    			{true,		true, 		ADS7138_SERVICE_READ_LOW_TH				},
    
    			{true,		true, 		ADS7138_SERVICE_READ_HYSTERESIS			},
    			{true,		true, 		ADS7138_SERVICE_READ_HIGH_TH			},
    			{true,		true, 		ADS7138_SERVICE_READ_EVENT_COUNT		},
    			{true,		true, 		ADS7138_SERVICE_READ_LOW_TH				},
    
    			{true,		false, 		ADS7138_SERVICE_READ_EVENT_FLAG			},
    			{true,		false, 		ADS7138_SERVICE_READ_ALERT_CH_SEL		},
    			{true,		false, 		ADS7138_SERVICE_READ_GENERAL_CFG		},
    			{true,		false, 		ADS7138_SERVICE_READ_OPMODE_CFG			},
    			{false,		false, 		ADS7138_BlankFunc						},
    			{false,		false, 		ADS7138_BlankFunc						},
    			{false,		false, 		ADS7138_BlankFunc						},
    			{false,		false, 		ADS7138_BlankFunc						}
    	};
    	memcpy(ads7138WriteHandle, ads7138TestWrite, sizeof(ads7138TestWrite));
    	memcpy(ads7138ReadHandle, ads7138TestRead, sizeof(ads7138TestRead));
    }

    void I2C_Schedule(void)
    {
    	switch(i2cSched) {
    		case i2c_isIdle:
    			i2cSched = i2c_isWrite;
    			break;
    			
    		case i2c_isWrite:
    			I2C_TX_Schedule();
    			i2cSched = i2c_isRead;
    			break;
    			
    		case i2c_isRead:
    			I2C_RX_Schedule();
    			i2cSched = user_functions;
    			break;
    			
    		case user_functions:
    			i2cSched = i2c_isWrite;
    			break;
    
    		default:
    			i2cSched = i2c_isIdle; 
    			break;
    	}
    }

    e2e.ti.com/.../ADS7138.csv

    GR、

    HC

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Hi Hsuan Chia、

    对此处回复的延迟表示歉意。 我一直在尝试仔细查看日志并了解所做的配置。

    我看到您正在配置 EVENT_RGN 寄存器、以便在转换结果介于低阈值和高阈值之间时设置事件标志。 这类似于 数据表图 8-9 中所示的“带内信号“条件。

    这是您的预期吗? 要在 EVENT_RGN = 1 时触发警报、输入信号必须高于低阈值且低于高阈值。  

    如果我们特别关注一个通道(例如 CH0)、则 高阈值看起来设置为 0xFFF。 低阈值设置为 0xFAD。 迟滞设置为 0xF、左移 3 位、并应用于转换的 7 个最低有效位。 事件计数设置为 0、这意味着 1 次读取将导致 ALERT 引脚有效。

    您向该器件提供什么输入? MIN_VALUE_CH0 和 MAX_VALUE_CH0 寄存器具有哪些值? 任何大于 0xFFF &&小于 0xFFF 的值都将导致 ALERT 变为活动状态。我相信 所有其他寄存器都已正确配置。

    此致、
    Joel

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、Joel

    我预计、当我的输入电压降至低阈值以下或升至高阈值以上时、将触发警报。

    以下是我的设置:

    AVDD 5V
    V. 最大值 最小值 最大值(12 位) 最小值(12 位)
    AIN0 5. 5. 4.9. 0xFFF 0xFAD
    AIN1 3.3 3.4. 3.2. 0xAE1 0xA3E
    AIN2 0.75 0.78 0.72 0x27F 0x24E
    进行的 0.825 0.85 0.8 0x2B8 0x290
    AIN4 1.1. 1.15 1.05. 0x3AE 0x35C
    AIN5 1.8 1.85 1.75 0x5EB 0x599
    AIN6 3.3 3.4. 3.2. 0xAE1 0xA3E
    AIN7 5. 5. 4.9. 0xFFF 0xFAD

    之后、用相同的基准电压准备的输入电压将更改为使用分压

    是否可以在不更改设计(和不调整输入电压)的情况下执行警报测试?
    例如、将 AIN4 的上限和下限阈值设置为 AIN1、因此一旦我设置参数并开始转换、就会立即触发警报? (AIN4 输入电压 1.1V < 3.2V)

    GR、

    HC

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Hi Hsuan Chia、  

    如果您想在模拟输入高于高阈值或低于低阈值时触发警报、我相信您可以将 EVENT_RGN 字段保持为默认值。 请参阅图 8-9 中的案例。 当信号超过高阈值或低于低阈值时、将触发警报(虚线区域)。

    是的、您应该能够通过更改上限和下限而不改变输入电压来触发警报。 一旦输入电压下降到超出范围、就会设置警报。

    此致、
    Joel

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、Joel

    我写入了以下设置、但警报未触发或警报不正确

    ain0/ch0 5V ~ 0xFFB
    EVENT_RGN   0x01 0x01 0x00
    高精度 0x222 0xFFF 0x222
    低 Th 0x111
    驱动器 0x00
    EVENT_COUNT 0x00
    事件标志 CH0 NOT_DET NOT_DET Det

    设置中是否有任何错误或调整?

    GR、

    HC

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、Joel

    我尝试读取高/低标志。 当我设置以下内容时、事件高标志被触发。 为什么?

    EVENT_RGN   0x00
    高精度 0xffe
    低 Th 0x001
    驱动器 0x00
    EVENT_COUNT 0x00
    事件标志 0xFF
    事件高标志 0xFF
    事件低标志 0x00
    最近的通道 0 0xffc0
    最近的通道 1 0xa7c0
    最近的通道 2 0x2780
    最近的通道 3 0x2a10
    最近的通道 4 0x38b0
    最近的 CH 5 0x5c60
    最近的 CH 6. 0xa900
    近期 CH 7 0xfe70

    GR、

    HC

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 HC、

    再次对延迟表示歉意。 我在上星期的大部分时间里都不在办公室。  

    因此、您似乎已将高阈值和低阈值设置为接近输入的极端值。 您能否阐明高阈值和低阈值是应用于每个通道、还是仅应用于通道 0?

    由于所有通道都显示高标志、您是否可以检查 MAX_CHx 寄存器值?

    当读取事件标志和回读最近的通道寄存器时、设置高阈值和低阈值的顺序是什么?

    如果最大转换值超过高阈值、这似乎正常工作。 我最大的问题是设置寄存器的顺序可能无意中设置了上限阈值。

    此致、
    Joel

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、Joel

    为了测试警报功能、我临时将所有通道设置为相同的阈值。

    值​​如下所示:

    1.设置高低阈值
    2.读取最近的寄存器
    3.读取事件标志

    GR、

    HC