Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 19 of 19

Thread: uncannyEyes and Teensy 3.1/3.6

  1. #1
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,256

    Cool uncannyEyes and Teensy 3.1/3.6

    I downloaded the uncannyEyes sketch that Phillip Burgess wrote and published over on an Adafruit blog: https://learn.adafruit.com/animated-...ing-teensy-3-1

    When this was written it was explicitly for the Teensy 3.1, and runs also on the 3.2. I just ran it on my beta 3.6, though there are some issues:

    I bought two no-name 1.44" 128x128 TFT SPI displays from ebay rather than the Adafruit versions: http://www.ebay.com/itm/122005165823...%3AMEBIDX%3AIT. Of course there is no datasheet, not even a Japanese only version that Adafruit puts up for their 1.44" TFT display.

    Note, as I've mentioned before, the Teensy ST7733 code does not have the additions that were added to the Adafruit code base which the uncannyEyes program uses, so I swapped to use the Adafruit version in this case. At some point, I may dig in and backport the changes Adafruit has made into the Teensy version, but since I'm switching to the OLED versions, I might not.

    For whatever reason, the display came with one side soldered in, but when I tried using those pins, they didn't work with SPI. So instead, I clipped off those pins and soldered in some right angle headers on the other side. After fixing some solder problems, the displays seemed to work.

    I changed the pinout to move pin 7 (data/command pin) to pin 4 so that I could eventually use the full prop shield and have it sense motion to adjust the eyes (pin 7 is the LED enable on the prop shield), and for now, I deleted the various analog inputs and buttons and just had the eyes moving on their own.

    Now, I have more Teensy 3.1's lying around, so I started with a 3.1, and it worked on one display, but it would go wonky with two displays. I put a USB voltage monitor on the unit, and saw each display was pulling in about 120 mA. One is barely enough for the 3.1's voltage regulator (185 mA), and probably exceeds the specs. I figure the voltage regulator of the Teensy 3.2 might be up to the task (it is kind of close to the spec), but I didn't have a Teensy 3.2 that was easily accessible. So, I figured why not try the Teensy 3.6 which has a similar/same regulator as the Teensy 3.2. And sure enough it worked. I originally cut the speed down to 96 and it worked. I then went to the normal 120 MHz, and decided to press my luck and go to 240 Mhz. It still worked.

    I tried powering the displays with 5v and using 3.3v data streams, and they didn't work. I suspect they might work if I level shifted the data pins with a fast enough level shifter. If I use a lipo battery to power the Teensy, it likely would work if I power it from VIN.

    All of the speeds that I tried it at, I can see some flicker.

    I decided to upgrade to the 1.5" OLED display to get the better colors and reduce the flicker. I ordered a New Haven display from digikey (http://www.digikey.com/product-detai...SC3-ND/5788624). According to the datasheet, the display wants to use 80mA to 200mA. Hopefully it will run on USB 5v with 3.3v data. Note, the Adafruit blog says that you have to lower the Teensy 3.1's speed to 48Mhz to get it to work (with the Adafruit display). We will see how the New Haven display works.

    Is there an example of using the motion sensors in the prop shield to identify move left and move right operations? I know it can track in 3 directions, but until now, I've mostly used the prop shield for sound, data storage (for mp3/wav files), and run neopixel LEDs. So more things to learn and try.
    Last edited by MichaelMeissner; 10-01-2016 at 04:59 AM.

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,256
    In terms of flicker, I find the TFT displays to be sensitive to noise. In particular, if I put the wires immediately behind the display, I get flicker, and one display looked like it the connection was eradic. When I moved the wires to another row on the breadboard to give it some space, the flicker went away. Power for the Teensy 3.6 running at 180 Mhz with two displays is 340-360 mA/5v at the USB end. I'm still kind of nervous about that power draw on the Teensy 3.6's 3.3v bus (Paul says that the 3.2 regulator is spec'ed for 250 mA and 6v, but you can push it up to 10v and 500 mA).

    Now the original guide mentioned about cutting the VIN/Vusb trace, and hooking up the Adafruit Trinket Pro backpack lipo charger. As I understand it, the 5v will only go to the charger, and assuming you have a battery installed, it will use that to charge the battery, and use the battery (3.7-4.2v) for input. If I go that direction, I can use VIN for the display and not rely on the Teensy internal regulator.

    I also picked up a general voltage regulator, that I might install between VIN and the displays to bring the power down to 3.3v.

    <edit>
    I dug up a Teensy 3.2 (that has the full prop shield and the Adafruit Teensy->Feather adapter soldered on to it), and like the 3.1, both screens just go white when I attach them. I can plug in either screen, and it works fine, but it goes all white with both screens. I even lowered the speed to 48 Mhz with the same result. I have the setup breadboarded, and I just removed the Teensy 3.6 from the breadboard, and popped in the 3.2, and reprogrammed it.

    I was able to switch both screens VCC and LED on/off to use the Teensy VIN (which should rule out the Teensy regulator), and it now works with either 5v (USB) or 3.7v (lipo) applied to VIN. So, I don't know why the Teensy 3.1/3.2 don't support two screens, while the 3.6 has no problem (the s/w was written for the 3.1, and presumably the author could run it). It must be something with the no-name screens I picked up compared to the more expensive screens Adafruit sells. Since I have a work around (use the Teensy 3.6 instead of 3.1/3.2), and I will be switching screens to OLED screens, I'm not in need of a solution, but it is a puzzle.
    Last edited by MichaelMeissner; 10-01-2016 at 11:05 PM.

  3. #3
    Senior Member
    Join Date
    Mar 2013
    Posts
    651
    I wonder how many displays you can do, I know the 3.1/3.2 was limited to 2 due to space restrictions.

  4. #4
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,256
    Well, I got New Haven OLED 1.5" NHD-1.5-128128ASC3 displays (http://www.newhavendisplay.com/nhd15...c3-p-9287.html), and I can't make them turn on. I'll probably have to contact New Haven tech support. I'll try to remember where my Arduino Uno is, and try it on that system.

    So, I'll stay with the TFT displays that work on the 3.6. I added neopixels to mix and I discovered 12 LED neopixels from Adafruit are perfect around the eyes.

    I soldered up a new motion prop shield, and mounted it on top of the 3.6. I had hangs when I was doing the orientation setup (which saves to EEPROM), and I recalled that 1.31 beta1 does not yet have defragster's eeprom changes. So I lowered my 3.6's speed to 120Mhz (and also installed the eeprom.c changes into my arduino directory). I want to make it so as you turn left, the eyes turn left, and then as you stop turning, the eyes go back to the center.

    I haven't figured out how to make the prop shield LEDs work with the ST7735's, so I'm running the neopixels on another pin. At the moment, I have the rings plugged into pin 32 and I run them off of 3.3v. Evidently, I have forgiving 16 and 12 pin neopixels that can below spec at 3.3v. However, since the newer neopixels want 3.5-5.5v and you never know when a ring needs to be replaced, I need to dig up the pololu level shifters I used to use for neopixels before getting either the Teensy LC (where you can use the built-in shifter on pin 17/A3) or the LC/motion prop shields.

    Next up, make an initial cardboard case to hold rings and displays, and integrate the motion sensors in. I will probably order 22mm Cabochon round displays to enhance the eyes, and in theory should fit inside the 12 pin LED neopixels.

    <edit>
    I forgot to mention, the 3.6, motion prop shield, 2 TFT displays, and 2 12-LED neopixel rings seems to draw about 360mA. Note, I typically limit the neopixel rings to a power level of 30 for each pixel, so 2 rings should about 50-60mA. I haven't tried it on a li-po. At this point, I'm suspecting that I will just use the 5v USB battery packs, rather than go down to li-po.
    Last edited by MichaelMeissner; 10-09-2016 at 05:39 AM.

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,699
    @MM - First great news you found a germane PJRC use case for the EEprom - and that you found my code - hopefully it exercised well for you if you recalibrated at high speed? I forgot those got written to EEprom as docmented - except the notes don't say what byte area is used just :: "Use File > Send Calibration to write the calibration data to Teensy's EEPROM memory."

    Sumotoy did a multidisplay driver for the 128x128 1.44" TFT display - not sure if you used that and it is the same controller in yours? I used that to good effect, but with only a single display - that was also an Ebay cheapie. His latest update was developed before the T_3.6 went beta so it should have been tested to work there - though maybe it got munged ( if that is what you used ) it updating for T_3.6?

    The T_3.6 may dissipate the regulator heat better - it was the heat that suggested the limit at 250 mA on the T_3.2. The lower incoming voltage from a 4.2V or less LiPo would make less heat burning off the higher voltage. If the T_3.2 was overheating the regulator it would seem the whole thing would shut down - not just fail to a white display. Do the displays going white have the Jumper on the back like the PJRC store TFT's? {details there point to a forum post to close that to get the SD to work} I had one of those go all white until I closed that bypassing an onboard regulator that isn't needed for 3.3V operation.

  6. #6
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,256
    Quote Originally Posted by defragster View Post
    @MM - First great news you found a germane PJRC use case for the EEprom - and that you found my code - hopefully it exercised well for you if you recalibrated at high speed? I forgot those got written to EEprom as docmented - except the notes don't say what byte area is used just :: "Use File > Send Calibration to write the calibration data to Teensy's EEPROM memory."
    I have not done a re-orientation yet, as my wiring is all temporary and I didn't want to have to re-plug it. I will pull it apart tonight when I have more time, and reset the speed to 180Mhz.

    Quote Originally Posted by defragster View Post
    Sumotoy did a multidisplay driver for the 128x128 1.44" TFT display - not sure if you used that and it is the same controller in yours? I used that to good effect, but with only a single display - that was also an Ebay cheapie. His latest update was developed before the T_3.6 went beta so it should have been tested to work there - though maybe it got munged ( if that is what you used ) it updating for T_3.6?
    As I mentioned in an earlier post, I am currently using the Adafruit standard driver. The driver that came with Teensy 1.30 did not have the updates that the code expects. I haven't done a merge yet of those changes. Now that you mention it, I recall sumatoy's driver. I will look it up, thanks.

    Quote Originally Posted by defragster View Post
    The T_3.6 may dissipate the regulator heat better - it was the heat that suggested the limit at 250 mA on the T_3.2. The lower incoming voltage from a 4.2V or less LiPo would make less heat burning off the higher voltage. If the T_3.2 was overheating the regulator it would seem the whole thing would shut down - not just fail to a white display. Do the displays going white have the Jumper on the back like the PJRC store TFT's? {details there point to a forum post to close that to get the SD to work} I had one of those go all white until I closed that bypassing an onboard regulator that isn't needed for 3.3V operation.
    Yeah, and the one Teensy 3.2 I had on hand had the motion sensor prop and the FrankB underneath pad shields soldered underneath the Teensy 3.2 and the Feather adapter on top, so there probably isn't much airflow. The 3.6 has the motion prop sensor attached via the tall stacking headers (and no feather adapter currently). Maybe I'll pick up another 3.2 and try it with more airflow.

  7. #7
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,699
    Having to plug it into a USB cable really makes the ideal calibration range somewhat harder - especially when the limited range or cable gets in the way of the actual range of motion of your application. Would be nice if the Teensy RAM could store the data internally/offline running from a battery or actual system supply and then spew out the data - of course RAM data would mean it couldn't lose power as it transitioned to the PC for upload so that gets difficult.

    Hopefully the Sumotoy link gets you a better library. I wrote it that way because I'm not sure your hardware is directly applicable.

    I only got the Beta PROP shield and it is pinned backwards for my soldered T_3.6's so I haven't tried that.

  8. #8
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    There is 128Byte-wide area in each teensy which is powered by VBAT - to date, it is not used anywhere.
    I made a PULL-Request some weeks ago to include some #defines into the core - but - Paul is right - the names i used where too short.
    Any ideas ? https://github.com/PaulStoffregen/cores/pull/171

  9. #9
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,256
    Quote Originally Posted by defragster View Post
    Having to plug it into a USB cable really makes the ideal calibration range somewhat harder - especially when the limited range or cable gets in the way of the actual range of motion of your application. Would be nice if the Teensy RAM could store the data internally/offline running from a battery or actual system supply and then spew out the data - of course RAM data would mean it couldn't lose power as it transitioned to the PC for upload so that gets difficult.
    Defragster, I did unplug everything and I redid the orientation at 180 Mhz with your new eeprom.c and usb_desc.c, and it did write the EEPROM data and allow me to print the orientation sensor.

    Quote Originally Posted by Frank B View Post
    There is 128Byte-wide area in each teensy which is powered by VBAT - to date, it is not used anywhere.
    I made a PULL-Request some weeks ago to include some #defines into the core - but - Paul is right - the names i used where too short.
    Any ideas ? https://github.com/PaulStoffregen/cores/pull/171
    Well in terms of the ram storage, you do have 8 megabytes of space on the flash memory on the prop shield (in using it, it would destroy the file systems). However, in running the orientation, what really makes it useful is to run the MotionCal and watch for holes in the sphere on the screen. I could imagine a variant that has a OLED/TFT screen attached, but you would likely need to hardwire to a specific screen.

    Quote Originally Posted by defragster View Post
    Hopefully the Sumotoy link gets you a better library. I wrote it that way because I'm not sure your hardware is directly applicable.

    I only got the Beta PROP shield and it is pinned backwards for my soldered T_3.6's so I haven't tried that.
    I did download Somotoy's library, and white it looks rather complete, it's programming interface is completely different from the Adafruit/PJRC version, that I would have to rewrite the code (and I'm not the original author). Note, except for the initial control stuff, the author does not use the ST7735 library, instead does his own SPI FIFO/DMA processing using the techniques that Paul used in the ILI9341_t3 library.

    One thing I dislike about the setup in Somotoy's software (which Adafruit libraries seem to also do) is you a limited to only one type of display, and you have to edit the system include file to choose what type of display you are going to use. His software supports two different setups, both of which use a red PCB. I too have a red PCB, but it is slightly different from either of the other two. I could certainly imagine buying one of each different display to do comparisons, and also supporting old hardware, which might have the old display.

    I've also played around, and the screens don't like being fed 5v for VIN and LED backlight when the data commands are 3.3v, even though the data sheet seems to imply that they do.
    Last edited by MichaelMeissner; 10-10-2016 at 02:37 AM.

  10. #10
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,256
    Well, I've tried various things like using a 3.3v voltage regulator from VIN to power the displays, and I can't get 3.1 to display both displays (the backlight turns on, but I don't see anything on the screen). If I remove one screen or the other, it works fine. I've tried various speed levels down to 24Mhz.

    I am able to run it on the 3.6 fine (using either 3.3v or using the external voltage regulator from VIN), but I ran it over night, and one of the screens stopped displaying information and went all white.

    I still have not gotten the NewHaven OLED displays to work at all.

    So, I'm throwing in the towel on the cheap TFT displays, and I ordered the Adafruit OLED displays last night that the program was written for. Now, to rewire my board. Unfortunately, I will likely have to reduce the speed to 48 Mhz (the 3.6 can run the TFT displays at 240 Mhz, but I don't recall what speed it was running overnight when one display stopped running). I normally run at 120Mhz, since I use EEPROM to hold the last random number seed.
    Last edited by MichaelMeissner; 10-20-2016 at 01:57 PM.

  11. #11
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,256
    In case anybody is still interested.

    Well I got the OLED displays. I first got NewHaven displays, and I couldn't initially get them to work. So, I just plunked down the $80 to get the official Adafruit displays. I must have initially mis-wired the NewHaven displays because after installing the Adafruit displays, I tried the New Haven displays and they work.I find they now work fine. Unlike the ST7735 driver, the D/C pin does not have to be a special chip select pin (9, 10, 15, 20, 21).

    With a Teensy 3.1, I find the Adafruit displays can only run at 24 Mhz (optimized for speed) when I'm using 6" jumper wires. The program says that the author could only run their display at 48Mhz.

    With the New Haven displays, I can run them up to 72 Mhz using the same wire setup. Both the Teensy 3.1 and 3.6 top off at 72 Mhz.

    With the TFT display I can run the Teensy 3.6 at 240 Mhz without display corruption.

    The OLED displays can be powered off of the 5v line rather than overloading the Teensy's internal regulator. The angle of view of the OLED display is much greater than the TFT display.

  12. #12
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,699
    Indeed the $3.30 TFT SPI 128x128's supported by sumotoy code run fine at any CPU speed - and on T_3.1 at double SPI speed.

    OLEDS will have wider view angle as they are unfiltered LED emitters versus the layered backlit TFT designs.

  13. #13
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,256
    Originally I was going to use the motion sensor in the prop shield control the eyes, but I happened to be visiting pololu.com, and noticed they have their distance sensors on sale (sale ends Monday), and I figured that would be more natural, to have the eyes track whatever is closest (left or right) then have have the eye motion be hooked up to the motion of the prop itself..


    Unfortunately, I really don't have any Halloween events lined up next week (and of course whether I will actually finish by this Halloween), but I will see about re-purposing it to a more general prop. I do have a steampunk event in 3 weeks, and I could add the eyes to one of my steampunk box cameras.

    I haven't figured out how to enable the prop shield translators for APA102/WS2812B leds yet when I'm using SPI displays using SPI transactions. At the moment, when I enable the neopixel rings, they are on different pins than 11/13. The rings I'm currently using are old rings that can be driven by 3.3v, but I know I will likely need level shifting on some sort if I ever need to replace the rings.

    At the moment, I'm thinking of two 2x5 cables running off of the teensy protoboard, each one connecting one eye, one distance sensor, and one neopixel ring.
    Last edited by MichaelMeissner; 10-23-2016 at 08:22 PM.

  14. #14
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    Wow, that's a GREAT Idea to use a distance sensor.
    Can you post a video, when it's done ?

  15. #15
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,699
    @MM - you'd need to have multiple to know which way was closer to look right?

    $12 :: HW16P2476: Get 30% off our Carrier with Sharp GP2Y0A60SZLF Analog Distance Sensor 10-150cm, 3V :: They are 33*mA (typical)

    Not good for your use at 6" max but only $9 (not on sale) and only 5*mA (typical):: Sharp GP2Y0D815Z0F Digital Distance Sensor 15cm [6 bucks for 5 and 10 cm] - but it is only digital yes/no and 4x faster.

  16. #16
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,256
    Quote Originally Posted by Frank B View Post
    Wow, that's a GREAT Idea to use a distance sensor.
    Can you post a video, when it's done ?
    Sure.

    Quote Originally Posted by defragster View Post
    @MM - you'd need to have multiple to know which way was closer to look right?
    Yes, I bought two. I had looked at this project: https://www.pololu.com/blog/419/moti...halloween-prop, and I figured it would work as well with just eyes moving.

    Quote Originally Posted by defragster View Post
    $12 :: HW16P2476: Get 30% off our Carrier with Sharp GP2Y0A60SZLF Analog Distance Sensor 10-150cm, 3V :: They are 33*mA (typical)

    Not good for your use at 6" max but only $9 (not on sale) and only 5*mA (typical):: Sharp GP2Y0D815Z0F Digital Distance Sensor 15cm [6 bucks for 5 and 10 cm] - but it is only digital yes/no and 4x faster.
    Yep, I figured I wanted something that could track people walking by, and not close up stuff.

    With the sale price, it was $16.72, compared to $23.90.

    Of course if you are dealing with really small distances, you might be able to use touchRead to track nearby motions (assuming the subject has a common ground with the Teensy).

    On the order, I also bought some 2x5 and 1x12 crimp connector housings to make cables to connect/disconnect (the TFT displays have 8 pins, the OLED displays have 11 pins, though 4 pins are for the SD card, and not needed for the display). I also bought 3.3v and 5v step-up/step-down voltage regulators.

    I figure each 2x5 connector which goes to the 10 pin IDC cable used for JTAG or SPI downloads would have the following pins:
    • 3.3v
    • Ground
    • VIN
    • SCLK (pin 13)
    • MOSI (pin 11)
    • CS for the particular eye (pin 10 or pin 9)
    • D/C (data/command) pin (pin A1)
    • Reset (pin 8)
    • Neopixel pin for the eye's ring (probably A2 or A3)
    • Analog pin for the distance sensor (probably A8 or A9, possibly A10/A11)
    Last edited by MichaelMeissner; 10-23-2016 at 10:03 PM.

  17. #17
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,256

    Angry

    Negative progress -- I briefly touched the side of the soldering iron which caused me to drop it to the floor. Yeah, I have a burn blister on the side of my finger, but it isn't that bad.

    Unfortunately, the iron landed on some velcro strips and the strips melted on the side of the shaft, and now when I turn on the iron it smells of melted plastic. If it had been melted onto just the tip, it would be easy to replace, but it is on the shaft as well. Now to figure out how to clean the iron, or just replace it.

    In the meantime, I got out my old Radio Shack iron. I had forgotten how bad that iron was compared to the iron I was using. There is no power switch, you have to unplug it. The 'tip' I had mounted was just a rounded area about 0.1" wide, and I have no real control with it. Of course the nearby RS's have closed, and I'm not sure RS even sells soldering gear any more if I wanted to replace the tip.
    Last edited by MichaelMeissner; 10-24-2016 at 02:52 PM.

  18. #18
    Junior Member
    Join Date
    Nov 2016
    Posts
    1
    So, I'm a relative newcomer to messing around with pcbs and projects. I completed the animated eyes project with 1.5" OLEDs and a Teensy 3.2, but an in need of larger OLED displays. It's my understanding that the Teensy 3.2 cannot support a larger display. Any idea if the Teensy 3.5/3.6 would be able to handle a larger display?

  19. #19
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,256
    I imagine it depends on the details of the actual display. Right now (for defaultEye.h), the bitmaps for take 141,952 bytes, which is over 1/2 of the flash memory of the Teensy 3.2 (262,144 bytes). The Teensy 3.6 has 4 times the flash memory of the Teensy 3.2. If you double each dimension to 256x256, you will need roughly 4x the memory. So if the only component is the memory for the static bitmaps, it probably could be doubled.

    However, you will now need to transfer 4x the amount of data over the SPI bus. The 128x128 OLED display is rather slow. I find I can't run the bus more than 24Mhz for the Adafruit displays, and 48Mhz for the New Haven displays. If you have to keep the bus at 24Mhz, it might be too slow to present a moving image when you transfer 4x the data. On the other hand, I was able to run TFT displays at the fastest overclock speed. So, if you could find an OLED display that can accept data faster, it might work (or switch to TFT display).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •