Skip to content

T2 Bug: Using both streams and triggers can cause SPI corruption? #49

@johnnyman727

Description

@johnnyman727

I'm seeing an issue with the default ambient.js example which requests both sound and light data on an interval and requests trigger data when it's available. After a couple of successful reads of the trigger value (usually between 2-5), we get an invalid response:

Light level: 0.01464844   Sound Level: 0.00976563
Light level: 0.01855469   Sound Level: 0.01562500
Light level: 0.02343750   Sound Level: 0.01367188
Light level: 0.02832031   Sound Level: 0.01953125
Light level: 0.12402344   Sound Level: 0.01562500
Light level: 0.10058594   Sound Level: 0.01367188
Light level: 0.05566406   Sound Level: 0.01562500
Light level: 0.02343750   Sound Level: 0.01953125
Light level: 0.12011719   Sound Level: 0.00683594
Light level: 0.02246094   Sound Level: 0.01562500
Light level: 0.03515625   Sound Level: 0.00683594
Light level: 0.22656250   Sound Level: 0.01171875
Light level: 0.44824219   Sound Level: 0.01562500
Our light trigger was hit: 0.529296875
Light level: 0.38769531   Sound Level: 0.00976563
Light level: 0.12207031   Sound Level: 0.01367188
Light level: 0.37011719   Sound Level: 0.01367188
Our light trigger was hit: 0.5
Light level: 0.59472656   Sound Level: 0.01074219
Light level: 0.63769531   Sound Level: 0.01367188
Light level: 0.63964844   Sound Level: 0.01367188
Our light trigger was hit: 0.6376953125
Light level: 0.63769531   Sound Level: 0.01562500
Light level: 0.63769531   Sound Level: 0.01367188
Light level: 0.64062500   Sound Level: 0.01367188
Our light trigger was hit: 0.6396484375
/tmp/remote-script/examples/ambient.js:19
      if (err) throw err;

And if we take a look at the transactions with a logic analyzer, we see a strange corruption of the SPI bus just before that error:

screen shot 2015-11-24 at 11 55 23 am

Somehow the Tessel 1 is able to deal with it...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions