<< return to Pixycam.com

All Data from PIXY2 SPI?

Hi,

I am using PICAXE BASIC. I can get data from an older PIXY camera, but using the same software to read data from the new PIXY2 I don’t see any data ???

I need to know what is all the data I can get from the PIXY2 via the SPI and what each byte/word means.

Hi Walt,
We did change the protocol for Pixy2 because the older protocol made it difficult to support multiple sensor modes. Please check out this page for information on the new protocol:

https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:porting_guide

Edward

I’ve been trying to send a request to the PIXY2 via SPI and I2C but so far I’m not getting an answer. I really wish the camera just constantly sent x,y data … simply receiving data seems so much easier.

Hello Walt,
Sorry for the problems. If you haven’t done so already, start by sending the sequence:

0xae
0xc1
0x0e
0x00

If you’re not getting a response to this sequence, you might take a look with an oscilloscope to make sure the bits are being sent to Pixy2.

Edward

Hi, I have been trying to port Pixy2 to an Microchip/Atmel SAMD21 using a SPI connection.
As in the earlier response, I have been sending bytes 0xAE, 0xC1,0x0E, 0x00. I have tried all four SPI modes (0 - 3) and I am sending at 20mbit. I have tried delays between sending and response of microsecs to millisecs.
I can see the bytes going out on the logic analyser and bytes being returned, but the response does not seem to make any sense just 0xFE, 0xFF and 0xFDs.
I am assuming that the Pixy can work at 3.3v as the Microchip one does.
I see the Arduino software has an init function, but all it appears to do is prepare the Arduino for the speed, MSB and mode which I have already done on the SAMD21. There does not seem to be any function which prepares the Pixy for data other than the bytes as shown above.
I would appreciate any help you can give.

Regards Mike

Hey Mike,

hmm. I’m no expert (@edge might know better than I) but just reading your post, one thing to check is your data rate - by default, Pixy2 uses 2mbit for SPI. I’m not sure if that would cause the issue you’re seeing. More info on the implementation here: https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:porting_guide#spi

You might also have a look at the packet reference, if you haven’t already. https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:porting_guide#pixy2-serial-protocol-packet-reference

Hope this helps!

Cheers,
Jesse

Hello,
Make sure you are in “SPI with SS” mode instead of “Arduino ICSP SPI”

https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:pixymon_index#interface-tab

Pixy2 runs off of 5V – but I think you are asking about 3.3V signaling for the SPI. (Yes, 3.3V and 5V signalling both work for SPI.)

Edward

Hi, Here’s my current code using UART/Serial mode 9600BAUD that still doesn’t seem to work;

GetData:
low C.0
sertxd (“The 1st data before serin = 0xae,0xc1,0x0e,0x00,sigMap,maxBlocks”,13,10,13,10)
hserout 0, (0xAE,0xC1,0x20,0x02,“sigMap”,“maxBlocks”)

sertxd ("The 1st data is ",13,10,13,10)
hserin [1000,GetData],0,2
SerTxd (b1, b3,b2, b5,b4, b7,b6, b9,b8, b11,b10, b13,b12)
high C.0
return

Hey Walt,

do you get a response? What’s not working? Any additional info can help us diagnose the issue.

Cheers,
Jesse

Where I am at right now;

I figure once I can get comm working between the PICAXE 28X2 and the PIXY2 the rest should be easy.

Sorry, I still need help understanding what’s wrong. What is the expected response from Pixy2, and what are you getting?

Hi,

All I got is zeros in the buffer … the camera never sends data back or I’m not communicating with the camera.

Hello,
Have you tried your camera with an Arduino to see if it’s functioning correctly?

Edward

Hi,

I don’t have Arduino.

I’m trying to determine if there might be an issue with your Pixy hardware. If you test your Pixy on an Arduino and everything is working, it might help you narrow down the problem.

Edward

Hi,

Give me a link to the basic Arduino tests.

Hey Walt, try the instructions here: https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:hooking_up_pixy_to_a_microcontroller_-28like_an_arduino-29

Thanks,
Jesse

I’m not understanding how to fix this;

You need to delete these brackets: ][

I don’t understand what they’re doing there…

Hi,

I rebooted my PC, opened up the ccc_hello_world example, plugged in the Arduino UNO to the USB, the program passed the check, but when I did an download to the Arduino UNO I got this message;

Arduino: 1.8.12 (Windows 10), Board: “Arduino Uno”

Sketch uses 7494 bytes (23%) of program storage space. Maximum is 32256 bytes.
Global variables use 508 bytes (24%) of dynamic memory, leaving 1540 bytes for local variables. Maximum is 2048 bytes.
An error occurred while uploading the sketch
avrdude: ser_open(): can’t open device “\.\COM14”: The system cannot find the file specified.

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.

So then I plugged in the PIXY2 USB and got this error;

Arduino: 1.8.12 (Windows 10), Board: “Arduino Uno”

Sketch uses 7494 bytes (23%) of program storage space. Maximum is 32256 bytes.
Global variables use 508 bytes (24%) of dynamic memory, leaving 1540 bytes for local variables. Maximum is 2048 bytes.
avrdude: ser_open(): can’t open device “\.\COM14”: The system cannot find the file specified.

Problem uploading to board.
See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.