I want to try using the pixy SPI interface for my project with the ActivityBot in this thread:
So far I have used the pixy DAC to ActivityBot ADC which is good for tracking one object, and the UART mode to track up to 3 objects. According to the CMUCAM5 site, Pixy transmits at 1 u sec rate with a 20msec new Frame rate, and they recommend using SPI mode to capture as many Blocks of data (objects) per frame as possible. A fast transfer rate is needed to use their 'colorCode' mode that uses combinations of colors.
When I try SPI in C (from Simpletools library), the most I can capture is 2 Blocks before a new Frame starts (compared with 3 to 4 for UART).
I tried using the spin program "SPI Asm DEMO.spin" with the shiftin function just filling an array in one repeat loop and then subsequently analyzing the data array in a second repeat loop. I was able to get more than 6 blocks of data per frame. I had set the Timedelay value in SPI.Start() to 15 which gives a 1 u sec clock.
1. Is the slow performance of SPI in the C Simple Libraries due to a clock setting (I was not able to find the source of the SPI)
2. If so, can it be changed to speed it up?
3. If so, how fast can it go, and how is it done?
(While the spin method works, I want to use C because of the other activitybot libraries, and because I don't know spin well enough to rewrite my code. -- maybe as a goal for the future, but not now.)
Thanks for your help,