Optiboot / optiboot

Small and Fast Bootloader for Arduino and other Atmel AVR chips
Other
1.09k stars 401 forks source link

Reassign RX TX pins #307

Closed Kabron287 closed 2 years ago

Kabron287 commented 3 years ago

Hi there, I work with Attiny85 and I need to use other than PB0, PB1 softuart pins. What command option should I use? Thanks in advance, Vladimir

WestfW commented 3 years ago

Currently, edit pin_defs.h - find the occurrence of ATtiny85, which will look like:

/*------------------------------------------------------------------------ */
#if defined(__AVR_ATtiny85__)
/*------------------------------------------------------------------------ */
/* LED is on B2 */
#if !defined(LED)
#define LED   B2
#endif

#if SOFT_UART
#define UART_PORT   PORTB
#define UART_PIN    PINB
#define UART_DDR    DDRB
#define UART_TX_BIT 0
#define UART_RX_BIT 1
#endif
#endif

Change UART_TX_BIT and UART_RX_BIT to whatever you want. (tiny85 only has PORTB, right?)

It'd be an interesting modification, to allow selecting the pins from the "make" command, but it would be a bit of work.

WestfW commented 2 years ago

Committed via https://github.com/Optiboot/optiboot/commit/f4fd294e389ff3d8c3afe3fbc6a9ec06492795fb#diff-d00465a0b6fb5a959e455fec9bbf7ab1553c0720e2a736d94b4a1d5a7156082b