OTG Mouse for stable flight. [ now SPI not OTG ]

Firmware/software/electronics/mechanics
BillyBag2
Member
Posts: 45
Joined: Wed Jul 10, 2013 8:54 am

Re: OTG Mouse for stable flight.

Post by BillyBag2 »

SuperRoach wrote:120-200mv should be fine. We've had people use a 200mv tx+75mv camera alright. The battery did take a hit though.
Um? I think you are talking mA. (milli amps) The issue I had was that the voltage supply of 2.8v was too low to drive the mouse chip. The battery can be up to something like 4.1v, which is too high for the mouse chip. However there is a 5v - 3.3v converter on the mouse module with a very low "dropout" voltage of 0.2v. So a battery voltage of 3.5v and above should be enough to drive the voltage regulator that will drive the mouse chip. (I had expected a typical dropout voltage of 1v or more.)

(Grr where is my spell checker?)
BillyBag2
Member
Posts: 45
Joined: Wed Jul 10, 2013 8:54 am

Re: SPI Mouse for stable flight.

Post by BillyBag2 »

OK, this project is still ticking over in the background. Been trying to find some good inflight parts for connecting to the extention port.
See: http://forum.bitcraze.se/viewtopic.php?f=6&t=518

Image
P1040666 by billybag2, on Flickr
BillyBag2
Member
Posts: 45
Joined: Wed Jul 10, 2013 8:54 am

Re: SPI Mouse for stable flight.

Post by BillyBag2 »

So I am abit over budget with payload. The Module with the lens mount is 7.69gm the suplied lens is very good quality but is 5.29gm. So the total is 12.98gm.

However I got a usb webcam off wbay for a few quid and it has a real cheep plastic lens that is 1.51gm. Its probably a different focal length so I will have to experiment with it. Also the original lens is for IR, not sure if the new one is and how much difference this will make.

Image
P1040667 by billybag2, on Flickr
BillyBag2
Member
Posts: 45
Joined: Wed Jul 10, 2013 8:54 am

Re: OTG Mouse for stable flight. [ now SPI not OTG ]

Post by BillyBag2 »

Another issue bubling in the background is running the SPI at 2MHZ or less. Not used the Micro controller before the flie project. I think I can work it out with the manual and the periph support lib suplied but if anyone knows how to do this off the top of their head this would help. I seam to remember seeing the clock divider in the docs but for some reason the periph support lib did not go as low as 2MHZ. As I said, I think I can work it outt, but if someone has used this chip before the insider knowlage would be very useful.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: OTG Mouse for stable flight. [ now SPI not OTG ]

Post by tobias »

When you initialize the SPI peripheral you can set a baudrate pre-scaler. See the nrf24l01 driver for an example.
The pre-scaler is set by this row:

Code: Select all

  SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_8; 
You can set it to any of these values:

Code: Select all

#define SPI_BaudRatePrescaler_2         ((uint16_t)0x0000)
#define SPI_BaudRatePrescaler_4         ((uint16_t)0x0008)
#define SPI_BaudRatePrescaler_8         ((uint16_t)0x0010)
#define SPI_BaudRatePrescaler_16        ((uint16_t)0x0018)
#define SPI_BaudRatePrescaler_32        ((uint16_t)0x0020)
#define SPI_BaudRatePrescaler_64        ((uint16_t)0x0028)
#define SPI_BaudRatePrescaler_128       ((uint16_t)0x0030)
#define SPI_BaudRatePrescaler_256       ((uint16_t)0x0038)
The SPI clock will then be Fplck/spi-pre-scaler thus 72Mhz/spi-pre-scaler. The slowest possible clock is 72MHz/256 = 281250Hz
BillyBag2
Member
Posts: 45
Joined: Wed Jul 10, 2013 8:54 am

Re: OTG Mouse for stable flight. [ now SPI not OTG ]

Post by BillyBag2 »

tobias wrote: The SPI clock will then be Fplck/spi-pre-scaler thus 72Mhz/spi-pre-scaler. The slowest possible clock is 72MHz/256 = 281250Hz
Thanks for this. Saves me guessing if I have read the spec correct.
marco.tognon
Member
Posts: 38
Joined: Mon Sep 16, 2013 10:22 am

Re: OTG Mouse for stable flight. [ now SPI not OTG ]

Post by marco.tognon »

Hey BillyBag2,

I'm just started to work with the crazy flie but i'm trying to make the flie completely automomus. For this porpos I was thinking your same solution: mous optical flow!
Altought i'm new about programming firmware and so on, actually I would learn from you and may be cooperate with you! :D
Post Reply