From 3b6743728d2362a03e8001228791dcbde1a28e3e Mon Sep 17 00:00:00 2001 From: Dennis Gunia Date: Sat, 1 Nov 2025 23:47:01 +0100 Subject: [PATCH] fix sense pin --- software/firmware_module/module_rev3/src/mctrl.c | 2 +- software/firmware_module/module_rev3/src/rs458.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/software/firmware_module/module_rev3/src/mctrl.c b/software/firmware_module/module_rev3/src/mctrl.c index 94ebdaf..90286bb 100644 --- a/software/firmware_module/module_rev3/src/mctrl.c +++ b/software/firmware_module/module_rev3/src/mctrl.c @@ -173,7 +173,7 @@ ISR(TIMER1_COMPA_vect) absolute_pos -= STEPS_PER_REV; } // detect home position - if ((PIND & (1 << PD3)) == 0) + if ((PIND & (1 << PD4)) == 0) { if (lastSens == 0) { diff --git a/software/firmware_module/module_rev3/src/rs458.c b/software/firmware_module/module_rev3/src/rs458.c index 5b8bc18..2fb86a0 100644 --- a/software/firmware_module/module_rev3/src/rs458.c +++ b/software/firmware_module/module_rev3/src/rs458.c @@ -12,9 +12,9 @@ void rs485_init() { // init I/O - DDRD &= ~(1 << PD0); // BUS_DIR & TX is OUTPUT + DDRD &= ~(1 << PD0); // RX is INPUT DDRD |= (1 << PD3) | (1 << PD2) | (1 << PD1); // BUS_DIR & TX is OUTPUT - PORTD &= 0x07; // clear PD0-PD4 + PORTD &= 0xE0; // clear PD0-PD4 // init UART UBRRH = (BAUDRATE >> 8); UBRRL = BAUDRATE; // set baud rate