How to use the breakout board

Firmware/software/electronics/mechanics
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: How to use the breakout board

Post by arnaud »

A revision about the pulse: apparently the trig pulse should be asserted for ~10us. If this is mandatory, using a timer for generating the pulse is indeed required.

I have not looked in great details but I think you should be able to use the Timer 5 with one channel as output for the pulse and another channel as input for timing the echo. Timer 5 has two channels mapped on PA2 and PA3 port of the deck port.

One info if you stumble on the problem: the two timer 5 channels are channels CH3 and CH4 which is problematic for some case (like implementing pulse measurement, the timer is designed to have CH1/CH2 and CH3/CH4 to work as pair). In our LH implementation we used a XOR gate that is present in the timer to re-route CH3 to the internal CH1. See the initialization of LH: https://github.com/bitcraze/crazyflie-f ... der.c#L118. If my thinking is correct you will need to generate the pulse on CH4 and measure the echo from CH3 using the timer capture registers 1 and 2 for rising and falling edge (the way we do it in LH).
matthieuleonie
Beginner
Posts: 20
Joined: Mon Nov 13, 2017 11:54 am

Re: How to use the breakout board

Post by matthieuleonie »

Thank you so much! We'll try that :)
Post Reply