AnsweredAssumed Answered

KL25Z pinmap mis-match error

Question asked by Sagar Addepalli on Jun 23, 2017
Latest reply on Jul 11, 2017 by Hui_Ma

I am trying to use an SPI interface to talk to 8 slaves using a KL25Z. I figured that using the same MISO pin for all the eight boards was not working out, so I used different pins. Everything was working well when suddenly today the board decided to start misbehaving. This is the relevant part of my code(or so I believe) - 

 

#include "mbed.h"
#include <spi_functions.h>
#include <vector>
#include <string>

void doCommands(string command[3]);
using namespace std;

// DEFINE SERIAL INTERFACE AND PINS USED BY THE SPI PROTOCOL
Serial pc(USBTX, USBRX); // tx, rx
SPI dac_port1(PTD2, PTD3, PTD1); //mosi, miso, sclk
SPI dac_port2(PTD2, PTE3, PTD1);
SPI dac_port3(PTD2, PTC7, PTD1);
SPI dac_port4(PTD2, PTC6, PTD1);//was PTD6
SPI dac_port5(PTD2, PTA17, PTD1);
SPI dac_port6(PTD2, PTD7, PTD1);
SPI dac_port7(PTD2, PTE1, PTD1);
SPI dac_port8(PTD2, PTA16, PTD1);
DigitalOut sync1(PTD5, 1);// Board 1 slave select. Initialize to high
DigitalOut sync2(PTD0, 1); // Board 2 slave select. Initialize to high
DigitalOut sync3(PTC5, 1); // Board 3 slave select. Initialize to high
DigitalOut sync4(PTB11, 1);// Board 4 slave select. Initialize to high
DigitalOut sync5(PTB10, 1); // Board 5 slave select. Initialize to high
DigitalOut sync6(PTE2, 1);// Board 6 slave select. Initialize to high
DigitalOut sync7(PTD4, 1);// Board 7 slave select. Initialize to high
DigitalOut sync8(PTC4, 1); // Board 8 slave select. Initialize to high

 

 

Can someone help in this regard?

Outcomes