Loading...
Pages: 1 [2]   Go Down
Author Topic: Ethernet Shield (SD Slot) & LCD combined problems  (Read 1049 times)
0 Members and 1 Guest are viewing this topic.
Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 50
Posts: 3448
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The total processing time of each trip through the loop is probably greater than 1ms. That means time would be equal to 9999 on one loop, and 10001 on the next loop, never hitting exactly 10000.

I highly recommend disabling the w5100 SPI interface if you are not using it. That is the same advice I give to those using the w5100 and not using the SD card. You must disable the unused interface, or some day it will bite you. You will start getting trash on the active interface caused by the other interface not being disabled. The SS pin on the unused SPI interface will float to enabled, probably just now and then, just enough to drive you crazy.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah, I see. Thanks alot for the insight.
So there is no possible way for me to get a recording every 10 seconds as opposed to 16-17 seconds?
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 50
Posts: 3448
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah, I see. Thanks alot for the insight.
So there is no possible way for me to get a recording every 10 seconds as opposed to 16-17 seconds?

I did not look at the rest of the code to see where the holdup is. You should not have any problem with a 10 second update. The files take about a second at the most.

You will need to figure out in your code where the time is being spent. Six to seven seconds should be easy to find with some well-placed Serial.println("At X") statements. Watch the serial monitor and wait for the unexpected pause in serial output.

Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 312
Posts: 35483
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Try this:
There are potential issues with adding unsigned longs, like that. Subtraction is guaranteed even across rollover. Addition is not.

Code:
if(time > (timer+10000)){
should be
Code:
if(time - timer >= 10000)
 {
(Although the names of the variables leave a lot to be desired. currTime and prevTime would mean a lot more to me.)
Logged

Pages: 1 [2]   Go Up
Print
 
Jump to: