Search results

  1. L

    SoftwareSpi_T4 library

    Hi all, some days ago I asked for a question: basically I had to implement an emulation of two sensors that behave as a SPI slave for testing purposes. Working with Arduino UNO was fine, but Arduino can behave as a single SPI slave, so two Arduinos for two sensors. Not the best. I switched to...
  2. L

    SPI slave on teensy 4.1

    Sure, I will create a repository on github and will put there a small library!
  3. L

    Disable interrupt for a given pin

    So basically, if I have three interrupts on three different pins, I can disable just one of them with detachInterrupt()? Cool! Is there any other difference between calling detachInterrupt or NVIC_DISABLE_IRQ? Maybe one is faster?
  4. L

    Disable interrupt for a given pin

    Hi all, let's say I'm attaching an interrupt to a pin attachInterrupt(digitalPinToInterrupt(pin), isr, FALLING); and I want, in certain conditions, to disable only this interrupt. Is there a way of doing this? Maybe by calling NVIC_DISABLE_IRQ(digitalPinToInterrupt(pin))? Edit: Looking at the...
  5. L

    SPI slave on teensy 4.1

    Hi all, I ended up bitbanging SPI. It works and solves me a lot of headaches. :) Thanks, Luca
  6. L

    SPI slave on teensy 4.1

    I naively though that since ATMEGA328P supports it, it is something easily supported by others. My clock is slow enough that an Arduino UNO can reply correctly (see picture below) to all master transactions using interrupts, not sure if I can bit bang it. Arduino replying:
  7. L

    SPI slave on teensy 4.1

    Is there any older teensy version that support this working mode? Do you know any of other micro that can do something like this? Thank you :) Luca
  8. L

    SPI slave on teensy 4.1

    Hi all, I've configured an SPI peripheral as a slave. I can read correctly the bytes that the master sends me, but I can't reply. RT1060 manual says it's possible to have a full duplex transfer in slave mode (see manual, p. 2855). Is it possible to make the slave reply in a "dynamic manner"...
  9. L

    SPI1 issues when used as slave on teensy4.1

    This is the solution! Not knowing where the error was, I didn't check those values. Now, I can use SPI1: This is the trick. switch (portnum) { case 0: iomuxc_base[0] = 0; // IOMUXC_LPSPI4_PCS0_SELECT_INPUT. For LSPCI4: (401F_851Ch) 0=GPIO_B0_00_ALT3 1=GPIO_B1_04_ALT1 iomuxc_base[1] =...
  10. L

    SPI1 issues when used as slave on teensy4.1

    Hi, can you please add some details? Thanks, Luca
  11. L

    SPI1 issues when used as slave on teensy4.1

    Hi all, I'm using a teensy 4.1 as an SPI slave to sniff SPI transactions. The same master writes to two different slaves in two different moments: I want to sniff the two transactions from the master. CS1 is connected to SPI CS (pin 10) and it works fine. CS2 is connected to SPI1 CS (LPSPI3...
  12. L

    Multi SPI slave on a single teensy

    Actually I need it for an HWIL simulation.
  13. L

    Multi SPI slave on a single teensy

    @joepasquariello you are right, I have both sensors on a single bus. I have tried with a single Arduino, but something doesn't work in my implementation: #define SCK_PIN 13 // D13 = pin19 = PortB.5 #define MISO_PIN 12 // D12 = pin18 = PortB.4 #define MOSI_PIN 11 // D11 = pin17 = PortB.3...
  14. L

    Multi SPI slave on a single teensy

    Hi, I need to test the interaction between a microcontroller that reads two sensors with SPI. The microcontroller behaves as a SPI master and the sensors are two slaves. Currently, in order to simulate the behaviour of the two sensors, I'm using two Arduinos, and it works fine. However, I'd...
Back
Top