[SOLVED]Can LED deck and Flow deck use together?

Discussions about all things Bitcraze
Post Reply
aqqz
Beginner
Posts: 16
Joined: Wed Nov 18, 2020 1:40 am

[SOLVED]Can LED deck and Flow deck use together?

Post by aqqz »

Hi, I`m a student and I am using crazflie for some research recently. Now we have such a demand: we want to make the PCB by ourselves and use the led-ring deck and flow deck together, but we don't know whether it can be successful according to the existing circuit.

I refer to https://wiki.bitcraze.io/projects:crazy ... ards:index the Deck pin allocation on the page. Is there any pin conflict between the two decks? If you want to change the circuit, any good suggestions?
Last edited by aqqz on Thu Nov 26, 2020 1:26 pm, edited 1 time in total.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Can LED deck and Flow deck use together?

Post by arnaud »

Looking at the table, but mostly looking at the schematic, there is a conflict with IO3.

IO3 is used for the flow sensor Chip select as well as for the led-ring front LED PWM signal.

Since you want to make your own PCB this is not a huge problem, it will require some work on the drivers though in order to make you deck working in the Crazyflie.

You will need a driver in the Crazyflie anyway since you are making a new deck. You can initialize existing deck drivers from your driver (we do that in the flow),

I see at least 2 options:
1 - Either you keep IO3 for flow chip select and you do not use the front LED, you will need to add a parameter to the ledring driver to disable the front LED
2 - Or you move the flow chip select to another unused IO and modify the flow driver to use the other IO as chip select

I guess the way do go depends if you want to keep the front LED or not.
aqqz
Beginner
Posts: 16
Joined: Wed Nov 18, 2020 1:40 am

Re: Can LED deck and Flow deck use together?

Post by aqqz »

Thanks for your advices,if i want to disable the front led,how can i add a param to disable it,in .py or .c files?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Can LED deck and Flow deck use together?

Post by arnaud »

Hi,

As a side note a similar modification has been documented both in the wiki and in hackster: https://wiki.bitcraze.io/misc:hacks:topleddeck

None on these modification actually did modify the firmware so my assumption is that as long as you are not actively driving the front LED by setting its parameter, you will not affect the flow deck.

To be more proper, the front LED should be disabled completely. One problem is that while it is possible to initialize one deck driver from another deck driver, there is currently no way to pass extra parameter to a deck driver. The way we have been handling that currently (for flow v1 and v2 for example) is to add a new deck driver entry point for the new version. So one clean-ish way would be for you to add a new ledring deck driver structure in this file: https://github.com/bitcraze/crazyflie-f ... 1087-L1096. The new driver, with vid:pid==0:0 could call a different init function that disables the front LED and call the currently used init function.

Then your new deck driver can call the led ring without front led driver.
aqqz
Beginner
Posts: 16
Joined: Wed Nov 18, 2020 1:40 am

Re: Can LED deck and Flow deck use together?

Post by aqqz »

Thanks,i modify this https://github.com/bitcraze/crazyflie-f ... #L566-L572,change pin_4

to pin_12 and i test the headlight is work when i connect the IO3(pin_4) and IO4(pin_12).Now i think i can use IO4 to control the headlight and no

conflict with the flowdeck. Yes,we will make a new PCB deck content with led and flow. I hope this can be a good start! Thanks!
Post Reply