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