Interrupt on teensy 4.0 + Adafruits Neotrellis

However, I should read more, too.
I'm not that sure what "When it keeps printing it goes down to 0.80 and stays there until I press again and goes back up." means.

His code:
Code:
void loop() {
  if(!digitalRead(INT_PIN)){
    Serial.println("Hello");
  }
  delay(2);
}

That says the the INT-PIN works, too... so there is no problem ("The matrix works fine in every other respect") ?

So... WHAT does not work?

Morris?

I have a suspicion... can you increase the delay to 20?
 
...and better try this loop:

Code:
int myCount = 0;
void loop() {
  if(!digitalRead(INT_PIN)){
    Serial.println(myCount);
    myCount++;
  }
  delay(50);
}
 
OK, my guesses are (both 50% probability)

- 11ma are too much
, or: it's just a serial Monitor problem

Have read the Datasheet of the ATSAMD09: Max IO current for output LOW is 10mA. The 11mA are already over the limit, and possibly too much.
Adafruit uses the wrong resisitors.
That also fits to "If I load 16 boards (even thou they are all soldered together) interrupt works perfect." (Post #8) - the resistance is higher.

Or, maybe, it's both.. both together can really give weird effects.

Good night.
 
Last edited:
Just experimented with 330R, 220R, 180R and 150R as INT pullup to +3.3v and am not seeing any change in behavior. Might be pushing it a bit but seems to suggest ATSAM can pull INT with 32 x 10k pullups.

Could overshoot/ ground bounce on SCL and SDA be an issue?

The Neotrellis boards do not have a ground plane and with an 8x4 array, the actual wiring looks like a mess of loops and stubs if you think of wavelength wrt T4.x rise/fall times. Worth experimenting with series R in SCL/SDA at the T4 end? 47R? 100R?
 
Hi.


Here is the result of the wire Scanner


Code:
Scanning...
Device found at address 0x2E  (MCP44XX ePot)
Device found at address 0x2F  (MCP44XX ePot)
Device found at address 0x30  (Si7210)
Device found at address 0x31  (Si7210)
Device found at address 0x32  (Si7210)
Device found at address 0x33  (MAX11614,MAX11615,Si7210)
Device found at address 0x34  (MAX11612,MAX11613)
Device found at address 0x35  (MAX11616,MAX11617)
Device found at address 0x36  (unknown chip)
Device found at address 0x37  (unknown chip)
Device found at address 0x38  (RA8875,FT6206,MAX98390)
Device found at address 0x39  (TSL2561, APDS9960)
Device found at address 0x3A  (unknown chip)
Device found at address 0x3B  (unknown chip)
Device found at address 0x3C  (SSD1306,DigisparkOLED)
Device found at address 0x3D  (SSD1306)
Device found at address 0x3E  (unknown chip)
Device found at address 0x3F  (unknown chip)
Device found at address 0x40  (PCA9685,Si7021,MS8607)
Device found at address 0x41  (STMPE610,PCA9685)
Device found at address 0x42  (PCA9685)
Device found at address 0x43  (PCA9685)
Device found at address 0x44  (PCA9685, SHT3X, ADAU1966)
Device found at address 0x45  (PCA9685, SHT3X)
Device found at address 0x46  (PCA9685)
Device found at address 0x47  (PCA9685)
Device found at address 0x48  (ADS1115,PN532,TMP102,LM75,PCF8591,CS42448)
Device found at address 0x49  (ADS1115,TSL2561,PCF8591,CS42448)
Device found at address 0x4A  (ADS1115,Qwiic Keypad,CS42448)
Device found at address 0x4B  (ADS1115,TMP102,BNO080,Qwiic Keypad,CS42448)
Device found at address 0x4C  (unknown chip)
Device found at address 0x4D  (unknown chip)
done


Someone lended me the volt tester. I gave it back and didnt test an isolated board.

Is there any code to test the pins ?

Only one board (isolated or soldered with the other 31) works fine........ the issue appears when I activate more boards.



I soldered the interrupt pin to teensy with no difference...


I'm not that sure what "When it keeps printing it goes down to 0.80 and stays there until I press again and goes back up." means.

In the place of print ( Hello ) should be trellis.read() (I changed it to test the interrupt) . The interrupt tells the board to read the button press number ONCE. So when no button is pressed I can read the continuos serial data coming from PC's music sequencer.

When the issue appears ( it keeps printing "Hello", keeps reading the matrix ) the voltage stays at 0.80. When theres no issue the voltage bounces back up again and it just prints once (reads the boards for just one button pressed)

The behaviour is the same on Press down and let go.

I experimented with all kinds of delay, up to 1 second. The issue is still there



...and better try this loop:

Same behaviour. Sometimes goes number by number, and from time to time runs wild...


I dont think is a serial monitor problem. Voltage stuck at 0.80 when the issue appears...


With all the things I try (and my very limited knoledge) im pretty sure is not a code thing...


Last 2 post are beyond me.


Maybe dumb question. I have 1.5 mm wires supplying power to the boards. They run around close to the back surface of the boards.
Could the rubber isolation be bridged and cause the issue?


Anything else i could try before say good bye?
 
Last edited:
Well, I would still remove most of the pullups. It's definitely not good and is still against the specifications of the SAMD. Just to fix at least this issue.
Then, I'd ask ADAFRUIT.
 
Well, I would still remove most of the pullups. It's definitely not good and is still against the specifications of the SAMD. Just to fix at least this issue.
Then, I'd ask ADAFRUIT.


Was just about to ask that question.

I just try an isolated board with the pullups removed and the interrupt works fine.

I thik I already removed half the pullups from the 32 board grid.

How many you think I should remove?


Just in case I dive into that tricky (for me) unsoldering buisness again in vain... Those pullups have something to do with the interrupt?

Here is a schematic of the board maybe someone can tell.



https://cdn-learn.adafruit.com/asset...png?1537373850
 
Just activated the 24 boards with the pullups removed ( I thougth I removed half but did 3/4) .....still sad.
 
The Scanner results look good. Must admit, I was wrong on that idea.

Here's another long shot... can you connect your voltmeter to GND on the far sides or corners? Because it's just GND on both sides, your multimeter should read zero or only a few millivolts. Again, this is a long shot guess, but if you see something like 0.5 volts or higher between any 2 GND locations, that could be causing failure to communicate across the entire array.
 
I dont have the meter anymore.

Last question

I have positive and ground connected to 6 points each around the 4x8 boards matrix. Could it make any difference if I unsolder and leave only one of each?
 
Best is to buy a meter. You spent some hundret $$ for the Neotrellis... :)
You will need it again, anyway..

I doubt that removing connections will help much. As you say the Matrix works. And the I2C seems to work good, too.
If it does not work better with the removed resistors (did you remove the right ones?), I somehow have doubts that it is *still* a electical problem...
Are you sure you're initializing all boards to use INT?

Idea: Can you use PIN13? Try _all_ 32 boards.
The LED will reflect the state of INT (If you did not remove too many R's..)
Still a voltmeter is better.
 
Last edited:
HEY !!! DONT LEAVE YET!!


I have new consistent data.

I had try different delays with no consisten results. Now I think i found something. Activating only 1 board with a delay of 2 mm I have no issue. Try many times

Code:
void loop() {
  if(!digitalRead(INT_PIN)){
    trellis.read(false);
    Serial.println("re");
  }
  delay(2);
}

But with a delay of 25 the issue appears..


Code:
void loop() {
  if(!digitalRead(INT_PIN)){
    trellis.read(false);
    Serial.println("re");
  }
  delay(25);
}



Any thoery_?
 
HEY !!!

I think I m close

I activated the 32 boards with a delay of 2 (I had try only higher delays ) and, although the issue still appears, it does only occasionally.


So, maybe it is a code thing...

Any idea?
 
HEEEEEYYYYYY !!!!!

I try the 32 boards with a delay of 1 ms WITH NO ISSUE !!! (kind of ashame for making you think)


But Its not success yet.

The loop of the proyect will be longer than that because It will be contantly reading from serial.

I will try.

But could be useful to understand whats going on..


In the examples from Adafruit the delays are of 20 ms and it says...

Code:
void loop() {
  trellis.read();  // interrupt management does all the work! :)
  
  delay(20); [B]//the trellis has a resolution of around 60hz[/B]
}
 
add this to setup:
pinMode(13, OUTPUT);

and this to loop:
Code:
void loop() {
   [COLOR=#b22222][B]digitalWrite(13, digitalRead(INT_PIN));[/B][/COLOR]
  if(!digitalRead(INT_PIN)){
    trellis.read(false);
    Serial.println("re");
  }
  delay(2);
}
The LED should reflect the state of INT.
What happens?
 
Ok, forget my post. I wrote at the same time as you


Just use the bounce library and everything is fine.
Not because its bouncing - it makes the handling easier for you.
But i do not understand why the same code worked with 16 boards before.
 
Soldering the led pin now
I know......:rolleyes:


Try with the led code.

It is always on but when a press it goes off and back on.

And got no issue with 2ms delay..........I did have the issue before with 2 ms........

Seems like it is a timing thing..


To use the bounce library I should read the boards with a different code or only the interrupt pin?
 
No luck. With Serial receiving data the issue appears.

Question.

I have the overlock options......is there any risk?
 
If you mean Overclock options then the T4's CPU will need a heatsink.

You might post some code to give us an idea of what you want with serial.

Neotrellises can generate a fair amount of I2C traffic using the Wire library. Wire is said to be blocking so will prevent other code from running until Wire transactions are done with. So, I had all sorts of fun trying to decode and do something with incoming Midi and getting the Neotrellis to behave.

My setup has some ILI9341 screens and the ILI9341_t3 library would not work with Neotrellis without some serious hacking which would have been feasible but would not have solved the blocking Wire issue. Me not nerdy enough to fix that which is why one Teensy looks after Midi, screens, encoders whatever and listens for keypress messages via Serial (Midi) from another Teensy connected to the Neo array. No Midi is sent to the Trellis Teensy, not needed here.
 
More data.

Turns out the 4x8 big board its not the problem. I try an isolated board with and without the Pullups, with a delay of 25 ms in Loop and the issue appears.

I thought of using 2 MCU, but the serial incoming data changes the Neotrellis colours constantly. So, even though I could receive serial data with other MCU, I would still need to send it to Neotrellis, and two I2C connection to the same Neotrellis I guess would not work.


Is there a way to skip
Code:
 if (Serial.available() > 5)
until INT_PIN is back up and trellis.read(false); stops?




Code:
void loop() {


  if(!digitalRead(INT_PIN)){
        
    trellis.read(false);
   
     } 
  


if (Serial.available() > 5) {

                    
      v1 = Serial.read();
      v2 = Serial.read();
      v3 = Serial.read();
      v4 = Serial.read();    
      v5 = Serial.read(); 
      v6 = Serial.read();
      
     
      trellis.setPixelColor(v1 , v2, rgbColor(v3,v4,v5) ); 
  
  if (v6 == 1 ) {
     
     trellis.show();
        
    }
   }
   
     
 }
 
Maybe change this:

Code:
  if(!digitalRead(INT_PIN)) {

to this

Code:
  while (!digitalRead(INT_PIN)) {

Then Teensy will keep running trellis.read(false); until the INT pin is pulled back high by the resistors.
 
Maybe change this:

Code:
  if(!digitalRead(INT_PIN)) {

to this

Code:
  while (!digitalRead(INT_PIN)) {

Then Teensy will keep running trellis.read(false); until the INT pin is pulled back high by the resistors.


The behaviour is consistent.

It works but from time to time stops receiving from serial until I press again....

Isnt there any kind of resistance I can try on the interrupt wire? Maybe this doesnt make sense...
 
Back
Top