Dr_Doggy
Well-Known Member
so a bit of history is that i use to not bother with strings cos i knew they were somehow bad, but for this project i had a logbuffer that could sometimes get extremely long and decided to string it.. but after about 12 hrs the fragmens caught up and crashed the atmega2560
so i ran this code to see if i could look in to the mem banks ... there was alot of blocks like this in it.....
Question #1!! ) is the above result the fragment problem they are talking about or is that my improper use of using a pointer!!?
so i decided to send the strings all to char arrays... conversions went smooth but i made one mistake where i used the ltoa functions very improperly.. but i got all the bugs sorted and this is where i noticed a bigger problem.
so i have been rolling back my code and had to bring it down to this... my problem is that TIMSK3 instructions is locking up arduino, it never makes it to the breakpoint = 1, it never calls the interrupt anymore, and never even makes it to main loop. when i comment that one line out i am able to make it to main loop.
I started off with timer1 and also everything was working before I started messing with the char arrays
could i have messed up a mem block? wouldnt a new upload fix that (also i tried burning new bootloader)?
could this be a HW issue that just so happened when i started messing with pointers?
... something else??:
so i ran this code to see if i could look in to the mem banks ... there was alot of blocks like this in it.....
Code:
char *p =0;
while (1){Serial.print(p++);}
dogg-house
ogg-house
gg-house
g-house
-house
house
ouse
use
se
e
superyumyum
uperyumyum
peryumyum
eryumyum
ryumyum
yumyum
umyum
myum
yum
um
m
so i decided to send the strings all to char arrays... conversions went smooth but i made one mistake where i used the ltoa functions very improperly.. but i got all the bugs sorted and this is where i noticed a bigger problem.
so i have been rolling back my code and had to bring it down to this... my problem is that TIMSK3 instructions is locking up arduino, it never makes it to the breakpoint = 1, it never calls the interrupt anymore, and never even makes it to main loop. when i comment that one line out i am able to make it to main loop.
I started off with timer1 and also everything was working before I started messing with the char arrays
could i have messed up a mem block? wouldnt a new upload fix that (also i tried burning new bootloader)?
could this be a HW issue that just so happened when i started messing with pointers?
... something else??:
Code:
#include <Arduino.h>
ISR(TIMER3_OVF_vect)
{
int xxx = 1;
}
void setupTimer1()
{
TCCR3B |= (1 << CS10); // set up timer with prescaler
TCCR3B |= (1 << CS11); // set up timer with prescaler
TCNT3 = 0; // initialize counter
TIFR3 = 0;
int breakpoint = 0;
TIMSK3 |= (1 << TOIE3); // enable overflow interrupt
breakpoint = 1;
sei(); // enable global interrupts
breakpoint = 2;
}
void setup()
{
setupTimer1();
}
void loop()
{
while (1)
{
int xxx = 1;
}
}