Timeline for Problem interfacing stepper motor with Atmega 32
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 30, 2021 at 3:51 | comment | added | Seif_1999 | You are absolutely right, that's my bad. But if can have a look on the second one it did work. Sadly this is the simplest example I can start with. I am just trying to get the motor to rotate consistently in one direction and I can not even do that. | |
Dec 30, 2021 at 3:45 | comment | added | bigjosh | @Seif_1999 I do not trust that your first Arduino example can possibly work as claimed since it never sets the DDR register. If the code in the question does not match the code you are running then no way someone looking at the question can help you! I'd take a step back and start from the simplest example that you can get working and then take small and controlled steps forward from that example to your final goal, testing and confirming at each step. If you do this carefully then I think you will be much better off. Randomly changing stuff in different places and hoping never works! :) | |
Dec 30, 2021 at 3:38 | comment | added | Seif_1999 | I just edited the question, please have look a look and let me know what you think. And yes indeed it was a mess :), sorry for that, I had so many tries that I got codes mixed up. Anyway, I cleaned up every thing tried it again, but got the same results. I moved away from PORTD to avoid any conflict with serial (even though I did not enable it) and used the same steps sequence in asm, C, and arduino. | |
Dec 30, 2021 at 3:06 | comment | added | bigjosh | You can edit the current question. Also, looking at your ASM further it seems to functionally be completely different than the working Arduino code. It sets two PORT bits on each step whereas the Arduino code only sets one. I bet once you clean things up the answer will be clear. For me, cleaning up my own questions so I can post them on stack exchange often solves my problem. :) | |
Dec 30, 2021 at 3:03 | comment | added | Seif_1999 | Okay, I will clean it up, try it again and report back. Thanks. Should I remove this question and post a new cleaned up one? | |
Dec 30, 2021 at 2:59 | history | answered | bigjosh | CC BY-SA 4.0 |