STM32F103C8T6 delay not precise
Posted: Tue Nov 22, 2016 2:33 am
Hi all
I have BluePill and STM32F103C8T6 I need delays 1, 4, 10 and 100 (micro/us) and 1ms and 10ms (for LCD timing)
but I don't have it correct timings on current setup
Here is test project I'm working on: https://github.com/InvalidExcepti0n/BluePill-ChibiOS
And trying to adjust this for test on LED to turn off/on in specific time (1, 2, 4 and 100) us
Measuring with Logic Analazer (and Oscilloscope) getting wrong timings for us (for mili(ms) working fine)
And that part confuses me
@tfAteba
I have looked into CH_CFG_ST_FREQUENCY and if I change it chThdSleepMilliseconds not working anymore
so not sure if that will help me...
I don't know if my clocks settings is OK as ms wouldn't work if they are wrong (is this right)
Or this can be changed so ms archive with us instead?
Maybe there is another way and I'm not familiar as I'm new to ChibiOS
EDIT:
CH_CFG_ST_FREQUENCY 100000 //over this value not working right
chThdSleepMicroseconds(1); gives me closest I can get 10us
chThdSleepMilliseconds(1); gives me 1ms
I have BluePill and STM32F103C8T6 I need delays 1, 4, 10 and 100 (micro/us) and 1ms and 10ms (for LCD timing)
but I don't have it correct timings on current setup
Here is test project I'm working on: https://github.com/InvalidExcepti0n/BluePill-ChibiOS
And trying to adjust this for test on LED to turn off/on in specific time (1, 2, 4 and 100) us
Measuring with Logic Analazer (and Oscilloscope) getting wrong timings for us (for mili(ms) working fine)
And that part confuses me
@tfAteba
I have looked into CH_CFG_ST_FREQUENCY and if I change it chThdSleepMilliseconds not working anymore
so not sure if that will help me...
I don't know if my clocks settings is OK as ms wouldn't work if they are wrong (is this right)
Or this can be changed so ms archive with us instead?
Maybe there is another way and I'm not familiar as I'm new to ChibiOS
EDIT:
CH_CFG_ST_FREQUENCY 100000 //over this value not working right
chThdSleepMicroseconds(1); gives me closest I can get 10us
chThdSleepMilliseconds(1); gives me 1ms