cancel
Showing results for 
Search instead for 
Did you mean: 

Program for a STM32F4 board in CoIDE transmit voltage to a PIN HELP

fiulala
Associate II
Posted on February 11, 2015 at 18:32

Hello, i want to program a STM32F4 board in CoIDE so it can transmit a voltage to a pin and then stop for a while and then again transmit voltage to the pin. I want to program the board so it can send periodically voltage to a ultrasound transducer. It has to do something like this:

http://upload.wikimedia.org/wikipedia/commons/thumb/9/9e/Duty_cycle_general.png/350px-Duty_cycle_general.png

Can someone help me please? I have programmed easy things like turning on the leds but i'm stuck for doing this.

Thank you very much

#coide #discovery #stm32f4
2 REPLIES 2
Posted on February 11, 2015 at 19:26

And what voltages and currents are you expecting to use? How do other people interface such sensors to micro-controllers?

Can you a) drive it with a timer channel output (TIMx_CHx), or b) drive it from the output of the DAC, perhaps through an op-amp or buffer?

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
fiulala
Associate II
Posted on February 11, 2015 at 19:39

Well the 5V from the USB bus. I already have the idea how to connect the micro-controller to the sensor. I will use a h-bridge to alternate the wave from positive to negative.

The only thing I don't know how to do is program the micro-controller so it can make a square-wave. It has to arrive to a pin of the board a square wave with the highest voltage that support de pins (3,3V). So it should do something like:

0 ms 0V

1 ms 3,3 V

2 ms 3,3 V

3 ms 0 V

4 ms 3,3 V

.

.

.

etc.

Thank you for reply