Jump to content
43oh

TM4C1294 analogRead() and Ethernet failure


Recommended Posts

Hello!

 

I'm having a few issues with this simple sketch:

#include <Ethernet.h>

EthernetClient client;
int sensorPin = A3;
float sensorValue = 0;

void setup() {
  Serial.begin(9600);
  delay(100);
  Ethernet.begin(0);
}

void loop() {
  sensorValue = analogRead(sensorPin);
  Serial.println(sensorValue);
  delay(300);
}

The ADC values seem to jump around randomly when Ethernet.begin(0) is called.

If I comment out the Ethernet portion the ADC seems to be stable again.

I've tried other analog input pins and I get the same result.

 

Hardware is a Connected LaunchPad (EK-TM4C1294XL) + LM35 sensor, both from TI.

 

Any ideas?

 

Thanks

Link to post
Share on other sites

Hi,

 

here are a few samples of the sensor: http://pastebin.com/WDLhm0v0

 

As you can see there's way more variance in the second column, which is samples taken after Ethernet.begin(0);

 

Samples with Ethernet disabled range from 265 to 287 (acceptable, within specs of the sensor) while samples with Ethernet enabled range from 127 to 368 (way off).

 

Thanks

Link to post
Share on other sites
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...