some fixes
This commit is contained in:
@ -8,9 +8,10 @@
|
||||
#include "main.h"
|
||||
|
||||
#define DS1809_POSITION_COUNT 64u
|
||||
#define DS1809_CPU_PULSE_WIDTH_MS 2u
|
||||
#define DS1809_CPU_INTER_PULSE_HIGH_MS 2u
|
||||
#define DS1809_CONTROL_PORT_READY_DELAY_MS 10u
|
||||
#define DS1809_RESET_DOWN_PULSE_COUNT 80u
|
||||
#define DS1809_CPU_PULSE_WIDTH_MS 8u
|
||||
#define DS1809_CPU_INTER_PULSE_HIGH_MS 8u
|
||||
#define DS1809_CONTROL_PORT_READY_DELAY_MS 500u
|
||||
|
||||
static void ds1809_drive_idle_high(void)
|
||||
{
|
||||
@ -69,7 +70,7 @@ void ds1809_apply_position_from_min(uint8_t position_from_min)
|
||||
* - repetitive pulses need at least 1 ms of high time between steps;
|
||||
* - the control inputs are locked out for at least 10 ms after power-up.
|
||||
*
|
||||
* Use 2 ms low/high timing for margin, always drive to the RL end first,
|
||||
* Use 8 ms low/high timing for margin, always drive to the RL end first,
|
||||
* then walk back up to the requested absolute position.
|
||||
*/
|
||||
if (position_from_min >= DS1809_POSITION_COUNT)
|
||||
@ -78,6 +79,6 @@ void ds1809_apply_position_from_min(uint8_t position_from_min)
|
||||
}
|
||||
|
||||
HAL_Delay(DS1809_CONTROL_PORT_READY_DELAY_MS);
|
||||
ds1809_pulse_direction(0u, 1u, DS1809_POSITION_COUNT, DS1809_CPU_PULSE_WIDTH_MS, DS1809_CPU_INTER_PULSE_HIGH_MS);
|
||||
ds1809_pulse_direction(0u, 1u, DS1809_RESET_DOWN_PULSE_COUNT, DS1809_CPU_PULSE_WIDTH_MS, DS1809_CPU_INTER_PULSE_HIGH_MS);
|
||||
ds1809_pulse_direction(1u, 0u, position_from_min, DS1809_CPU_PULSE_WIDTH_MS, DS1809_CPU_INTER_PULSE_HIGH_MS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user