Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

Arduino Nano variables not working in RAMtable

2 posters

Go down  Message [Page 1 of 1]

itl24409



I am new here and work with SimulIDE 04.13 SR5 and Arduino IDE 18.1.13. When I use registers  like DDRB or PORTB for the Arduino Nano in the ramtable, it is working fine. When I put any of the variables of my sketch there as shown in the microcontroler tutorial, nothing happens, the adress stays empty. This is independent if I compile via SimulIDE/Arduino and load the sketch or I load a compiled HEX file directly. I neither depend if I run in Debug mode or not. I never got any variable value to show in the ramtable working. Neither globals, nor locals.
I believe that is a bug but I am not sure about it.
Any ideas are welcome.

arcachofo

arcachofo

Hi.
Sorry for the delay.

What variable type are you using?
Currently Simulide can detect: char, uchar, int, uint, short, ushort, long, ulong, float
Using uint8_t for example will not work.

Other consideratios:
- It will only detect variables if the sketch is compiled in Simulide.

- Declare one variable per line, for example:
       int myvariable;

This will miss  v2 and v3:
       int v1, v2, v3;

-  Global variables are not "global" for the compiler if they are used only in one function.
For example here var1 will be considered "local" and not written to the symbol table, so Simulide will not see it:
Code:
char var1;

void setup(){}

void loop()
{
    var1++;
    PORTB = var1;
    delay( 500 );
}

But here, it will be written to the symbol table and detected by Simulide (it is used in 2 funtions):
Code:
char var1;

void setup()
{
    var1 = 0;
}

void loop()
{
    var1++;
    PORTB = var1;
    delay( 500 );
}

If you still can't get it to work, please ler me know.

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum