cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Pin config question

forum
Associate
Posted on May 20, 2014 at 19:35

Hello all,

as a newbie to STM32 I am unsure how to configure the pins for CS and PWM in the attached picture. The Buzzer is from mikroElektronika.

Thje buzzer ist from mikroElektronika, but they didn't really help with an example. Their example says basically something like

SoundInit();

 

 

and that's it: They do not provide the source of the corresponding library.

So my questions are

  1. If PWM shall be the sound-signal and CS shall turn on or off the sound: How do I have to configure the processor-pins for CS and PWM according to the schematic shown in the picture. PullUp, Pulldown, openDrain?
  2. Can it happen that I destroy one of the ports/portpins if configure kind of a short between these pins? e.g. PullUp on CS vs. PullDown on PWM ?

Your help is very much appreciated as I do not yet know very well the characteristics of the STM32 and its portpins.

PS: I have seen that the attachment was uploaded, but do not know how to make it visible ...? Hope you can see it.
1 REPLY 1
Chris1
Senior III
Posted on May 21, 2014 at 20:39

In general, the pins of an STM32 can be configured as output (push-pull or open-drain), input (with or without pull-up or pull-down) or as some peripheral alternate function.

The schematic that you attached appears to show two pins connected together.  I don't know how that can be useful, but as you suspect, it could cause problems if both pins are used as outputs.  (Presumably the pin used for PWM is configured as an output, probably connected to a timer peripheral).

If the pin connected as CS is configured as an input, it would be possible to operate, but it would not affect the circuit.  I suppose both pins could be configured as open-drain outputs, but I don't know why that would be desired.