Other Parts Discussed in Thread: ENERGYTRACE
Tool/software:
Dear all,
I came across the following situation when using I2Croutines using EEPROM memory.
I2C configuration on the MSP430FR5994
//////////////////////////////////////////////////////////////////////////////// // Definição da Porta P5 como Serial I2C das Memórias EEPROMS // //////////////////////////////////////////////////////////////////////////////// P5OUT = 0; // Reseta Todos os Pinos da Porta P5 P5DIR = 0xFF; // Define Todos os Pinos da Porta P5 como Saídas P5OUT &=~ 0xFF; // Inicializa Todos os Pinos da Porta P5 com Nível Lógico "0" Baixo P5SEL0 |= (SDA | SCL); // P5.0 e P5.1 options select P5SEL0 = 0 // Seleciona o Pino da Porta P5.0 UCB1SDA e P5.1 UCB1SCL como Barramento I2C P5SEL1 &=~ (SDA | SCL); // P5.0 e P5.1 options select P5SEL1 = 1 // Seleciona Módulo Secundário Conforme Tabela I/O Function Selection = 1 | 0 // Configuração do Barramento I2C das Memórias EEPROMs UCB1CTLW0 |= UCSWRST + UCMST + UCMODE_3 + UCSYNC + UCSSEL__SMCLK; // Enable SW reset, I2C Master, Modo i2c, synchronous mode UCB1BRW = 40; // fSCL = SMCLK = 16.000.000/40 = 400 kHz UCB1CTLW0 &=~ UCSWRST; // Clear SW reset, resume operation UCB1IE |= UCNACKIE + UCTXIE0 + UCRXIE0; // Interrupts Enable
When using EEPROM_AckPolling(); as follows:
/*----------------------------------------------------------------------------*/ // Description: // Acknowledge Polling. The EEPROM will not acknowledge if a write cycle is // in progress. It can be used to determine when a write cycle is completed. /*----------------------------------------------------------------------------*/ void EEPROM_AckPolling(void) { // finished all operations do { UCB1STATW = 0x00; // clear I2C interrupt flags UCB1CTLW0 |= UCTR; // I2CTRX=1 => Transmit Mode (R/W bit = 0) UCB1CTLW0 &= ~UCTXSTT; UCB1CTLW0 |= UCTXSTT; // start condition is generated while (UCB1CTLW0 & UCTXSTT) // wait till I2CSTT bit was cleared { if (!(UCNACKIFG & UCB1STATW)) // Break out if ACK received break; } UCB1CTLW0 |= UCTXSTP; // stop condition is generated after // slave address was sent => I2C communication is started while (UCB1CTLW0 & UCTXSTP); // wait till stop bit is reset Delay_TA3_ms(6); // Aguarda 6 milisegundo } while (UCNACKIFG & UCB1STATW); }
I notice that the current consumption in LPM3 is almost 10 times higher, around 640 uA, than if I simply use it this way, which is around 67 uA:
/*----------------------------------------------------------------------------*/ // Description: // Acknowledge Polling. The EEPROM will not acknowledge if a write cycle is // in progress. It can be used to determine when a write cycle is completed. /*----------------------------------------------------------------------------*/ void EEPROM_AckPolling(void) { Delay_TA3_ms(6); // Aguarda 6 milisegundo }
Has anyone here on the forum come across this difference in current consumption after writing to EEPROM memory?
Best regards,
Anderson Portela