0

Trinket MO <-> Teensy 3.2 USB linkup?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Trinket MO <-> Teensy 3.2 USB linkup?

by jim_lee on Tue Jul 02, 2019 3:21 am

I have my project bubbling along nicely. (Watches moistures and waters plants per watering profile.) Problem is.. I need some sort of slick interface that a non programmer can use to set up the profiles. I have a button, pump & moisture sensor. This pretty much maxes me out for IO pins here. The button is this nice RGB illuminated one as well, but had to ditch the LED bit because.. No IO pins.

What to do?

My first idea was to write an interface in Processing and use that with a laptop for programming these.. I found Processing to be so simplified that it was completely unfathomable to me.

XCode for Mac? It tells me that my (Brand new) Mac needs to be updated before I can d-load the tool set. Then, of course, for some reason it wont let me update the machine either. Fine! I absolutely hate c# anyway.

Roll my own? After doing the cell phone, I have a complete framework to use. I think this wold be the easiest path for now if.. And herein likes the issue.

IF I can find a slick way for the two processors to communicate.

Is there a slick way to have two little processors communicate via the USB ports? Could it possibly be a "look just follow this tutorial" kind of thing? Or is this kinda' involved seeing they both think they areUSB peripherals?

Thoughts? Ideas? Links?

Many thanks in advance!

-jim lee

jim_lee
 
Posts: 546
Joined: Thu May 24, 2012 8:24 pm

Re: Trinket MO <-> Teensy 3.2 USB linkup?

by adafruit_support_mike on Fri Jul 05, 2019 2:56 am

You'd have some challenges with the connections.

A Teensy can run as a USB host, though I don't know the state of software support for that kind of use. Paul Stoffregen is an advocate of USB communication as well as a prolific uber-geek, so it's possible that the code is solid and mature. OTOH, it could be roll-your-own territory.

An alternative would be to offload some of the IO onto a Seesaw board:

https://www.adafruit.com/product/3657

It was specifically designed for pin-starved microcontrollers.

adafruit_support_mike
 
Posts: 58856
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket MO <-> Teensy 3.2 USB linkup?

by jim_lee on Sat Jul 06, 2019 2:52 am

Thanks, I was thinking the teensy could be a host. It has a passel of stuff it can do that I don't understand. :)

Another path is to loose the manual water on button (1 pin). Then, hardwire motor V2 to ground (1 pin) because I never run the pump backwards. Now I have 2 pins free and I can do the Serial link like I did on the cellphone. And I already have all the code I need to run that system. I can move the manual pump control to the programmer's touch screen.

On another note : The pump (https://www.adafruit.com/product/1150) doesn't have nearly enough power to run your standard drip irrigation spray nozzles. I was stumped for a bit on that. But I was able to design a 3D printed spray head that's adjustable and it works great!

-jim lee

jim_lee
 
Posts: 546
Joined: Thu May 24, 2012 8:24 pm

Re: Trinket MO <-> Teensy 3.2 USB linkup?

by dmag on Mon Jul 08, 2019 6:32 pm

USB is an extremely complex protocol, so I would not recommend using it to communicate between two MCUs.

You should think about using Serial (UART) instead, as this is much simpler. One side sends bytes, the other side gets bytes.

You could also look into something that has more pins (ItsyBitsy M0 Express) or adding more pins via an I2C expander.

dmag
 
Posts: 1
Joined: Mon Jul 08, 2019 6:25 pm

Please be positive and constructive with your questions and comments.