system
July 23, 2014, 9:25am
1
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
system
July 23, 2014, 11:47am
3
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.
system
July 23, 2014, 12:08pm
4
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.
system
July 23, 2014, 12:47pm
5
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
system
July 23, 2014, 1:47pm
7
No i want to switch the led explicitly out to test if my code works. I want to imlement the blink function later
Robin2
July 23, 2014, 7:05pm
8
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