Hi Charmed Lab.
I have a question to ask. Since the pixy becomes Master in I2C communication, what is the default and maximum speed of pixy when communicate using I2C. Is the speed can be adjusted or can we adjust the speed of I2C on microcontroller side?
Another question, I looked the arduino code for SPI but I’m confuse whether Arduino behaves as Master or Slave in that communication. Your documentation said that Arduino becomes Slave and Pixy become Master but the Arduino SPI library only supports Master mode. How come this happened? or maybe I am confusing. Please explain Sir…
Thanks
Hi Dungun,
We use the “SPI library”:http://arduino.cc/en/Reference/SPI that is provided by Arduino, which always has the Arduino as master. Where does our documentation contradict the master/slave designation? Its possible we made a typo somewhere. The documentation “here”:http://cmucam.org/projects/cmucam5/wiki/Hooking_up_Pixy_to_a_Microcontroller_like_an_Arduino#SPI states that Pixy operates as an SPI slave.
I need to look in to the I2C speed a bit more. We’ll get back to you about that.
Scott
Actually I’m confuse with your documentation. So the Arduino is Master and Pixy is slave for both communication (SPI & I2C). Am i right sir?
Hi Dungun,
Yes, you are correct. Pixy operates as a slave in both I2C and SPI communication.
Scott
Looks like the LPC4300 supports Standard Mode (100 kbits/s), Fast Mode (400 kbits/s), and Fast Mode plus (1 Mbits/s). Although, currently the Pixy firmware uses only the Standard Mode, so the clock is 100 kbits/s.
Scott
(just bear in mind that the clock is provided by the master, not Pixy)
So since pixy is slave and microcontroller is master (Microcontroller provides clock to the Pixy), I can make pixy operates with 1Mbps by configuring Microcontroller I2C to 1Mbps regardless of LPC4300 speed. Am I right sir?
Sure, that’s the right idea, Pixy just accepts whatever clock is provided, but 1Mbps might be a bit on the high side from a signalling perspective. It will depend on how long your cable is, how noisy your environment is, etc.