keil program with nucleo stm32xubemx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-31 2:42 AM
if i have
int angka_test = 10;
int a;
while (1) {
output = output_start + ((output_end - output_start) * (angka_test - input_start)) / (input_end - input_start);
a = angka_test;
__HAL_TIM_SET_AUTORELOAD(&htim2, output); }
why 'a' if i seee form watch is 0, but angka_test=100, help me
Solved! Go to Solution.
- Labels:
-
STM32F3 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-31 2:51 AM
Please see the posting tips for how to properly post source code:
It should look something like this:
int angka_test = 10;
int a;
while (1) {
output = output_start + ((output_end - output_start) * (angka_test - input_start)) / (input_end - input_start);
a = angka_test;
__HAL_TIM_SET_AUTORELOAD(&htim2, output);
}
@meriarajagukguk wrote:why 'a' if i see from watch is 0, but angka_test=100, help me
Perhaps provide a screenshot of how you're seeing this, and a detailed description of how you get there?
Note that Keil is a 3rd-party products - nothing to do with ST - so you really need to be asking Keil about specific issues with their tool:
https://community.arm.com/support-forums/f/keil-forum
Two things to note:
- Optimisation: in the code shown, you never use the value of a - so it's likely to have been optimised away;
- Understand how Keil updates its "Watched" values - maybe what you're seeing is just "out of date", because the display hasn't updated?
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-31 2:51 AM
Please see the posting tips for how to properly post source code:
It should look something like this:
int angka_test = 10;
int a;
while (1) {
output = output_start + ((output_end - output_start) * (angka_test - input_start)) / (input_end - input_start);
a = angka_test;
__HAL_TIM_SET_AUTORELOAD(&htim2, output);
}
@meriarajagukguk wrote:why 'a' if i see from watch is 0, but angka_test=100, help me
Perhaps provide a screenshot of how you're seeing this, and a detailed description of how you get there?
Note that Keil is a 3rd-party products - nothing to do with ST - so you really need to be asking Keil about specific issues with their tool:
https://community.arm.com/support-forums/f/keil-forum
Two things to note:
- Optimisation: in the code shown, you never use the value of a - so it's likely to have been optimised away;
- Understand how Keil updates its "Watched" values - maybe what you're seeing is just "out of date", because the display hasn't updated?
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-01 1:51 AM
big thanks to your help
