Setup Repeating, not entering loop

So, my arduino makes it about half way through Setup, then repeats.
Output on the serial is:

Begin... Done
Screen Initialized
Begin... Done
Screen Initialized
Begin... Done
Screen Initialized
Begin... Done
Screen Initialized
Begin... Done
Screen Initialized
Begin... Done
Screen Initialized
Begin... Done
Screen Initialized
Begin... Done
Screen Initialized
Begin... Done
Screen Initialized

(continuing forever)

Any hints?

Any hints?

How should we give you hints if we haven't seen your code?

My full code is too long to fit in this window... so here's a google doc.

Please excuse the sloppiness... This code has had me up a few long nights.

pylon:

Any hints?

How should we give you hints if we haven't seen your code?

lol sorry. I was working on that while you replied :wink:

Here’s the contents of my MAINCONF file (referenced by the code)

`350`10000000`Testing Screen`B| R.Test: `C| L.Test: `D| HV.Test:`OK`NOK`A Problem!`X`*| Show Details`Detailed Results:`Leads : `R.Test: `L.Test: `#| Store Results`*| Back to Tests`
  0      1           2             3           4          5      6   7	    8      9        10             11            12       13       14              15              16
^Indices^ 

//--------------------RULES FOR CONFIG FILE--------------------//
0. Don't modify, move, or break any of the rules in this list unless you are
   the primary writer of the code, or your name is Zac Slade

1. Outside of the first line, there shall be no "accent marks" 
   (the delimiter character)

2. Accent marks are the index delimiter. Don't include them in strings.
   Don't change this without consulting both the team lead and the coding lead.

3. Indices shall be managed with EXTREME care, as if someone's life depended on it. 
   For all you know, someone's life DOES depend on it.

4. <left blank intentionally>

5. NEVER (never never never) save this file with "word wrap" enabled in the editor

6. <left blank intentionally>

7. ALWAYS save this file with UTF-8 encoding and NO OTHER ENCODING.

8. <left blank intentionally>

9. This file is ONLY to be used for (integers of value > 255) or (strings)
    all other numbers shall be saved as float, double, int16_t, uint16_t or smaller

10. When you update the first line, update the index numbers on the second line,
    and also update the table down at the bottom of the file. This is to ensure
    both that you've put thought into your change, and also that nobody else
    messes up the device.
//----------------END OF RULES FOR CONFIG FILE-----------------//


Available Numbers with types, indices, and value:

type	name			index	value
int 	IND_PULSETIME  		0	350
float 	IND_LTEST_ICAPV 	1	10000000
String	IND_ALL_TESTS		2	"A| All Tests /"
String	IND_R_TEST		3	"B| R.Test: "
String	IND_L_TEST		4	"C| L.Test: "
String	IND_HV_TEST		5	"D| HV.Test:"
String	IND_OK			6	"OK"
String	IND_NOK			7	"NOK"
String	IND_PROBLEM		8	"A Problem!"
String	IND_X			9	"X"
String	IND_SHOWDETS		10	"*| Show Details"
String	IND_DETRESULT		11	"Detailed Results:"
String	IND_LEADSDET		12	"Leads : "
String	IND_RDET		13	"R.Test: "
String	IND_LDET		14	"L.Test: "
String	IND_STORESULT		15	"#| Store Results"
String	IND_BTOTEST		16	"*| Back to Tests"

Thanks to any and all who lend a hand here.

For any nerds out there who’d like it… I’ve implemented a few cool things here for which I don’t see any precedent in the forums. Namely, I’ve got several string and number variables stored on an SD card to save ram/rom space. That constitutes the bottom three functions. Those functions work fine when standing alone.

P.S. Eliminating use of the SD card is not an option here. I'll be pasting in about 200 more lines of SD card utilization when I get this part working.

The SD library uses more than half of the memory (RAM) an UNO (or compatible) has. You don’t use any technique to save RAM in the rest of the code (p.e. using the F() macro), so if you’re using an UNO it’s clear that this doesn’t work.
If you must use the SD card you must take care for every byte of memory you use, so think about using an uint8_t instead of int if the variable doesn’t have to hold number greater than 255, to give you an example.

You would get that sort of effect if something (a motor or a servo, for example) was drawing too much current and causing the Arduino to reset.

...R

Thanks guys! I'll try your suggestions and update this thread as I hit the bench this week.

You'll sometimes see this sort of thing if you're running out of RAM.

AWOL:
You'll sometimes see this sort of thing if you're running out of RAM.

That would be my guess.
I haven't been able to compile it yet

boxcartenant, where did you find/get Termina6.h?

Are you aware that floattostring() is deprecated? Tha author found out about dtostrf(), and says it's about 20% smaller and probably faster. See the last post in the thread at http://forum.arduino.cc/index.php/topic,37391.0.html

If we could compile your code, it might help.

lar3ry:
boxcartenant, where did you find/get Termina6.h?

One of my teammates got the terminal6.h. It's just a font for the Nokia 5110 display. Here, I've uploaded it to google docs.

lar3ry:
Are you aware that floattostring() is deprecated? Tha author found out about dtostrf(), and says it's about 20% smaller and probably faster. See the last post in the thread at

I wasn't aware of that. I'll get to work implementing dtostrf().

The Nokia 5110 display is turning out to be a bit unreliable. We have to press down on the screen regularly to make it work. If we can't figure out why that is, we'll be switching to the uLCD-114-G2 (Goldelox display). We're still looking into how this will affect the code. Without running the risk of derailing this thread... do you guys have any input on that?

We just figured out what was wrong with the Nokia 5110. It has to do with the way we're writing to it and the voltage levels we're using. Scratch that last bit.

Alright guys,

Thanks for all your help!

I've been reading up on good coding practice, and per some of your suggestions I've made significant improvements to the code.

However, we believe that including all of the features we initially desired onto a single Atmega328P would reduce our flexibility if we ever got it to work.

Therefore, we're adding a second microcontroller to the design. One will handle all of our IO, and the other will perform the tests. Since we've managed to get each function (or snippet of the combined code) to work independently, we feel that this transition will not be too difficult.

Just thought I'd update you guys. Again, thanks a bunch for all your help, and sorry for not being more helpful in helping you help me, lol.

Peace :wink: