Uno, official Ethernet shield and RTC1306 using SPI not working togheter


hi ,
i'm experiencing similar situation similar 1 here: http://forum.arduino.cc/index.php?topic=172631.0 using arduino uno, official ethernet shield r3 , ds1306 rtc. put in different post since based on different hardware/configuration.
i wrote sketch read time rtc , send net (using mqtt protocol wouldn't have effect, anyway).

now:
   1) network part works i'm unable read/write rtc registries;
   2) rtc part works expected if use uno without ethernet shield, keeping same pin connections;


my understanding on uno mosi, miso ans sck respectively on pin 11, 12, 13. pin 10 used ss (or ce, chip enable,  called) ethernet shield.
my circuit (connected ethernet shield pins) same one: http://www.vwlowen.co.uk/arduino/ds1306/ds1306.htm 1 exception: rtc ce connected on pin ao, since 10 used control ethernet shield.

now:
   1) network part works i'm unable read/write rtc registries;
   2) rtc part works expected if use uno without ethernet shield, keeping same pin connections;

after further experiments seems me that:
1) starting spi interface explicitly in sketch if working rtc alone enables rtc somehow prevents ethernet shield job;
2) not starting spi explicitly allows ethernet shield tho operate rtc seems unavailable: no read or write operations can done.

the code used set spi following, put in setup():
code: [select]

  spi.begin();
  spi.setbitorder(msbfirst);
  spi.setdatamode(spi_mode1); 


i'm not posting whole sketch since bit messy, have clean bit..

does have clue on happening?
there issue spi? found (old) post people says ethernet chip doesn't handle spi properly, still true?

thank you

this problem.
code: [select]
spi.setdatamode(spi_mode1); 
you need switch data mode when using rtc , ethernet shield together. devices on ethernet shield both spi_mode0. use this:
code: [select]
// change mode 1 rtc
spi.setdatamode(spi_mode1); 

// rtc spi stuff

// change mode 0 w5100 , sd
spi.setdatamode(spi_mode0); 



Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > Uno, official Ethernet shield and RTC1306 using SPI not working togheter


arduino

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62