I’m a total newbie to the Arduino/Sanguino microcontrollers. I apologize for the long-winded post but I want to make sure I explain my issue as thoroughly as possible.
I’ve been playing with a Sanguino for the last couple of weeks and I’m working on a project to rotate a ham radio antenna, a rotator controller. You enter the compass heading where you want the antenna to point and it turns the antenna to that heading. I have much of the guts of the sketch working fine. This part works fine so far. Now, I want to add a real-time clock which, hardware-wise, is no big deal. What I want the user to be able to do is manually set the clock time. So, using the keypad library I’m slowly figuring out how to do this but in troubleshooting I used a lot of Serial.print commands throughout the keypadEvent code to verify where the program is processing and print various status messages with array and variable values and the like. This is mostly to help me understand how the routine works. I’m not a C programmer so this is all new to me so I’m learning as I go. I have some experience with PHP which has very similar programming instructions. I’m sure my code is very inefficient but at this point all I want to do is get it working.
Where I’m running into problems is I found that there can be too many Serial.print statements which causes the chip to not run, continually reset or just lock up and never run. I found if my sketch is 15265 bytes or higher the sketch the chip just continuously resets. If the byte size is around 15275 the sketch doesn’t even run. It uploads fine as far as I can tell based on the debug LED. If I remove some of the Serial.print statements the sketch will run. After I removed some of the Serial.print statements and added some if statements and other commands when I verify and compile the program the byte count doesn’t seem to increase. But, as soon as I add some Serial.print statements the byte size increases. This doesn’t make sense to me but that’s what I’m seeing in the IDE. When I verify the sketch this is what I see: Binary sketch size: 15265 bytes (of a 63488 byte maximum).
I searched to forums but I didn’t find anything related to this. Am I running into some internal limitation of the 644P chip? I don’t know where to look for a resolution. For now, I just commented out as many Serial.print statements as I could so I could continue development.
I also checked the preferences.txt file to see if there is something in there that might mention this limitation but there’s nothing obvious.
I’m using Arduino version 0022, Windows XP SP2. I haven’t tried any earlier Arduino versions. Just for grins I tried another Sanguino chip I got from a different source so I suspect it’s not the chip as far as a problem with the original chip.
I’m as a loss as how to proceed. When I’m finished with development I’ll remove all Serial.print statements.
Any guidance would be appreciated.
I can post all the different .PDE files if needed; I have each function in a separate tab to keep things more tidy.