0

I would like to know how can I change LED pin for avr_boot bootloader.

I can see there is option in variants folder but in the manual it mention "if using USE_LED adapt LED-pins in asmfunc.S" which is not clear. I am using pin PC3 how do I write it.

1 Answer 1

2

Near the top of asmfunc.S, you have these lines:

; LED Pins
#define DDR_SS  _SFR_IO_ADDR(DDRD), 5   // SS pin (PIN, PORT)
#define PORT_SS _SFR_IO_ADDR(PORTD), 5

#define DDR_PW  _SFR_IO_ADDR(DDRD), 6   // Power pin (PIN, PORT)
#define PORT_PW _SFR_IO_ADDR(PORTD), 6

These define the “write” or “slave select” LED pin as PD5 (registers DDRD and PORTD, bit 5), and the “power” LED as PD6 (registers DDRD and PORTD, bit  6).

These are the lines you have to change if using different pins. For example, pin PC3 is: registers DDRC and PORTC, bit 3.

2
  • Got it. I am using port PC3 so how do I write it. Also do I have to do anything else.
    – Shahreza
    Aug 22, 2022 at 20:57
  • 1
    I do not know what each of these LEDs mean. Regarding PC3, see amended answer. Aug 22, 2022 at 21:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.