Arduino in build Led

I am currently trying to program my arduino mega with the Atmel2560 in Assembler.

I have compiled the following code:

LDI R16, 0xFF LDI R17, 0x00 STS DDRH, R16 STS PORTH, R17

And loaded it into the arduino with arv dude

In my opinion it should switch the onboard led off but it is constantly on. What is wrong with my code?

Where is the rest of the program, POST IT!

Mark

Well i think weve found the Problem here. This is my complete code and thought that would be all. Obviously something else is nessecary to do the task. Can you tell me what, or were i find information about that? Thank you.

Well i think weve found the Problem here

Good - what was it?

Obviously something else is nessecary to do the task.

Maybe something like an infinite loop to stop the processor yomping off over the unwritten flash.

I am trying that out later, sorry im completely New to Assembler and arduino

Even if that code where in a loop you would still never see it blink!. You can see individual blinks once the rate is over about 10Hz.

Mark

No i want to switch the led explicitly out to test if my code works. I want to imlement the blink function later

The compiler used by the Arduino IDE produces very good code. It is unlikely you will do a lot better.

Why not write the sketch using C++ and the Arduino IDE and then study the assembler listing.

…R