Klaus2m5 wrote:
In EhBASIC only the first 2 letters of variables are significant. So Via2PRB and Via2DDRB are the same variable: Vi. You are toggling the VIA's DDRB register instead of the PRB register, because that is the last definition of Vi. Of course that still works, if the LED is between Vcc and the port pin. PRB defaults to $00 after a reset. The port pin will start sinking current when it is defined as output and go to high-Z when it is not.
But you are not alone. I made the very same mistake in my first EhBASIC program.
edit: You will find more errors in your little program, if you fix the variables.
Thanks for the feedback as that was exactly what I was looking for by posting this. I will fix that error and then find the others.
This is also an 80's flashback, that used to be common behavior among Pascal compilers, although I think it was six or eight characters that they considered significant. Used to drive me crazy.