cancel
Showing results for 
Search instead for 
Did you mean: 

Programming code between pulse number and IO pin On/Off

Andrew2q
Associate II

Originally posted as a comment on the How to write your question to maximize your chances to find a solution article.

Moved to the forum for clarification & better discussion.


How to create programming code based on the information ?

4 REPLIES 4
Andrew2q
Associate II

Merged from separate thread.


I would like to ask if this device can read input digital and analog signals 5 volts and output 5 volts on and off in milliseconds STM32F412G-DISCO. Who can help create programming code based on information ?
Discovery Development Board, STM32F412ZG, 32bit, ARM Cortex-M4 or any other boards ? Described diagram is available that shows and describes the relation between pulse number and IO pin On/Off

Thanks in advance for your answer !

Please clarify what you're actually asking for?

The article describes the information you need to give in your post when asking a question.

Andrew2q
Associate II
  1. Input pin 2 is crankshaft position sensor counting pulses.
  2.  Input pin 3 is reference sensor to toggle LED1 at pulse 20 to go LED1 high at pulse 17 till 20.

3) Output pin 9 is LED1

4) Output pin 10 is LED2

 

At start up the engine both LEDs go HIGH every half cycle at pulse 30 till 33 until the system completes 604 cycles = 70064 pulses then reset to zero.

 

Reference sensor toggle LED1 at pulse 20 to set LED1 high in every half cycle and then LED2 high at pulse 75-78 and so on loop.

 

LED2 ON at pulse 75

LED2 ON at pulse 76

LED2 ON at pulse 77

LED2 ON at pulse 78

 

Cycle reset. Starting a new cycle

 

LED1 ON at pulse 17

LED1 ON at pulse 18

LED1 ON at pulse 19

LED1 ON at pulse 20

Then looping continue.

Reluctor wheel has 60-2 teeth = 58 pulses and two missing pulses is the gap. One pulse takes 1.38ms at the engine speed RPM750.