From 77ff8b973b6234067d027e6f9a6bbca99d01cbe9 Mon Sep 17 00:00:00 2001 From: lurenaud Date: Mon, 25 May 2026 15:17:14 +0200 Subject: [PATCH] Correct ATtiny84 LIN pinout mappings --- Arduino/LIN_to_IR/LIN_to_IR.cpp | 12 ++++++------ Arduino/LIN_to_IR/README.md | 9 +++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Arduino/LIN_to_IR/LIN_to_IR.cpp b/Arduino/LIN_to_IR/LIN_to_IR.cpp index 4dc1c5a..bfbae71 100644 --- a/Arduino/LIN_to_IR/LIN_to_IR.cpp +++ b/Arduino/LIN_to_IR/LIN_to_IR.cpp @@ -2,13 +2,13 @@ #include #include "lin_frame.h" -#define IR_ARDUINO_PIN 10 -#define LED_PIN 3 +#define IR_ARDUINO_PIN PIN_PA0 // Digital pin 10 +#define LED_PIN PIN_PA7 // Digital pin 3 -#define RX_PIN 8 -#define TX_PIN 2 // Unused dummy pin for SoftwareSerial TX -#define FAULT_PIN 9 -#define CS_PIN 11 +#define RX_PIN PIN_PB2 // Digital pin 2 +#define TX_PIN PIN_PB0 // Digital pin 0 (Unused dummy pin or LIN TX) +#define FAULT_PIN PIN_PB1 // Digital pin 1 +#define CS_PIN PIN_PB3 // Digital pin 11 #define SYN_FIELD 0x55 #define SWM_ID 0x20 diff --git a/Arduino/LIN_to_IR/README.md b/Arduino/LIN_to_IR/README.md index c032df0..10aaf4d 100644 --- a/Arduino/LIN_to_IR/README.md +++ b/Arduino/LIN_to_IR/README.md @@ -9,10 +9,11 @@ It decodes steering wheel navigation buttons from the vehicle's LIN bus and tran | ATtiny84 Pin | Digital Pin (Arduino) | Function | Description | | :--- | :--- | :--- | :--- | | **PA0** | `10` | IR Output | Direct-wired to Raspberry Pi GPIO 24 | -| **PA5** | `8` | LIN RX | SoftwareSerial RX from MCP2004 RXD | -| **PA1** | `9` | LIN FAULT/TXE | MCP2004 Fault Detect / Transmit Enable | -| **PA2** | `11` | LIN CS | MCP2004 Chip Select (Active High) | -| **PA6** | `3` | Debug LED | Flash on command transmission | +| **PB2** | `2` | LIN RX | SoftwareSerial RX from MCP2004 RXD | +| **PB0** | `0` | LIN TX | SoftwareSerial TX (Unused dummy) | +| **PB1** | `1` | LIN FAULT/TXE | MCP2004 Fault Detect / Transmit Enable | +| **PB3** | `11` | LIN CS | MCP2004 Chip Select (Active High) | +| **PA7** | `3` | Debug LED | Flash on command transmission | ## Key Mapping