This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to get input level of MISO

Other Parts Discussed in Thread: CC1200, AM3359

Hello,

I got an AM3359 on a beaglebone black (Master) and try to talk to a CC1200 (Slave) via SPI. To start a conversation I set the chip select manual to active (low) and if the CC1200 is ready for conversation it also set the MISO to low (this process I can see on my oscilloscope). To check this I have to read the input level of MISO Pin but I cannot find a way to do this.

I already tried to mux the pin to a GPIO and get the value of DATAIN register but that stop the connection to CC1200.

I look for something like: while( HWREG("Register on am3359") & MISO_INPUT_BIT ); to wait till MISO goes low.

thanks for replies

Robert

Edit: I try to use the SPIDAT_0 Bit in MCSPI_SYST register but this works only if I set the SYSTEM_TEST Bit in MCSPI_MODULCTRL. While doing this the Transmission stops.

Is it possible to check the MISO state with MCSPI_SYST Value or have I done something wrong?

  • Did you find a solution?

    In our design, we simply electrically linked the MISO pin to another spare GPIO on the AM335x so that we could read it directly without changing MUX settings or anything special.

  • Hi Robert .

    " I try to use the SPIDAT_0 Bit in MCSPI_SYST register but this works only if I set the SYSTEM_TEST Bit in MCSPI_MODULCTRL. While doing this the Transmission stops."

    Which pin have you configured as MISO ? If SPIDAT_0 is configured as MISO (as input) then SPIDAT_0 bit should reflect the line state.

  • Hello Vineeth,

    I tried it this way:

        HWREG(SOC_SPI_1_REGS + 0x0124) |= 0x0100; // set MISO to Input
        HWREG(SOC_SPI_1_REGS + 0x0128) |= 0x08; // activate system test mode

    If i do this there is no clk. I can see that mcspi write in TX0 but no transmission. If I just set MISO to Input without system test mode, the mcspi works normally but there is activity in SPIDAT_0 Bit of MCSPI_SYST register.

    My actual configuration:

        /* Clock and pinmuxing */

        McSPI1ModuleClkConfig();
        McSPI1PinMuxSetup();  // for general -> GpioPinMuxSetup in gpio.h, GPIO declarations in pin_mux.h
        McSPI1CSPinMuxSetup();

        /* McSPI configuration */

        McSPIReset(SOC_SPI_1_REGS);
        McSPICSPolarityConfig(SOC_SPI_1_REGS, MCSPI_CS_POL_LOW, 0);
        McSPICSEnable(SOC_SPI_1_REGS);
        McSPIMasterModeEnable(SOC_SPI_1_REGS);
        McSPIMasterModeConfig(SOC_SPI_1_REGS,MCSPI_SINGLE_CH, MCSPI_TX_RX_MODE,   MCSPI_DATA_LINE_COMM_MODE_1, 0);
        McSPIClkConfig(SOC_SPI_1_REGS, 48000000, 1500000, 0, MCSPI_CLK_MODE_0);
        McSPIWordLengthSet(SOC_SPI_1_REGS, MCSPI_WORD_LENGTH(8), 0);
        HWREG(SOC_SPI_1_REGS + 0x012C) |= 0x03000000; // TCS in MCSPI_CH0CONF

    How I have to configure the McSPI1 register to see something in MCSPI_SYST without going in system test mode?

    @John: this is my last resort, but I thought there is a software solution provided to do this.