RGB LCD Shield (ID714)

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
paulstoffregen
 
Posts: 444
Joined: Sun Oct 11, 2009 11:23 am

Re: RGB LCD Shield (ID714)

Post by paulstoffregen »

The Wire library on Teensy 3.0 runs the I2C at 100 kHz. That exactly matches Arduino, which uses 100 kHz.

If you edit Wire.cpp, you can uncomment lines to configure for 400 kHz or 1 MHz. Likewise, the AVR can use I2C at higher speeds, merely by editing the code. The Wire library code on AVR is not very efficient, and of course the AVR is a slower processor, so it might get much faster if you go higher than 400 kHz.

At faster I2C rates, the rise time from the pullup resistors and the capacitance on the lines becomes an issue. On AVR, using only the internal pullups, it just barely works at 100 kHz. Just view the waveforms on a scope to see the issue. 4.7K resistors work very nicely. Often advice on the pullups is given in terms of the "worst case" I2C bus capacitance, which I believe is 400 pF. When only 2 devices are connected on a breadboard, the capacitance is probably in the 30 pF range. (you could easily measure it with touchRead, since the I2C pins support touch sensing on Teensy 3.0)

In Teensy 3.0, there are 3 main clocks: CPU, BUS, and Flash. When Teensy 3.0 is overclocked to 96 MHz (which very nicely, even though it's technically overclocking), the Bus clock is still only 48 MHz, and the Flash clock is 24 MHz. Nearly all peripherals run from the Bus clock, so the I2C peripheral is actually running from the exact same 48 MHz Bus clock when the CPU is at either 96 or 48 MHz.

It's also worth mentioning that the CPU is rarely twice as fast at 96 MHz, due to the small cache size in the flash controller. Only tight loops truly run at twice the speed of 48 MHz. Of course, just like AVR, the overall net performance of any application usually depends on a lot of complex software factors. I2C is a very nice protocol, but its speed is moderate. Using it as a replacement for GPIO (as this library does) is quite slow, regardless of the CPU issuing the requests.

Hefestio
 
Posts: 2
Joined: Thu Nov 15, 2012 9:39 pm

Re: RGB LCD Shield (ID714)

Post by Hefestio »

I am looking to use the RGB LCD Shield Kit (item 716 with positive display) with my Leonardo Arduino. In reading the description it says it is for Classic Arduino shields. Is there a way to make it work with a Leonardo. If i plugged it directly onto the Leonardo would the pins line up? Would it be better to mount is separate from the Leonardo? I am very new to Arduino and any advice is appreciated. Thank you.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: RGB LCD Shield (ID714)

Post by adafruit »

the shield kit will work with the leonardo, no changes required!

Hefestio
 
Posts: 2
Joined: Thu Nov 15, 2012 9:39 pm

Re: RGB LCD Shield (ID714)

Post by Hefestio »

Thank you for the help. I know what my next project is.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”