Souliss D21G

Not so much a question - just thought this may save others time

  • What is missing is the pin information for SPI to Ethernet

Note: the full range of utilization with the ethernet module has not been tested with this code – nor all the functionality of Souliss. This will allow the code to compile. I will add further insight when/if there is more understood. Because two different w5500.h/.cpp are being used there is potential for inconsistencies.

From the Ethernet 2 library Ethernet2/src/utility/w5500.CPP

Copy the lines

// SPI details

SPISettings wiznet_SPI_settings(4000000, MSBFIRST, SPI_MODE0);

uint8_t SPI_CS;

into

souliss/frame/vnet/drivers/mcu_avr/ethW5x00/src/w5500.CPP

 

IN souliss/frame/vnet/drivers/mcu_avr/ethW5x00/src/w5500.H

REPLACE

private:

#if defined(REL_GR_KURUMI) || defined(REL_GR_KURUMI_PROTOTYPE)

  inline static void initSS()    { pinMode(SS, OUTPUT); \

                                   digitalWrite(SS, HIGH); };

  inline static void setSS()     { digitalWrite(SS, LOW); };

  inline static void resetSS()   { digitalWrite(SS, HIGH); };

#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)

  inline static void initSS()    { DDRB  |=  _BV(4); };

  inline static void setSS()     { PORTB &= ~_BV(4); };

  inline static void resetSS()   { PORTB |=  _BV(4); };

#elif defined(__AVR_ATmega32U4__)

  inline static void initSS()    { DDRB  |=  _BV(6); };

  inline static void setSS()     { PORTB &= ~_BV(6); };

  inline static void resetSS()   { PORTB |=  _BV(6); };

#elif defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB162__)

  inline static void initSS()    { DDRB  |=  _BV(0); };

  inline static void setSS()     { PORTB &= ~_BV(0); };

  inline static void resetSS()   { PORTB |=  _BV(0); };

#else

  inline static void initSS()    { DDRB  |=  _BV(2); };

  inline static void setSS()     { PORTB &= ~_BV(2); };

  inline static void resetSS()   { PORTB |=  _BV(2); };

#endif

 

};

 

With

private:

  // could do inline optimizations

  static inline void initSS()  { pinMode(SPI_CS, OUTPUT); }

  static inline void setSS()   {  digitalWrite(SPI_CS, LOW); }

  static inline void resetSS() {  digitalWrite(SPI_CS, HIGH); }

};

 

Additionally include the line

 

extern uint8_t SPI_CS;

 

after

 

#include <avr/pgmspace.h>

#include <SPI.h>

Sentry: Water Monitoring & Control Inc.
Sentry: Water Monitoring & Control Inc.
117
| 4 1 2
Asked on 9/28/17, 12:33 PM
0
vote
2076 Views

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This community is for professionals and enthusiasts of our products and services.

Read Guidelines

Question tools

38 follower(s)

Stats

Asked: 9/28/17, 12:33 PM
Seen: 2076 times
Last updated: 9/28/17, 12:33 PM