How to use STM32F401 mcu to driver color sensor.
Hi, all.
I hope anyone who can help me ~
I now use STM32F401 & CubeMx to driver color sensor, the color sensor's timing requirements like this:
I use master/slave Time to do this:
master Tim1' CH1 to seed PWM(cycle is 500ns, high 200ns, low 300ns), and Tim1 also use for DMA to get data from Dout port(DMA cycle is 500ns too). And use slave Tim3 to control Tim1 to send 12 pulses at sample time. every 12 pulses finished, stop tim1&tim3, wait t2(4us)time, then start again.
According to the above logic, I got this wave:
From this picture, I unable to get 12 pulses stably(sometimes 12 times, sometimes 14 times and sometimes 10times).
Thanks for everyone again.
