cancel
Showing results for 
Search instead for 
Did you mean: 

Make a OR logic gate

LFerr.7
Associate II

I have a STM32F4 microcontroller and want to combine two analog signals into one "combined digital output signal", which have sum of the 2 signals.

if i have two analog outputs PE11 and PE13 that will be my inputs of or gate:

HOW CAN I MAKE PE12 + PE13 to generate a single output in PE14 for example?

4 REPLIES 4

Not well explained, perhaps you could diagram your expectations.

If PE12 and PE13 are inputs, perhaps you can read GPIOE->IDR, align/isolate the bits of interest, do the logic and map out to PE14 via ODR or BSRR

Perhaps use 74 Series 1-Gate devices or diodes?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I have those pulses on PE11 and PE13

i want to make a logic gate actually a OR LOGIC GATE without using hardware and map the result for example in PE 14

0693W00000NpdsBQAR.pngHow can i write this code? Can you help me on writing it please!

I think a problem with a question like this is we don't know precisely what part of the problem you're having trouble with.

It sounds like the sort of question a student might be set in University or School, where (if the student had bothered attending any of the practical classes) he'd have a substantial grounding on what programming environment was in use, how to configure GPIO pins as either inputs or outputs, how to read inputs, how to output high or low and so many other things.

Now if one of us, feeling helpful, were to provide you with complete code that worked in our environment

(a) it might not work for you if you were using a different IDE

(b) you wouldn't be any the wiser as you didn't develop the code, so strictly you hadn't fulfilled the purpose of the class (to understand, develop, test and demonstrate on the school's stm32 platform).

Please tell us more. What have you personally done with the stm32?

We are (most of us) keen to help where people are having specific problems. Did you try to write some code but it wouldn't compile; in that case, what was the compiler error. But it's hard to know what to say when we don't know your starting position or where you're stuck.

It's like the joke where a customer telephones to complain that a particular piece of software doesn't work when the computer is in "O" mode, but it does when the computer is in "I" mode. It took the support person quite a while to glean that the "O" and "I" were the Off and On settings of the power switch on the computer.

Help us to help you,

Danish

LFerr.7
Associate II

Hello, Mrs Danish

Sorry for not explaining well, my english is not very good but what i am trying to do is a sum of two signals. I have write a simple code . I have the violet signal in PE9 and the light blue signal in PB0. I am trying to do the sum of this pins and map it on PE13. Despite iam using a boolen library using (OR || symbols) ,it is not what i expected, because it is not a real sum, in blue color you can see that it is a fake sum. What can i change ? How can i do an accurate sum between pins?

Thank to everyone that will answer. Respect to anyone!0693W00000Npyq6QAB.jpg0693W00000NpyqGQAR.png