Adafruit, could you "tweak" your RGB LCD Shield (I2C with tac buttons ) (ID714) libraries so it would work with the
Teensy 3.0 stamp that you also sell? This ARM stamp (Arduino software compatible) overclocks at 96 MHZ!
Right now, your sketch "hello world" displays nothing on the Teensy 3.0 but displays properly when used on an Arduino.
BTW... I was able to make your Macetech DS3231 "precision" I2C RTC, on the ported Adruino "wire" library for the Teensy 3.0 to work. Since you are using this same library, on your RGB shield, then I don't believe that this wire library is the problem.
RGB LCD Shield (ID714)
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88090
- Joined: Sat Feb 07, 2009 10:11 am
Re: RGB LCD Shield (ID714)
The problem is most likely in the delayMicroseconds() function in the Arduino library. The shield library uses delayMicroseconds() to implement the timing constraints for sending commands to the LCD controller.
-
- Posts: 19
- Joined: Sat Oct 13, 2012 5:23 pm
Re: RGB LCD Shield (ID714)
Ok, let me know when you "tweak" the delay(microseconds) and get the LCD library to work with the Teensy 3.0. I will buy several more RGB LCD shields from Adafruit.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: RGB LCD Shield (ID714)
Actually, if the problem is with the delay(microseconds) call, then it's not something that can be fixed in the adafruit library. It's a problem with the implementation of the delay function in the Teensy 3.0 runtime. You should contact PJRC with a bug report.
- paulstoffregen
- Posts: 444
- Joined: Sun Oct 11, 2009 11:23 am
Re: RGB LCD Shield (ID714)
Teensy 3.0 has a very accurate delayMicroseconds() function.
One possible issue is the pullup resistors on the SDA and SCL pins. Teensy 3.0 does not have the pullup resistors when using the Wire library, so you must connect pullup resistors to those pins. Arduino has weak pullups when using Wire. Unfortunately, this chip's I2C hardware doesn't allow the on-chip pullup resistors (apparaently that technically violates the I2C standard, even though it usually works and is very convenient).
I saw there's two 4.7K resistors on this board, but I couldn't find a PDF schematic to view, so I can't tell if those are on the SDA and SCL lines, or connected to something else.
I looked at the library code briefly. It looks like it should work. I suspect missing pullup resistors is probably the issue. If not, I'll investigate further.
On delayMicroseconds, there are 14 uses in this library. The code is a simplistic adapation of the normal LiquidCrystal library, with the digitalWrite calls replaced with the I/O expander. Most of the delayMicrosecond uses are for very short delays... which would be meaningful with normal digitalWrite, but they're far shorter than the 180+ microsecond overhead to update the MCP23017 chip. One of the uses is for 50000 us, which will work accurately on Teensy 3.0, but it's well over the documented maximum of 16383 us for Arduino!
http://arduino.cc/en/Reference/DelayMicroseconds
One possible issue is the pullup resistors on the SDA and SCL pins. Teensy 3.0 does not have the pullup resistors when using the Wire library, so you must connect pullup resistors to those pins. Arduino has weak pullups when using Wire. Unfortunately, this chip's I2C hardware doesn't allow the on-chip pullup resistors (apparaently that technically violates the I2C standard, even though it usually works and is very convenient).
I saw there's two 4.7K resistors on this board, but I couldn't find a PDF schematic to view, so I can't tell if those are on the SDA and SCL lines, or connected to something else.
I looked at the library code briefly. It looks like it should work. I suspect missing pullup resistors is probably the issue. If not, I'll investigate further.
On delayMicroseconds, there are 14 uses in this library. The code is a simplistic adapation of the normal LiquidCrystal library, with the digitalWrite calls replaced with the I/O expander. Most of the delayMicrosecond uses are for very short delays... which would be meaningful with normal digitalWrite, but they're far shorter than the 180+ microsecond overhead to update the MCP23017 chip. One of the uses is for 50000 us, which will work accurately on Teensy 3.0, but it's well over the documented maximum of 16383 us for Arduino!
http://arduino.cc/en/Reference/DelayMicroseconds
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: RGB LCD Shield (ID714)
@Paul -
- Yes, the two 4.7K resistors are pull-ups on SDA and SCL (see below for schematic).
- Thanks for pointing out the delayMicroseconds(50000) call.
- I don't see anything obviously wrong with the library, either. Inspired by your a.x = (xha << 8 | xla) >> 4; example on Kickstarter, I even did a quick scan for potential type-portability situations.
@adafruitandy -
How are you powering the shield?
Did you modify the "hello world" sketch at all?
- Yes, the two 4.7K resistors are pull-ups on SDA and SCL (see below for schematic).
- Thanks for pointing out the delayMicroseconds(50000) call.
- I don't see anything obviously wrong with the library, either. Inspired by your a.x = (xha << 8 | xla) >> 4; example on Kickstarter, I even did a quick scan for potential type-portability situations.
@adafruitandy -
How are you powering the shield?
Did you modify the "hello world" sketch at all?
-
- Posts: 19
- Joined: Sat Oct 13, 2012 5:23 pm
Re: RGB LCD Shield (ID714)
On my Arduino, I am using the +5vdc. (Works fine)How are you powering the shield?
On the Teensy, I am using the power, from the USB (+5 VDC) Vin
Ut oh ... just realize the Teensy can power the shield at 5 VDC BUT the
Teensy 3.0 ARM is a 3 vdc device which means the I2C bus is running at 3.0 vdc logic ?
Probably need to obtain level converters OR Adafruit should design a RGB Display shield for 3 VDC and 5 VDC operation
Absolutely not.Did you modify the "hello world" sketch at all?
Since Adafruit sells both the Teensy 3.0 and the Adafruit RGB I2C shield then it should be only a matter
of Adafruit hooking your RGB display to the Teensy 3.0 and tweaking the libraries, you designed, for proper operation.
Please note: I do not have any expensive professional test equipment to root-out this problem.
The way the construction states both I2C pullups are on the top side of the RGB shield. By installing (soldering) the 2x16 displayYes, the two 4.7K resistors are pull-ups on SDA and SCL
there is no more access to these resistors. The installation should require the user to install them on the back in case
there are modifications on the I2C bus. What happens if you need to remove these resistors?
Also, you really should provide schematics for your kits.
Last edited by adafruitandy on Sun Oct 21, 2012 6:33 am, edited 2 times in total.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: RGB LCD Shield (ID714)
Okay, just wanted to make sure you weren't trying to run it off the 3.3 from the Teensy.adafruitandy wrote:On the Teensy, I am using the power, from the USB (+5 VDC) Vin
Yup, and we will do that (although I don't think it's necessarily a simple "tweak"). Teensy 3.0 supplies are limited - I don't have one here.adafruitandy wrote:Since Adafruit sells both the Teensy 3.0 and the Adafruit RGB I2C shield then it should be only a matter
of Adafruit hooking your RGB display to the Teensy 3.0 and tweaking the libraries, you designed, for proper operation.
We're not expecting you to do that. But it helps us to ask you to collect as much diagnostic information as you canadafruitandy wrote:Please note: I do not have any expensive professional test equipment to root-out this problem.
Schematic and board layout are linked right on the tutorial pageadafruitandy wrote:Also, you really should provide schematics for your kits.
-
- Posts: 19
- Joined: Sat Oct 13, 2012 5:23 pm
Re: RGB LCD Shield (ID714)
@driverblock
Did you read my "re-edited" post on the 3vdc I2C bus?
Did you read my "re-edited" post on the 3vdc I2C bus?
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: RGB LCD Shield (ID714)
Aha! That would do it! Here ya go:
http://www.adafruit.com/products/757
http://www.adafruit.com/products/757
- paulstoffregen
- Posts: 444
- Joined: Sun Oct 11, 2009 11:23 am
Re: RGB LCD Shield (ID714)
It turns out I actually have this RGB LCD shield. Well, it wasn't fully soldered, but for the sake of testing I finished soldering it. Then I hooked it up to a Teensy 3.0.
It worked on the first try!
It worked on the first try!
- Attachments
-
- adafruit_rgb_lcd_test.jpg (98.88 KiB) Viewed 3174 times
- paulstoffregen
- Posts: 444
- Joined: Sun Oct 11, 2009 11:23 am
Re: RGB LCD Shield (ID714)
Hopefully this photo can help you troubleshoot the problem.
A level converter is technically the correct way to hook this up. But the 4.7k resistors don't inject a huge current to the pins, so it's not a big deal.
As you can see from the photo, it does indeed work. I did not edit any code at all.
A level converter is technically the correct way to hook this up. But the 4.7k resistors don't inject a huge current to the pins, so it's not a big deal.
As you can see from the photo, it does indeed work. I did not edit any code at all.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: RGB LCD Shield (ID714)
Curiouser and curiouser…
Thanks, Paul!
@adafruitandy
Does your setup look like this?
Thanks, Paul!
@adafruitandy
Does your setup look like this?
-
- Posts: 19
- Joined: Sat Oct 13, 2012 5:23 pm
Re: RGB LCD Shield (ID714)
Yes, exactlyDoes your setup look like this?
driverblock and paulstoffregen thanks for your help!
It is nice conversing with knowledgeable support other than
the ones, that I have encountered at, "Sparky Hqtrs in Boulder, Co
I just reduced the I2C bus just down to only the display (without using level converters) and now the
RGB shield LCD display works with no library modifications necessary on the Teensy 3.0.
To say that the Arduino library "ports" work flawslessy on the Teensy ARM 3.0 at 24, 48 and 96 MHz is an extreme understatement!
BTW ...I think I would still need proper level conversion to run at the high "overclocked" speed of 96 Mhz and with other I2C bus modules?
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: RGB LCD Shield (ID714)
I2C busses are independently clocked. The system clock rate does not determine the bus speed (apart from, of course, forcing an upper limit).
I don't know what the Teensy 3.0 I2C is clocked at, but a lot of I2C client devices have a top limit of 400KHz. If I'm remembering correctly, the ATMega 328 and 32U4 can run I2C at 400KHz. It's entirely possible that the Teensy 3.0 runs I2C at the exactly the same speed as a Uno or Leonardo.
I don't know what the Teensy 3.0 I2C is clocked at, but a lot of I2C client devices have a top limit of 400KHz. If I'm remembering correctly, the ATMega 328 and 32U4 can run I2C at 400KHz. It's entirely possible that the Teensy 3.0 runs I2C at the exactly the same speed as a Uno or Leonardo.
Please be positive and constructive with your questions and comments.