4 years, 2 months ago.

SPI

I have a 746 discovery board and I'm trying to use SPI. I can assign pins using the general SPI library provided by mbed but my clock appears to be bleeding into my MOSI and MISO pins. I'll take pictures of my oscilloscope and post them later but was hoping there was some configuration that I'm not utilizing correctly for this board or if I'm maybe just using the arduino based pins incorrectly.

include the mbed library with this snippet

#include "mbed.h"

DigitalOut out(D10);


DigitalOut led(LED1);

SPI device(D11, D12, D13);
//void spi_init  ( spi_t *  busExp,D11,D12,D13); //mosi, miso, sclk, ssel






int main()
{
    printf("start test \r\n");
int i = 0;
    while(1) {
        out = 1;
        device.format(8,0);
        out = 0;
        device.write(0x40);
        device.write(0x00);
//        device.write(0xE0);
        wait_us(25);
        printf("testing %d\r\n",i);
        wait_us(25);
    }




}

Question relating to:

The STM32F746G-DISCO discovery board (32F746GDISCOVERY) is a complete demonstration and development platform for STMicroelectronics ARM® Cortex®-M7 core-based STM32F746NGH6 microcontroller.

2 Answers

4 years, 2 months ago.

It should be overruled by the subsequent declaration of SPI on (D11, D12, D13), but notice that the DigitalOut on LED1 pin is actually the same physical portpin (PI_1) as the SPI2 SCK on D13.

Accepted Answer

Ah shoot. I didn't see that. Would anything happen though since I'm not switching the led? Either way I'll take it out.

posted by Patrick McNamara 05 Jul 2016

I'm using the mcp23s08 evaluation board and apparently the MISO pin on the board needs to be pulled low. I assigned SPI 5 to run SPI and saw the clock and data lines working correctly. It was the board I was attached to that was causing the issue..

posted by Patrick McNamara 06 Jul 2016
4 years, 2 months ago.

Hello,

Refer to this manual about SPI confirguration:

- RM0385 (section 32.9.10 SPI/I2S register map) http://www.st.com/content/ccc/resource/technical/document/reference_manual/c5/cf/ef/52/c0/f1/4b/fa/DM00124865.pdf/files/DM00124865.pdf/jcr:content/translations/en.DM00124865.pdf

-UM1907: http://www.st.com/content/ccc/resource/technical/document/user_manual/f0/14/c1/b9/95/6d/40/4d/DM00190424.pdf/files/DM00190424.pdf/jcr:content/translations/en.DM00190424.pdf

That should not be required for use with mbed. At the same time they are Digital pins, so I don't see how a clock can bleed into it.

posted by Erik - 04 Jul 2016