Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 2 1 2 LastLast
Results 1 to 25 of 30

Thread: Teensy 3.2 with Featherwing DC motor board

  1. #1

    Teensy 3.2 with Featherwing DC motor board

    Has anyone managed to get the Featherwing DC motor board to work with the Teensy 3.2?
    https://www.adafruit.com/products/2927

    I have tried following the instructions here: https://forum.pjrc.com/threads/27413...3-1-and-i2c_t3

    And here: http://arduino-pi.blogspot.co.nz/201...rol-board.html

    I have tried this set up:
    Teensy -> Featherwing
    3.3v - > BAT (no idea if this is the right way to supply logic power?)
    GND -> GND
    SCL0 (19/A5) -> SCL
    SDA0 (18/A4) -> SDA

    Motor connected and has it's own power supply via featherwing terminal. Made sure voltage is within acceptable range for motor driver and motor.

    I have also tried a variety of pull up resistors (2.2k, 2.7k, 4.7k) with i2c. Tried both the Wire library and i2c_t3.

    For the code I am using the library and code found here: https://learn.adafruit.com/adafruit-...stall-software

    I realize that it may be more appropriate to ask at the Adafruit forum but the motor driver is designed to work with in the featherwing 'eco system' and I would rather use the Teensy.

    Has anyone had any experience with this?

    Happy to provide more details if required...
    Last edited by KBR; 02-29-2016 at 10:34 AM.

  2. #2
    Senior Member
    Join Date
    Nov 2015
    Location
    Wales
    Posts
    579
    Try the example i2c_t3 -> Scanner and post the results

    Can you elaborate on not working?
    Maybe any code you have tried would be good

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,294
    Which library and code are you actually running to talk to this board? See the "Forum Rule", you must always be specific about this in any question where something isn't working!

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,294
    According to this schematic, Adafruit already put 10K pullup resistors on SDA and SCL, so you do *not* need to add resistors. Just connect wires.

    You probably will need to post a photo of how it's all really connected.

  5. #5
    Thanks Xenoamor. Good idea.

    I tried the Scanner example but it doesn’t seem to find anything.

    The serial monitor outputs this for about a dozen times while turning LED on then off:

    ---------------------------------------------------
    Starting scan...
    ---------------------------------------------------

    The serial output will eventually stop and the LED stays on.

    I will collect code and photos for a better reference. As well as a better description of "not working". Back soon...

  6. #6
    Apologies, I thought I had covered that by providing a link to the library and code example. In future I will provide the information directly within the post.

    The library I used is the Adafruit Motor Shield V2 Library. Then I used the example code that came with the library called DCMotorTest.
    I could not get the motor to turn on so I then tried altering the library to use i2c_t3 instead of wire. When altering the library I followed the example here:
    http://arduino-pi.blogspot.co.nz/201...rol-board.html

    I will gather final code used and a photo for more info.

  7. #7
    Thanks Paul, good to know about that! Just out of interest, where did you find the schematic? Somewhere obvious no doubt

    Originally I just connected the wires as suggested but then tried pullups out of desperation when I wasn't having any success. Is it possible to damage the board doing this? I hope I haven't fired anything.

    Also I was wondering if you knew which pin was the correct pin for supplying logic voltage?

    Photo is on it's way...

    I must say I am impressed with the fast response on this forum (first post). I posted just before giving in to some sleep (1:30am New Zealand time) thinking I'd be lucky to have one response in the morning. Would have stayed up if I known you'd be so quick. Thanks!

  8. #8
    Senior Member
    Join Date
    Nov 2015
    Location
    Wales
    Posts
    579
    If the scanner can't find it it is likely to be a hardware issue, not a software issue

    Although I do have a few issues with that scanner example on occasion
    Can you change the following lines
    Code:
    pinMode(12,INPUT_PULLUP);       // Control for Test1
    pinMode(11,INPUT_PULLUP);       // Control for Test2
    To:
    Code:
    pinMode(12,INPUT);       // Control for Test1
    pinMode(11,INPUT);       // Control for Test2

  9. #9
    This automatically initiates the scan. Is this the intended result?

    When I first tried it the LED went solid on and the output was:

    ---------------------------------------------------
    Starting scan...

    And stayed that way. However when I tried it again after a few attempts it began flicking on/off as before. At first I thought this was because I tried disconnecting the logic power to the motor driver. But it seems to be intermittent. I am having difficulty reproducing the problem consistently. Either way it still does not find the device.

    I believe you are right about the hardware. My biggest assumption is that I don't have logic power hooked up right. Which is why I tried disconnecting it. I'm not even certain it needs a separate power supply for the logic!

  10. #10
    I also forgot to mention (an important clue) that there is no serial output using the DCMotorTest code even thought there is a Serial.print in the loop. However if I use pullups on the SDA and SCL then the serial output works. But still does not trigger motor driver. It's the other reason I tried a variety of resistors.

  11. #11

    Photos

    As suggested here are the photos of the hardware setup:

    Click image for larger version. 

Name:	Featherwing_DCM_02.jpg 
Views:	105 
Size:	113.1 KB 
ID:	6494Click image for larger version. 

Name:	Hardware_Hookup_02.jpg 
Views:	109 
Size:	124.7 KB 
ID:	6495

    Extra wires coming from the encoder on the motor are not used at this time.

  12. #12

    Code

    Here is the code I used. I first tried the default library (Adafruit Motor Shield V2 library) and example (DCMotorTest) but after no success I changed it to this:

    Adafruit_MotorShield.cpp
    Adafruit_MotorShield.h
    Adafruit_MS_PWMServoDriver.cpp
    Adafruit_MS_PWMServoDriver.h

    Teensy_FW_DCMotor_Test.ino

    I have only included the files changed. I could zip up everything including complete library if that helps?
    Last edited by KBR; 03-01-2016 at 12:31 AM.

  13. #13
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,294
    I sent a request to Adafruit for the schematic for this product. The only ones I've been able to find are for their non-feather versions.

    Sorry, I'm stuck for the moment. Hopefully they'll answer soon...

  14. #14
    Great! Thanks Paul. Looking forward to seeing the schematic. Should shine some light on it.

    Of course stacking it on top of one of their Featherwing boards would be an easy fix, but then I wouldn't be able to use the awesomeness of the Teensy!!!

  15. #15
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,294
    I got a reply from Rick (at Adafruit). He's looking for the schematic.

    He did ask "connections look right to me, but I wonder if those jumpers are actually soldered in?"

  16. #16
    Haha yes they are. But you never know so fair question!

    Just to be sure I have checked connections with a multimeter.

    Hmm got me a bit worried now. I was hoping I had that wrong so it would be obvious fix

    Click image for larger version. 

Name:	Featherwing_Solder_Joints_01.jpg 
Views:	103 
Size:	104.6 KB 
ID:	6524
    Last edited by KBR; 03-01-2016 at 08:29 PM.

  17. #17
    Senior Member
    Join Date
    Nov 2012
    Posts
    275
    Maybe the Bat pin isn't connected on the Featherwing DC motor board. Try the 3.3V pin.


    Is 0x61 the correct I2C address? With all jumpers open, the address is 0x60.

  18. #18
    Thanks HWGuy I'll try the 3.3v pin.

    Not sure about the I2C address. I only have a limited understanding of I2C. Seems like a good opportunity to learn more about it. I'll scrub up on it some more. See if I can change it...
    Last edited by KBR; 03-01-2016 at 10:30 PM.

  19. #19
    Senior Member
    Join Date
    Nov 2012
    Posts
    275
    The I2C address is correct in your code. I somehow didn't see that the code with the 0x61 is marked as comment. Sorry about that.

  20. #20
    No problem. Any ideas are welcome. I still learnt something and that's always a good thing!

  21. #21
    Is there someway I can trouble shoot with multimeter or oscilloscope?

    If I hooked up an oscilloscope to the SDA or SCLK what should I expect to see? As I mentioned before the program won't even run. The only time it has is when I tried pullups but it still didn't activate the motor.

  22. #22
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,294
    Adafruit posted the schematic today. I haven't had an opportunity to review it yet, but hope to look at it later tonight or tomorrow morning.

    https://github.com/adafruit/Adafruit...eatherWing-PCB

  23. #23
    Good stuff! Thanks for that - appreciate your help. I'll have a looksee.

  24. #24
    Senior Member
    Join Date
    Nov 2012
    Posts
    275
    The Bat pin is not connected in the schematic.

    schematic as pdf: download

  25. #25
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,294
    Yeah, you're right. Looks like that poor little motor driver chip is just sitting there not getting VCC power.

    Maybe connecting Teensy's 3.3V output to the 3.3V pin will magically make everything work?

Posting Permissions

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