osDelay(x) behaviour
Posted: Sun May 07, 2017 1:17 pm
Hello,
I can't explain the behavior of the following code, compiled on STM32F105 with Chibios 16.1.8:
for (uint32_t i = 0; i < size; ++i) {
sdWrite(DRV, &data[i], 1);
osDelay(time);
}
Send data on the serial line, there should be a pause between each byte - time in ms
When I observe the transmission with oscilloscope, I see that the pause is exactly (time - 1) ms. If time == 1 -> no delay between the bytes, if time == 2, then there is exactly 1 ms between the end of the stop bit and the start bit of the next byte.
I tried to play with osDelay(..) and simple GPIO change - everything on the line as expected - no -1 shift
I can't explain the behavior of the following code, compiled on STM32F105 with Chibios 16.1.8:
for (uint32_t i = 0; i < size; ++i) {
sdWrite(DRV, &data[i], 1);
osDelay(time);
}
Send data on the serial line, there should be a pause between each byte - time in ms
When I observe the transmission with oscilloscope, I see that the pause is exactly (time - 1) ms. If time == 1 -> no delay between the bytes, if time == 2, then there is exactly 1 ms between the end of the stop bit and the start bit of the next byte.
I tried to play with osDelay(..) and simple GPIO change - everything on the line as expected - no -1 shift