Reset using the RST PIN ?

acronis
Tue Jun 13, 2017 7:09 am
Hello Tell me how to do the reset using the RST PIN ?
How to designate ?
For example #define LED_PIN PB11
but as a #define RST_PIN ???

I need to do a reset using digitalWrite(RST_PIN, LOW);


RogerClark
Tue Jun 13, 2017 9:49 am
Why do you want do to this.

If you simply want to reset the board from code, there is a way to do this (though it varies depending on which Core you are using)

e.g. in the LibMaple core you can use nvic_sys_reset()
There is also a HAL / CMSIS call you can use if you are using one of the HAL based cores


zmemw16
Tue Jun 13, 2017 9:50 am
a degree of clarification is required.
what are trying to reset, the stm32 or maybe a display
for the latter, fill in whichever pin the display rst pin is connected to, alternatively you can connect it to the main reset from the button.
for the stm32 itself, no idea
stephen

stevestrong
Tue Jun 13, 2017 11:16 am
Before using
digitalWrite(RST_PIN, LOW);

acronis
Tue Jun 13, 2017 1:41 pm
nvic_sys_reset() not doing level 0 on pin RST.
I neobhhodimo not only to reset the STM Board , but the modules connected to this Board and to the pin RESET (RST).
That is, I must do a low level on pin RST (RESET).
I just can’t tell the name of this pin : #define RST_PIN OR RESET_PIN OR ????
Is there already a designated name for a pin RESET ?

ARDUINO UNO EXAMPLE:

int resetPin = 12;
// the setup routine runs once when you press reset:
void setup() {
digitalWrite(resetPin, HIGH);
delay(200);
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
pinMode(resetPin, OUTPUT);
………….
}

// the loop routine runs over and over again forever:
void loop() {
…………………
digitalWrite(resetPin, LOW);
Serial.println(“this never happens”);
//this never happens because Arduino resets

}

STM32

how to make for STM32 ??
for ARDUINO UNO int resetPin = 12;
stm32f103 ?


stevestrong
Tue Jun 13, 2017 2:13 pm
It is up to you which pin you want to use for reset. Chose one.
You have to use extra wire from that chosen pin to RESET.

Pito
Tue Jun 13, 2017 2:22 pm
You cannot do input/output at the RESET pin.
What you could do is to define a pin, for example “PB11”, configure PB11 as open_drain output, connect it to the RESET pin (R on BluePIll) , connect other reset inputs to this PB11 pin as well.
When you toggle the PB11 to “low” you will reset everything. Not tested yet, however.

acronis
Tue Jun 13, 2017 2:26 pm
Thank you.
Do I understand correctly that directly to the RST PIN can not handle ?
Only through an additional PIN. Is that so ?

Pito
Tue Jun 13, 2017 2:34 pm
Reset.JPG
Reset.JPG (59.49 KiB) Viewed 438 times

acronis
Tue Jun 13, 2017 2:36 pm
OK. Thank you very much for the tip. I understood it all. The question is closed.

ahull
Tue Jun 13, 2017 3:53 pm
Just my tuppence worth..

The user must ensure that the level on the NRST pin can go below the VIL(NRST) max level 0.8V. Otherwise the reset will not be taken into account by the device

.. this may trip you up if you are using for example a silicone rubber/membrane type button which has a relatively high resistance, or using some other device (a PIR for example) which doesn’t drive the pin low enough. Also the cap is critical to debouncing the switch. It will sorta work without it.. mostly…. except when it doesn’t :D

EDIT: Some good advice here-> http://ibker.net/2017/05/07/stm32f103c8 … ic-guides/


acronis
Wed Jun 14, 2017 1:56 am
#define LED_PIN PB11
#define RESET_PIN PB10

void setup() {
pinMode(LED_PIN, OUTPUT);
pinMode(RESET_PIN, OUTPUT);
digitalWrite(RESET_PIN, HIGH);
}

void loop() {

digitalWrite(LED_PIN, HIGH);
delay(1000);
digitalWrite(LED_PIN, LOW);
delay(1000);

delay (3000);
digitalWrite(RESET_PIN, LOW);
}

Unfortunately it doesn’t work.
I joined the PB10 PIN with a PIN RST (RESET)

Is it possible as in the case of unresponsiveness to send not only RESET the STM BOARD , but also the connected modules ?
To restart everything ?

How to implement it using
iwdg_init(IWDG_PRE_256, 1200);
iwdg_feed();

HELP


RogerClark
Wed Jun 14, 2017 3:21 am
Firstly, What are you trying to reset

If you are retrying to reset the STM though its own reset line, this may not be possible. Just use the command I posted earlier or like you say, use the WDT etc

If you want to also reset other hardware, then only connect that pin to the external hardware not to the stm32

e.g. set the pin to logic zero (assuming thats the reset state). Then call the function to reset the STM32

If you need a system to synchronise the reset of both the STM32 and the external hardware, I’d suggest 2 things.

Use another device to do this e.g. 555 timer ?? Or another MCU.

AND… I think your whole system needs to be redesigned if it relies on lots of devices being reset at just the right time.


acronis
Wed Jun 14, 2017 4:28 am
Well.
Thank you very much !
I understand you, I will try to do so.

Leave a Reply

Your email address will not be published. Required fields are marked *