i connect arduino due with pixy and run the “hello_world” example. But I can’t see messages printed from Serial Monitor. Although i saw and checked “Troubleshooting Guide” the all was correct
Hi Edward,
Which communication method are you using between Pixy and the Arduino Due?
Scott
thanks for your reply
i use SPI communication and saw though these steps in this page
http://cmucam.org/projects/cmucam5/wiki/My_Arduino_isn’t_receiving_data_from_Pixy
But it didn’t work
Hi Edward,
Are you able to try this on a different (non-ARM) Arduino to verify the communication? We’ve had some compatibility issues with the Due, so I’m trying to eliminate other possibilities.
Thanks.
Scott
I am having the same problem. It works fine on an Arduino Uno and connected to a PC directly via USB, but when I switch to an Arduino Due, I cannot get it to work. I worked around the issue of the new SPI.h drivers and got the “hello world” sketch to compile and upload to the Due. I connect the Pixy via the 6-pin SPI interface and it gets power. However, I cannot get the software to detect blocks.
Is there an issue with running Pixy at 3.3V instead of 5V?
I’ll answer my own question. I see from this earlier post that the Pixy runs on 3.3V, so should have no issue with voltage levels for the Arduino Due board.
http://www.cmucam.org/boards/8/topics/3889
I now suspect it may have something to do with the SPI library that comes with the Arduino 1.5.x IDE. I am seeing some complier warnings, but was ignoring those until now.
Hey guys!
Im have my Pixy talking to a Due via I2C port (to do so, dont forget to switch a data output port to 1 in the settings menu). I havent tried SPI with DUE though, but I2C works!
My attempts to communicate via I2C and SPI failed, but I did get it to work via UART (Mode 3 in the setting menu). Progress!! Maybe just need to wait for Arduino to finalize their libraries for Wire.h and SPI.h.
I just tried talking to my Due via SPI port and it worked. I think I know what could have been an issue in your case.
So arduino due has SPI pins and ICSP pins (6 pin headers). Make sure that your pixy is plugged in to SPI pins (right next to pins 0,1,14,13, close to erase button) and NOT ICSP pins (next to IOREF, reset pins). It will not work if you are trying to use ICSP pins. Also, make sure that your ribbon cable is connected in a right direction, aka pink wire on a strip needs to be connected to pin 1 on the SPI header which is marked with a dot
@Vadim Linevich, I’ve tried that many times and cannot make it work. In my experience, plugging in the ribbon cable the wrong way shorts the board, so I know right away when I’ve done it wrong. I’m curious:
- What is the source of SPI.h that you are using? I had to change the code to reference a different SPI.h to even get it to compile. Maybe I was picking the wrong one? I’ve tried:
#include “C:\Program Files\Arduino\hardware\arduino\sam\libraries\SPI\SPI.h”
It successfully compiles, but has some warnings. Perhaps you’ve found a better source?
- What version of the Arduino IDE are you using? I’m using v1.5.7beta (the latest available at the time I’m writing this). I’m wondering if you’re using an earlier version that is more stable?
@Bit Head
I was able to get pixy to talk to arduino UNO and MEGA via SPI before using some old version of SPI library. To get my DUE up and running, I had to redownload my arduino IDE and get the latest one. My previous version of arduino IDE did not have arduino DUE listed in the board menu. My version of SPI library is whatever version included with Arduino IDE v1.5.7 distribution. (so i guess im running the same arduino IDE version as you are)
Theoretically speaking, Pixy hello_world example code should work without any problems if you make your connections right. I will take a picture of how I would connect my Pixy to DUE via SPI and post it here as soon as I get to my lab. Also, you may have a crappy ribbon cable, those things are known to have poor transmission. Maybe one of the lines has a poor connection. Have you tried talking to say…arduino UNO via SPI? If you cant talk to UNO, then you either have a wire problem, or something wrong with Pixy itself. However, since you were able to get Pixy working with UART, this suggest that camera is fine. See if you can talk to it via I2C (make sure to get your wiring right!)
Also, for debugging purposes, I would reccomend you get pixy talking to arduino UNO first via ISP before you touch DUE. Here is why.
So arduino DUE and the SPI library (at least the one that im using) are not quite compatible as is. If you take your DUE and try to talk to some other device like a IMU or a gyroscope using SPI library, you will run into an issue. Your code will probably not compile. This is because DUE has a fast clock and it runs super fast! If you look in your pixy.h library file, you will find this (cant reference code lines cause i modded my library)
@ #ifdef SAM3X8E
// DUE clock divider //
SPI.setClockDivider(84);
#else
// Default clock divider //
SPI.setClockDivider(SPI_CLOCK_DIV16);
#endif
@
that precompiled #ifdef SAM3x8E thing fixes the problem, (arduino DUE has SAM3x8E chip), so thats a little caveat there that will make DUE work with current SPI library
I hope this helps!
@Vadim Lenevich
Thanks very much for the reply. As reported in the thread above, my Pixy works fine with an Arduino Uno via SPI, so I’ve ruled out the ribbon cable or the Pixy as the issue. I see the code you are referencing in the Init() function within pixy.h, and I confirmed I call this function within my sketch, so that is not the issue either. As mentioned above, my code compiles for the Due, but has many warnings. Do you get warnings when you compile?
Hello Bit Head!
Im using an Arduino IDE to compile and upload, I havent gotten any warnings that are relevant to camera.
Sometimes i randomly get some warnings that have to deal with uploading stuff to Due but none of it is caused by pixy’s software / hardware (to the best of my knowledge)