Question about Bitcraze Flow Breakout Board with Raspberry Pi and TX2

Discussions about all things Bitcraze
Post Reply
sean112
Beginner
Posts: 16
Joined: Thu Nov 14, 2019 1:51 am

Question about Bitcraze Flow Breakout Board with Raspberry Pi and TX2

Post by sean112 »

Hello everyone,

I am very new to bitcraze, and honestly to hardware integration. I just purchased the Flow Breakout Board online. I wonder if this chip can be used with either Raspberry Pi or Jetson TX2 board? The tutorial with Arduino UNO seems to use analog signals for SDA and SCL. The bitcraze-pmw3901 library looks like it is only assigning the CS pin. If I do not use these pins exactly since I am not using Arduino, is it still possible to use the library?

Thanks for any response.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Question about Bitcraze Flow Breakout Board with Raspberry Pi and TX2

Post by arnaud »

Hi,
It is likely not possible to use the library as-is but you can re-use the algorithms implemented in them.

The breakout board is using both an SPI and an I2C but, you will have to use those on your side. You can adapt the existing code to use your implementation of I2C and SPI instead of the arduino one.

As a side note, it might be much easier to implement the flow part in a small Arduino, like an Arduino micro, and to connect it to your board via serial port or USB, that way the software part in Linux will be much easier since it only requires a serial connection and you can use the lib unmodified to acquire the data you need and transmit them over the serial port.
sean112
Beginner
Posts: 16
Joined: Thu Nov 14, 2019 1:51 am

Re: Question about Bitcraze Flow Breakout Board with Raspberry Pi and TX2

Post by sean112 »

Thanks for the reply. I will try to weight out the pros and cons whether I will use an arduino or not. I still have a few questions about changing to a Raspberry Pi. How can I change the ports of each pin? It seems like the only assigned pin is CS, and changing that is pretty straight forward. How do I change the pin for MISO or ClK? On an arduino or to GPIO pins.

Thanks in advance!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Question about Bitcraze Flow Breakout Board with Raspberry Pi and TX2

Post by arnaud »

The full pin allocation for our Arduino lib happens here: https://github.com/bitcraze/Bitcraze_PM ... pp#L33-L35

As you noted CS is a GPIO while MOSI, MISO and SCK are driven by the SPI diver.

On raspberry pi you will have to use the Raspberry pi SPI interface. There is a couple of driver and libs that exists to use the Rasberry pi IOs , I have used SPI on raspi in the past but I do not keep track of it so I am not sure what is the best to use.

A quick google search lead me to this: https://raspberrypi.stackexchange.com/q ... y-pi/40302. You can apparently run Arduino code on a raspberry pi and the linked project has SPI and I2C support. In theory it should allow you to run the lib unmodified.
Post Reply