Hi,
I got my first teensy 4.1 for a project that required it and it does weird things.
so i wrote a simple sketch to check the RAM
The sketch is simply writing numbers to an array
then it goes over the array and prints them to the serial
When i am using an array of a size around more then 4000 things get weird
example1: array of 3000 (graph_size=3000)
prints ok to serial every time last value is 2999
example2: array of 10,000 (graph_size=10,000)
doesn't print all the array every time
serial prints for each loop stops randomly at certain numbers:
4621, 4963, 5304, 7011, 7352, 9999
also sometimes it prints some gibberish on the way
would be happy to get some idea what i am missing..
*****this is the sketch:****
const int graph_size=10000;
int graph[graph_size];
void setup() {
}
void loop() {
for(int i = 0; i < graph_size ; i++)
graph=i;
for(int i = 0; i < graph_size ; i++)
Serial.println(graph);
delay(2000);
}
I got my first teensy 4.1 for a project that required it and it does weird things.
so i wrote a simple sketch to check the RAM
The sketch is simply writing numbers to an array
then it goes over the array and prints them to the serial
When i am using an array of a size around more then 4000 things get weird
example1: array of 3000 (graph_size=3000)
prints ok to serial every time last value is 2999
example2: array of 10,000 (graph_size=10,000)
doesn't print all the array every time
serial prints for each loop stops randomly at certain numbers:
4621, 4963, 5304, 7011, 7352, 9999
also sometimes it prints some gibberish on the way
would be happy to get some idea what i am missing..
*****this is the sketch:****
const int graph_size=10000;
int graph[graph_size];
void setup() {
}
void loop() {
for(int i = 0; i < graph_size ; i++)
graph=i;
for(int i = 0; i < graph_size ; i++)
Serial.println(graph);
delay(2000);
}