Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not for Teensy 3.6 #10

Open
regenesis-art opened this issue Jan 20, 2017 · 9 comments
Open

Not for Teensy 3.6 #10

regenesis-art opened this issue Jan 20, 2017 · 9 comments

Comments

@regenesis-art
Copy link

The code won't include itself because the Teensy 3.6 define MK66FX1M0 which is not among the cores the library works for. Additionally, simply adding that constant to the #ifs is not enough - the library is not reliable on the Teensy 3.6 either, probably due to the faster CPU.

@xxxajk
Copy link
Owner

xxxajk commented Jan 20, 2017

If you are using this for the UHS library, this is an already known fact, and you should be using UHS30.
If you are using this in some other project, let me know and I will fix it. Yes I have Teensy 3.6's here.

Either way, please let me know.

@jscatena88
Copy link

I would be interested in getting this working with the teensy 3.6. I am attempting to use this library to communicate with the invensense ICS-52000 microphone which uses an SPI like TDM protocol. It requires the ability to send a continuous clock signal while receiving data at 24 MHz

@xxxajk
Copy link
Owner

xxxajk commented Aug 14, 2017

I'll have to check if SPI can actually do 24MHZ.
It will depend on what clock SPI runs from, and if it is a 24MHz clock, that may or may not be a reliable solution. If there is a higher rate clock and SPI can use that rate, without altering any of the clocks, then it could be doable...

@xxxajk
Copy link
Owner

xxxajk commented Aug 14, 2017

Looks like it takes clocking from the BUS clock on Teensy 3.[0|1|2].
Also seems to be the case for the 3.[5|6] according to the datasheet.

@xxxajk
Copy link
Owner

xxxajk commented Aug 14, 2017

Looking into the datasheet, currently, the K66 seems to have a few minor differences.
For example, K66 can do a full 32bit frame size, K20 is limited to 16bit...
I'll play with this stuff tonight, and make this work as-is for Teensy 3.5 and 3.6.
Shouldn't be difficult to do, and probabbly only requires a few CPP
#if defined(whatever) stuff here #else other stuff here #endif

type stuff...

@xxxajk
Copy link
Owner

xxxajk commented Aug 14, 2017

Without messing about with F_BUS, this is what you get...
https://github.com/xxxajk/spi4teensy3/blob/master/spi4teensy3.cpp#L23

So it appears that 12MHz is the maximum, which is unfortunate, however understandable because of how it detects the clocks. The hardware pretty much requires a 1/2 clock to be reliable, and sample data at the mid-point of the clock.
I do not (at this point) see any way to select a different/faster clock source.
for 24MHz SPI, you would need to have a 48MHz clock for SPI, and some very well done signal routing.
Not sure if passing such a fast signal on pins would work out well.
The signal paths would need to be very short. Any propagation delays, signal reflections, and noise will be problematic as well.

@xxxajk
Copy link
Owner

xxxajk commented Aug 14, 2017

Now supports Teensy 3.5 and 3.6, please test and confirm.

@jscatena88
Copy link

I downloaded the new code and can confirm that it successfully compiles and runs on the Teensy 3.6. I have only so far compiled and hooked up an oscilloscope to the clock to make sure it was outputting as expected. I will most likely be able to test actual communication with our microphones later today

@xxxajk
Copy link
Owner

xxxajk commented Aug 14, 2017

Excellent news. I have already verified that it does work with the USB Host Shield (MAX3421E) so you should find similar results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants