<< return to Pixycam.com

How To interface Pixy with pic microcontroller?

Hi

I’m using the PicMicrocontroller. I want to comunicate Pixy with SPI line. But but I don’t know how to do.

This is Pixy Object block format.

Bytes 16-bit words Description

0, 1 0 sync (0xaa55)
2, 3 1 checksum (sum of all 16-bit words 2-6)
4, 5 2 signature number
6, 7 3 x center of object
8, 9 4 y center of object
10, 11 5 width of object
12, 13 6 height of object

How I read the Pixy? How will be process sequence?

Thank You

Hi Ferhat,
Interfacing Pixy over SPI is pretty straightforward – just connect MOSI to MOSI and MISO to MISO. You don’t need to bother with slave select.

The rest is parsing the data stream. The Arduino library is a great place to start:

But your first program should be looking for sync words (0xaa55) so you can separate the object blocks and verify that your communications (connections, SPI controller initialization on your PIC, etc) are all good.

thanks!

Hi Ferhat,
We wrote this recently and it might help —

http://cmucam.org/projects/cmucam5/wiki/Porting_Guide