MickPF
Member
Hello,
I try to use these SPI's and can't get them running.
I use Arduino 1.8.4 (and 1.8.5) with Teensyduino.
I've connected digital signals
0 to MOSI
1 to MISO
31 to CS
32 to SCK
and used the
I've also replaced SPI1 with SPI2, but nothing improved the result: Digital pins 0, 1 and 32 are dead (inspected with a multichannel oscilloscope).
Signals on pins 31 (CS), 24 (EN), 25 (IRQ), 26 (RST) and 27 (WAKE) are OK and work.
The WiFi module works with SPI on pins 15 (CS), 11 (MOSI), 12 (MISO) and 13 (SCK).
Do I something wrong?
Please help me...
Thanks in advance,
Michael
I try to use these SPI's and can't get them running.
I use Arduino 1.8.4 (and 1.8.5) with Teensyduino.
I've connected digital signals
0 to MOSI
1 to MISO
31 to CS
32 to SCK
and used the
Code:
<...>
#define WINC1501_SPI SPI1
#include <WiFi101.h>
#include <WiFiUdp.h>
#include <NTPClient.h>
<...>
/*
* Following definitions work with 'SPI'
* but are reserved for an other SPI device (TFT display)
*/
//#define WIFI_MOSI_PIN 11
//#define WIFI_MISO_PIN 12
//#define WIFI_SCLK_PIN 13
//#define WIFI_CS_PIN 15
/*
* Following definition DO NOT work either with 'SPI1' nor with 'SPI2'
*/
#define WIFI_MOSI_PIN 0
#define WIFI_MISO_PIN 1
#define WIFI_SCLK_PIN 32
#define WIFI_CS_PIN 31
/*
* Following definitions work with 'SPI' and should work with other SPI buses
*/
#define WIFI_EN_PIN 24
#define WIFI_IRQ_PIN 25
#define WIFI_RST_PIN 26
#define WIFI_WAKE_PIN 27
<...>
void setup()
{
<...>
/*
* Setup SPI-0 bus for the TFT display with touchscreen
* Status: OK (working)
*/
pinMode(TFT_CS_PIN, OUTPUT);
pinMode(TFT_DC_PIN, OUTPUT);
pinMode(TFT_RST_PIN, OUTPUT);
brightness = 255;
pinMode(TFT_BL_PIN, OUTPUT);
analogWrite(TFT_BL_PIN, brightness);
SPI.setMOSI(TFT_MOSI_PIN);
SPI.setMISO(TFT_MISO_PIN);
SPI.setSCK(TFT_SCLK_PIN);
SPI.begin();
/*
* Setup SPI-1 bus for the WiFi module
* Status: FAILED
*/
pinMode(WIFI_MOSI_PIN, OUTPUT);
pinMode(WIFI_MISO_PIN, INPUT);
pinMode(WIFI_SCLK_PIN, OUTPUT);
pinMode(WIFI_CS_PIN, OUTPUT);
pinMode(WIFI_EN_PIN, OUTPUT);
pinMode(WIFI_IRQ_PIN, INPUT);
pinMode(WIFI_RST_PIN, OUTPUT);
pinMode(WIFI_WAKE_PIN, OUTPUT);
SPI1.setMOSI(WIFI_MOSI_PIN);
SPI1.setMISO(WIFI_MISO_PIN);
SPI1.setSCK(WIFI_SCLK_PIN);
SPI1.begin();
WiFi.setPins(WIFI_CS_PIN, WIFI_IRQ_PIN, WIFI_RST_PIN, WIFI_EN_PIN);
<...>
}
I've also replaced SPI1 with SPI2, but nothing improved the result: Digital pins 0, 1 and 32 are dead (inspected with a multichannel oscilloscope).
Signals on pins 31 (CS), 24 (EN), 25 (IRQ), 26 (RST) and 27 (WAKE) are OK and work.
The WiFi module works with SPI on pins 15 (CS), 11 (MOSI), 12 (MISO) and 13 (SCK).
Do I something wrong?
Please help me...
Thanks in advance,
Michael