cancel
Showing results for 
Search instead for 
Did you mean: 

Cost-efficient remote reset of STPM3x

Central SUPPORT
Senior II

STPM32 is used for an e-meter application. Idea is to use 2-pin UART connection, isolate only the RX and TX with optocouplers and not to use the SYN and SCS for reset.

According to datasheet on page 68 the remote reset can be performed in two ways:

·       Using SYN and SCS pin

·       Writing the reset bit (S/W reset in DSP_CR3)

Does this last option correctly reset the chip, especially the DSP unit? In this case, two optocouplers would not be needed for the SYN and SCS lines. Will it work as expected ?

0690X00000895RgQAI.png

NOTE: This question and answer originated from a customer support case which was handled by us. We regularly review support cases and add any helpful ones here for all to benefit from.

1 ACCEPTED SOLUTION

Accepted Solutions
Central SUPPORT
Senior II

In fact, pulses on SYN and SCS are mandatory to correctly reset the chip set.

But in this specific case there is a way to save at least one optocoupler by generating SCS from SYN + TXD signals: you put an OR gate with SYN and TXD as inputs, and SCS as output (the OR gate can be replaced also by 2 diodes).

Resulting true table will be:

0690X00000895SKQAY.png

Then, at each power-on sequence:

·       Send 3 pulses on SYN (TXD being high)

·       Send 1 pulse on SCS with SYN/TXD combination

In the example code below, I set SYN to "0", then send 0x00 on TXD, wait a delay, finally set back SYN to "1".

GPIO_ResetBits( GPIO9, SYN_STPM32);
USART_SendData(USART3,0x00);
INIT_WaitMicroSecond(10000);
GPIO_SetBits( GPIO9, SYN_STPM32);

Note: Be sure that at power-on (when EN and 3.3V rise), SCS signal must be high to lock the chipset in UART mode.

View solution in original post

2 REPLIES 2
Central SUPPORT
Senior II

In fact, pulses on SYN and SCS are mandatory to correctly reset the chip set.

But in this specific case there is a way to save at least one optocoupler by generating SCS from SYN + TXD signals: you put an OR gate with SYN and TXD as inputs, and SCS as output (the OR gate can be replaced also by 2 diodes).

Resulting true table will be:

0690X00000895SKQAY.png

Then, at each power-on sequence:

·       Send 3 pulses on SYN (TXD being high)

·       Send 1 pulse on SCS with SYN/TXD combination

In the example code below, I set SYN to "0", then send 0x00 on TXD, wait a delay, finally set back SYN to "1".

GPIO_ResetBits( GPIO9, SYN_STPM32);
USART_SendData(USART3,0x00);
INIT_WaitMicroSecond(10000);
GPIO_SetBits( GPIO9, SYN_STPM32);

Note: Be sure that at power-on (when EN and 3.3V rise), SCS signal must be high to lock the chipset in UART mode.

Tristan LLoris
Associate

And what about SPI communication please ? i can't ensure it ? can you help me ?