2023-11-28 03:22 AM
Hello
How can I access CPU registers using the Cosmic compiler?
For example, when I access register A, the compiler throws an error A is undefined (This is shown in the picture and also the project files).
Solved! Go to Solution.
2023-11-28 05:13 AM
You've to define address for any register. Check datasheet and see what's the address of A register and then define it accordingly.
Checkout this guide: https://lujji.github.io/blog/bare-metal-programming-stm8/
2023-11-28 05:13 AM
You've to define address for any register. Check datasheet and see what's the address of A register and then define it accordingly.
Checkout this guide: https://lujji.github.io/blog/bare-metal-programming-stm8/
2023-11-28 05:21 AM
Hello,
If "A" is a an internal core register you need to access it in assembly language.
If "A" is a peripheral register you need to define the address of "A" and access it by pointer in C.