AnsweredAssumed Answered

ADE7953 and UART communication trouble

Question asked by DarioMingarelli on Nov 27, 2015
Latest reply on Dec 7, 2015 by dlath

I'm using ADE7953 with STM32, communicating through I2C, but I need to migrate to UART communication.

Following all communication, I connected the ADE7953 SCLK pin to GND, the CS pin to 3V3, TX pin to MCU RX and USART RX pin to MCU USART TX.

I've configured the USART in this way:

 

/* USART3 configured as follow:

  - BaudRate = 4800 baud

  - Word Length = 8 Bits

  - One Stop Bit

  - No parity

  - Hardware flow control disabled (RTS and CTS signals)

  - Receive and transmit enabled

  */

  USART_InitStructure.USART_BaudRate = 4800;

  USART_InitStructure.USART_WordLength = USART_WordLength_8b;

  USART_InitStructure.USART_StopBits = USART_StopBits_1;

  USART_InitStructure.USART_Parity = USART_Parity_No;

  USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;

  USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;

 

I've also followed all MSB-LSB frames indication:

 

uint16_t ADE7953_register;

uint32_t RegisterValue;

 

WRITE

TxBuffer3[0] = ADE7953_WRITE;

TxBuffer3[1] = (uint8_t) (ADE7953_register >> 8);

TxBuffer3[2] = (uint8_t) ADE7953_register;

TxBuffer3[3] = (uint8_t) RegisterValue;

TxBuffer3[4] = (uint8_t) (RegisterValue >> 8);

TxBuffer3[5] = (uint8_t) (RegisterValue >> 16);

TxBuffer3[6] = (uint8_t) (RegisterValue >> 24);

 

READ

TxBuffer3[0] = ADE7953_READ;

TxBuffer3[1] = (uint8_t) (ADE7953_register >> 8);

TxBuffer3[2] = (uint8_t) ADE7953_register;

 

With the scope, TX (MCU to ADE) pass wthout any problem, following all timing indication from the datasheet, but I don't receive any answer from the ADE.

I've also check all pins: everything it's correctly powered... if I use I2C on the same board, changing CS and SCLK pins, I have no communication trouble.

So... what happen? Do you have any help to give me?

 

Thanks a lot,

 

Dario

Outcomes