EtherMega - Question about SD / ETHERNET port

The EtherTen combines an Uno-equivalent Arduino-compatible board and Wiznet-based Ethernet support, along with a microSD card slot and Power-over-Ethernet support. [Product page]
shooter
Posts: 1
Joined: Sat Dec 03, 2011 3:44 pm

EtherMega - Question about SD / ETHERNET port

Post by shooter » Sat Dec 03, 2011 3:48 pm

Hi

I recently purchased a ethermega board. Im a new person to this whole things, and im having HUGE troubles trying to figure out how to get the ethernet port AND the SD card to work.

It seems if i want to use one i have to disable the other?

Im just using the examples a the moment to play around, but all I have found is

To use ethernet you need to put the following file befroe your start the ethernet
pinMode(4,OUTPUT);
digitalWrite(4,HIGH);



To use the SD card you need to do the fllowing
pinMode(10, OUTPUT); // set the SS pin as an output (necessary!)
digitalWrite(10, HIGH); // but turn off the W5100 chip!


But the problem is when switching between them I end up getting mixed results, code that worked once now doesnt...

Can you point me in the right direction on this topic? Seems to be a specific one as most other boards have it as sheilds not built in.

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 297
Joined: Sat Oct 15, 2011 11:31 am

Re: EtherMega - Question about SD / ETHERNET port

Post by jonoxer » Sun Dec 04, 2011 11:23 pm

You should be able to use both at the same time, although when I say "at the same time" I mean your sketch should be able to access both the SD card and the network sequentially, not literally simultaneously. Because the SD card and the Wiznet Ethernet chip both interface via SPI, your sketch needs to alternate between talking to one and talking to the other.

Our QA test process for the EtherTen includes loading a test sketch that brings up the network, access an SD card, and displays a file list from the card when its accessed using a web browser. The test is based on the code in Limor's tutorial here:

http://www.ladyada.net/learn/arduino/ethfiles.html

Perhaps that would be a good place to start?
--
Jon

bfisher
Posts: 7
Joined: Thu Jul 26, 2012 6:19 am

Re: EtherMega - Question about SD / ETHERNET port

Post by bfisher » Sun Jul 29, 2012 11:51 pm

I'm also having issues with utilizing the SD and ETH with each other. I have loaded in LadyAda's SD webserver and successfully been able to look at all files on the SD card through my web browser. I would assume that if that worked and setup() in MY code is almost the same, then it should work as well.

I am also running:
-Cosm Client (uploads once a day)
-Read/Write on the SD card all the time.
-Ethernet NTP client

If my sketch size is 31, 600 bytes (out of 32, 256 bytes) then could I be running into buffer problems that would affect this? In the Serial Monitor my code never gets out of the setup() section. It hangs up and sometimes sends gibberish into the monitor window. I've tried so many different things from deleting all serial prints and saving code space, to deleting modules like Cosm and NTP to no avail.

bfisher
Posts: 7
Joined: Thu Jul 26, 2012 6:19 am

Re: EtherMega - Question about SD / ETHERNET port

Post by bfisher » Mon Jul 30, 2012 4:02 am

This is my code that works for some reason.

Code: Select all

void setup() {
  Serial.begin(9600);

  PgmPrint("Free RAM: ");
  Serial.println(FreeRam());  
  
  Serial.print("Initializing SD card...");
  pinMode(10, OUTPUT);                       // set the SS pin as an output (necessary!)
  digitalWrite(10, HIGH);                    // but turn off the W5100 chip!

  if (!SD.begin(4)) {
    Serial.println("initialization failed!");
    return;
  }
  Serial.println("initialization done.");
  delay(1000);
  
  // Debugging complete, we start the server!
  Ethernet.begin(mac, ip);
  server.begin();
  
}
And then say, for example, I remove one of the Serial.println, the code doesn't continue on and serial monitor gives me weird results. It's the strangest thing.

effgee
Posts: 64
Joined: Tue Aug 07, 2012 2:41 am

Re: EtherMega - Question about SD / ETHERNET port

Post by effgee » Thu Aug 16, 2012 5:48 am

bfisher wrote:If my sketch size is 31, 600 bytes (out of 32, 256 bytes)
But doesn't ethermega have 256k of flash ?
Are you sure you're configured for the correct board ?

bfisher
Posts: 7
Joined: Thu Jul 26, 2012 6:19 am

Re: EtherMega - Question about SD / ETHERNET port

Post by bfisher » Thu Aug 16, 2012 5:54 am

Ah, I guess I didn't even realize that I was posting on an EtherMega thread in the EtherTen forum! I have an Etherten.

effgee
Posts: 64
Joined: Tue Aug 07, 2012 2:41 am

Re: EtherMega - Question about SD / ETHERNET port

Post by effgee » Tue Aug 21, 2012 6:20 am

I've found a 'trap for young players' with Arduino is tha the C++ objects can quickly chew up all your sram, causing random runtime glitches & reboots.

Try adding this function to your code to see how much ram you have left (can't remember where I got this from, credit to whoever wrote it).

Code: Select all

int freeRam () {
  extern int __heap_start, *__brkval; 
  int v; 
  return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); 
}
then add a few of these:

Code: Select all

Serial.println(freeRam); //
to see how you're tracking.

timr49
Posts: 2
Joined: Sat Apr 07, 2012 9:22 am

Re: EtherMega - Question about SD / ETHERNET port

Post by timr49 » Wed Feb 06, 2013 3:49 am

jonoxer wrote:...Our QA test process for the EtherTen includes loading a test sketch that brings up the network, access an SD card, and displays a file list from the card when its accessed using a web browser. The test is based on the code in Limor's tutorial here:

http://www.ladyada.net/learn/arduino/ethfiles.html

Perhaps that would be a good place to start?
--
Jon
Jon, I am using an EtherMega and getting inconsistent results reading from the SD card (before attempting to use the Ethernet). For example listfiles from examples was working (after amending pin numbers per the ladyada tutorial) and but then later it wasn't. Could you please provide your QA test for the SD card on an EtherMega? That will enable me to confirm that I have a solid base before going forward again? Of course I may have scrambled the SD card contents or the hardware or the software or something else to cause it to go from working to not working, in which case knowing whether your basic test works or not would be a useful data point.
Thanks,
-Tim.

clibin009
Posts: 563
Joined: Mon Oct 23, 2017 2:57 am

chenjinyan

Post by clibin009 » Fri Jan 12, 2018 2:44 am

mbt shoes
louboutin
ray ban wayfarer
canada goose outlet
ugg outlet
michael kors uk
moncler schweiz
nfl jerseys wholesale
ugg boots on sale
air max
polo shirts
coach outlet online
vibram five fingers
longchamp outlet
adidas football boots
ugg boots
coach outlet
michael kors outlet
swarovski
cheap nfl jerseys
michael kors handbags
nike outlet store
mont blanc
scarpe mbt
the north face
adidas wings
ugg outlet
michael kors outlet
uggs outlet
scarpe hogan
ugg boots
ugg boots
adidas jeremy scott
cheap mlb jerseys
nike sb
nhl jerseys
cheap ray bans
michael kors outlet clearance
cheap nhl jerseys
michael kors
tory burch
pandora rings
canada goose jackets
michael kors handbags
moncler
ugg clearance
giuseppe zanotti shoes
coach outlet online
cheap nfl jerseys
cheap rolex watches
kate spade
michael kors outlet
coach handbags
ugg boots
tory burch
jordans
louboutin
nike air force
jordans
michael kors handbags
nike air
balance shoes
salvatore ferragamo
air max
nike outlet
oakley sunglasses
north face
coach factory outlet online
fitflops
birkenstock
nike football boots
timberland outlet
ralph lauren
ugg australia
michael kors
ugg
nike tn
birkenstock outlet
coach outlet online
pandora charms
nike blazer
ralph lauren outlet
ray ban sunglasses
pandora jewelry
ralph lauren uk
coach factory outlet online
coach outlet online
pandora jewelry
fitflops outlet
ray ban sunglasses
the north face
jordan retro
coach outlet online
timberland boots
hermes
polo ralph lauren
moncler
ugg outlet
coach outlet online
nike free run
nike uk
stan smith shoes
ugg boots sale
pandora jewelry canada
birkenstock sandals
north face uk
burberry scarf
canada goose jackets
longchamp
pandora jewelry
louboutin
coach factory online
ralph lauren
canada goose
air max
polo ralph lauren outlet
michael kors outlet
true religion jeans
oakley sunglasses wholesale
ralph lauren
michael kors outlet online
ugg outlet
burberry outlet
uggs
adidas yeezy
tory burch outlet
ray ban
air jordan 14
supreme outlet
kate spade handbags
ugg boots
nike outlet
north face jackets
ray ban
ray ban
ralph lauren uk
michael kors outlet
longchamp
louboutin
supreme uk
mont blanc pens
true religion jeans
prada
beats by dre
cheap jordans
nike factory outlet
jordan
ugg canada
ugg boots
nike huarache shoes
moncler outlet
coach outlet online
north face outlet
burberry scarf
tommy hilfiger
jordans
ray ban
ugg outlet store
coach factory outlet
nba jerseys
north face
oakley sunglasses
michael kors outlet
nike store uk
oakley sunglasses
louboutin
true religion jeans
flops
cheap mlb jerseys
the north face
under armour outlet
canada goose outlet
michael kors taschen
canada goose outlet
nike air max
pandora charms
tory burch outlet
true religion jeans
coach outlet
christian louboutin
ray ban
ray ban
ugg
jordan shoes
nike air max
ugg outlet
ferragamo outlet
ugg pas cher
moncler pas cher
polo ralph lauren
air jordan
michaelkors outlet online
moncler
coach
basketball shoes
uggs
juicy couture outlet
canada goose jackets
canada goose jackets
pandora uk
mac cosmetics
kate spade
moncler
air jordan
jordans
snapbacks wholesale
hermes outlet
ray ban sunglasses
ralph lauren
canada goose sale
michael kors outlet
cheap ugg boots
cheap ugg boots
polo ralph
manolo blahnik shoes
polo ralph
canada goose jackets
coach handbags
adidas outlet store
moncler outlet
flops
north face outlet
ugg italia
ralph lauren uk
mlb jerseys
coach outlet
ugg boots
north face jackets clearance
ugg outlet
burberry outlet canada
uggs
flip flops
doudoune canada goose
ugg boots
uggs outlet
ugg
coach outlet online
polo ralph lauren
oakley sunglasses
ray ban sunglasses
adidas stan smith shoes
swarovski crystal
uggs outlet
air jordan
flip flops
north face jackets
michael kors outlet
jordan shoes
uggs outlet
nike air max
polo ralph
timberland pro
jordan
north face
uggs outlet
replica watches
ugg boots
longchamp outlet
jordan shoes
canada goose
hermes birkin bags
north face uk
polo ralph lauren
adidas superstar
canada goose
red bottom shoes
jordan shoes
pandora
mcm bags
nike factory outlet
adidas uk
ray ban sunglasses wholesale
ugg
canada goose outlet
adidas shoes
prada handbags
coach factory outlet
supra shoes
burberry outlet online
louboutin
moncler
baseball jerseys
michael kors outlet
kate spade
north face
air max
supreme
uggs outlet
oakley sunglasses
coach factory outlet
adidas outlet
cheap oakley sunglasses
oakley canada
michael kors handbags
ugg boots
mulberry handbags
north face
canada goose jackets
ugg boots
true religion
coach outlet
canada goose
ugg boots
michael kors outlet
north face outlet
coach factory outlet
louboutin
uggs outlet
christian louboutin
timberland boots
ugg
oakley sunglasses
ferragamo shoes
ugg boots
louboutin
prada
kate spade
moncler outlet
hermes uk
canada goose canada
the north face
nike outlet
timberland boots
north face
ugg canada
oakley vault
doudoune canada goose
ugg outlet
coach outlet
oakley sunglasses
cheap nfl jerseys
nfl jerseys wholesale
canada goose sale
moncler jackets
prada bags
moncler
jordan shoes
true religion jeans
moncler
soccer jerseys
canada goose jackets
blackhawks jersey
ray ban sunglasses
longchamp handbags
moncler
coach
moncler jackets
nike air huarache
ralph lauren
pandora jewelry canada
longchamp
mont blanc pens
superdry clothing
converse shoes
louboutin
jordan pas cher
ugg boots
kate spade outlet
canada goose
ugg boots
ralph lauren
cheap nfl jerseys
adidas shoes
20181.12chenjinyan

yaoxuemei
Posts: 243
Joined: Fri Dec 15, 2017 7:34 am

Re: EtherMega - Question about SD / ETHERNET port

Post by yaoxuemei » Thu Feb 01, 2018 2:10 am

yaoxuemei20180201coach outlet
nike shoes for men
oakley sunglasses
polo ralph lauren
michael kors outlet
michael kors outlet clearance
pandora jewelry outlet
pandora jewelry
canada goose jackets canada
canada goose outlet store
jordan retro
yeezy boost 350 v2
coach outlet online
uggs outlet
ray-ban sunglasses
longchamp bags
true religion outlet
canada goose jackets
christian louboutin outlet
michael kors outlet store
polo ralph lauren
oakley sunglasses
christian louboutin sale
cheap jordan shoes
michael kors outlet
polo ralph lauren
christian louboutin
adidas yeezy shoes
cheap jordans for sale
nike outlet
mulberry bags
cheap ray bans sunglasses
cheap ugg boots
uggs outlet
giuseppe zanotti sneakers
tory burch outlet
pandora charms
ugg outlet online clearance
uggs outlet
michael kors outlet
michael kors outlet
michael kors outlet
mont blanc pens
pandora charms sale clearance
ugg outlet
coach outlet
michael kors outlet
canada goose
pandora jewelry
coach outlet
ralph lauren uk
pandora jewelry
ugg boots
canada goose
michael kors outlet clearance
canada goose jackets canada
uggs outlet
cheap nike shoes
michael kors outlet online
mlb jerseys wholesale
canada goose outlet store
coach outlet canada
michael kors outlet
coach outlet online
yeezy boost 350
ugg,uggs,uggs canada
polo outlet
ugg boots outlet
polo ralph lauren
michael kors outlet online
kate spade outlet online
canada goose outlet store
ugg boots clearance
canada goose jackets
christian louboutin
polo ralph lauren outlet online
air jordan shoes
pandora jewelry outlet
ralph lauren outlet
michael kors outlet online
ugg outlet
nike outlet
fitflops sale
oakley sunglasses outlet
fitflops sale clearance
canada goose outlet
cheap nfl jerseys
canada goose outlet
adidas yeezy
coach outlet online
ray ban sunglasses outlet
fred perry
coach outlet
michael kors outlet
ugg outlet
cheap jerseys wholesale
ugg boots
canada goose jackets
pandora rings
yeezy shoes
ugg sale
fred perry polo shirts
kate spade outlet online
michael kors outlet
michael kors outlet clearance
ugg boots
canada goose outlet store
canada goose jackets
nmd adidas
ferragamo outlet
mbt shoes
polo ralph lauren
longchamp outlet
pandora bracelet
michael kors outlet
longchamp
nfl jerseys
coach outlet
uggs outlet
polo outlet
christian louboutin shoes
michael kors outlet online
uggs outlet
oakley sunglasses wholesale
coach outlet store online
giuseppe zanotti outlet
coach outlet online
michael kors outlet
mont blanc outlet
cheap authentic nba jerseys
polo ralph lauren
mulberry sale
uggs outlet
nike outlet online
canada goose
polo ralph lauren outlet online
mlb jerseys
adidas outlet
nike air max
air max 2017
ugg outlet store
supreme clothing
fred perry outlet
polo ralph lauren
polo outlet
mlb jerseys wholesale
lunette ray ban
ralph lauren outlet
ugg outlet stores
mbt outlet
lacoste outlet
michael kors handbags
adidas outlet store
canada goose outlet
coach outlet
polo ralph lauren
cheap uggs
mlb jerseys
oakley sunglasses
polo ralph lauren
cheap ray ban sunglasses
ralph lauren
canada goose uk
kate spade handbags
canada goose outlet
michael kors outlet clearance
cheap jordans
pandora jewelry sale
nmd adidas
coach outlet online
nike shoes
pandora outlet
cheap ugg boots
air max 90
michael kors outlet online
air jordan shoes
kate spade sale
ugg outlet
mulberry handbags
ugg boots
michael kors outlet
christian louboutin shoes
longchamp handbags
michael kors outlet online
coach outlet
lacoste shoes
pandora charms outlet
canada goose outlet
polo shirts
pandora charms
ugg boots clearance
ugg boots
ugg outlet
uggs outlet
canada goose outlet
supreme t shirts
michael kors outlet
pandora outlet
ugg outlet
ugg,uggs,uggs canada

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests