This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How can i control a servo using ONLY assembly code? FRDM-kl25z and KEIL

Currently working a school project where i need to control a servo using only assembly. I cant find anything anywhere that doesn't involve a C program.

I understand the use of PWM i just don't know how to implement it using the Cortex M0 instruction set.

Parents
  • It is probably unreasonable to expect code to solve your exact problem to drop out of a Google search, that really not how the world of coding works.

    Perhaps focus on your course notes about how to write in assembler and what the compiler does when it translates your C code.

    Configuration is likely just a bunch of LDR, STR and MOV instructions, hardly that complicated. The manuals for the part no doubt describe the addresses of various buses and peripherals, and the clocks that drive those peripherals. The peripheral register content at a bit level is also likely described.

    Build working C examples, generate .LST files or disassemble with FromELF -c option to get clues.

    If this is material the professor is supposed to have taught you challenge them to do their job.

Reply
  • It is probably unreasonable to expect code to solve your exact problem to drop out of a Google search, that really not how the world of coding works.

    Perhaps focus on your course notes about how to write in assembler and what the compiler does when it translates your C code.

    Configuration is likely just a bunch of LDR, STR and MOV instructions, hardly that complicated. The manuals for the part no doubt describe the addresses of various buses and peripherals, and the clocks that drive those peripherals. The peripheral register content at a bit level is also likely described.

    Build working C examples, generate .LST files or disassemble with FromELF -c option to get clues.

    If this is material the professor is supposed to have taught you challenge them to do their job.

Children