PCA9685 Boards - ideal Wire settings for Teensy LC?

Status
Not open for further replies.

Pensive

Well-known member
Hi guys

My project is very complex, the only way to show you the wiring diagram would be to spend a few hours in fritzing, but I attach a photo below which probably won't help much.

However I hope my question should be fairly simple, rather than describe my problem and ask for a solution, I'd rather ensure I'm talking to the devices correctly first.

So the Question: what are the perfect settings for Wire with a prop shield and 2 * pca9685s, on a Teensy LC?

I've got 16 WS2812Bs running via FastLED on pin 17 @ 5v, an analog mux 16 channel bringing in the button inputs running 3.3v, (see pins) and 6 RGB rotary encoders (https://www.sparkfun.com/products/10982), which I'm currently running on the 3.3v output of the Teensy including the RGB leds with 440ohm resistors pulling the current down fairly low on each of the RGB pins.

I'm using 2 PCA9685 adafruit breakouts to control them : https://www.adafruit.com/product/815

I also have a prop shield on the same i2c pins.

If i just have everything connected, the LEDs power up fine, and the board runs perfectly. So the 9685 devices are doing nothing allowing a full load to be pulled. So I don't think it's total milliamp draw thats the issue. _think_.

If i connect via wire to the two PCA9685 devices and switch the led outputs off ( or do anything else for that matter), the entire device starts screwing up, barely working, everything goes wrong, working digital inputs stop registering, neopixels start misbehaving, almost as if some bad interrupt code is ruining everything. I'm not using any interrupts at all in any of my code, except the wire library of course uses them.

So i tried first modding the adafruit library to use the teensy specific wire library. No change.

I then tried setting the opmode to DMA, but it doesn't seem to have any effect.

So my question is this really - whats the ideal way of setting all this up in the wire library, should i reduce the i2c speed and run as DMA? any other advice?
fastLED tweaks?

I'm sorry it's such a complex project and my code is fairly sensitive at this point so I'm not sure i want to post it. I'm using "EVERY_N_MILLISECONDS" to run the polling functions in the loop, so I think tweaking the power draw issues and Wire settings is the firs thing to do.

I'll order one of these to drive the LEDs power tomorrow so that should eliminate power supply being the issue: https://www.adafruit.com/products/2745

I'm in USB_Midi mode so I don't get any serial output at the moment so I can't report debugging or CPU/mem as we go. I've tried linking in via arduino to use Pauls software serial solution (i use visual micro) but it doesn't seem to be working, not sure if its a port issue or what.

Any advice most useful!!!

Thanks

Jon

p1gutz.jpgpinouts.jpg
 
Last edited:
I'm in USB_Midi mode so I don't get any serial output at the moment so I can't report debugging or CPU/mem as we go. I've tried linking in via arduino to use Pauls software serial solution (i use visual micro) but it doesn't seem to be working, not sure if its a port issue or what.

Are you saying that Serial + midi does not provide you serial output you need, or does it not work? what is Pauls serial solution?
 
Most useful nevertheless! Thank you!!

I'll be able to get more info out of my project and use the visual micro debugging features now!

Awesome :)

Thanks ;)
 
You should write a debug sketch, you may very well have a hardware issue.

Start with a simple program to slowly blink the LEDs via the PCA9685 then add some function to control brightness or blink frequency via the encoder. Now add in something similar for the WS2812B, ...
 
You should write a debug sketch, you may very well have a hardware issue.

Start with a simple program to slowly blink the LEDs via the PCA9685 then add some function to control brightness or blink frequency via the encoder. Now add in something similar for the WS2812B, ...

Wilco. I've definitely got something wierd going on.

I reinstalled arduino & teensyduino to make use of the new Serial & Midi type, but none of my serial output is coming out.
If I download the serial example from Teensyduino and set that to Serial& Midi, it works.....in both Arduino IDE and VisualMicro.

It couldn't be any easier to get Serial right - so I think FastLED is messing some things up, despite running well.

I'll find time tomorrow to start from the bottom and work up, getting everything working one thing at a time.
 
Status
Not open for further replies.
Back
Top