I use my own e-switch firmware, based on JohnnyC's and can choose what MCU pin I want the switch on - choices are pin #2, #3, or #5 I believe (see code below). Mine by default is on MCU pin #2 and I believe this is typical, most common. Since the BLF17DD has to be flashed with firmware, the pin definition is defined by that firmware, not the hardware. Looked through my pics and found this one with a BLF17DD built in a Convoy L4, and it clearly shows the e-switch wire on MCU pin #2. comfy is correct in post #74:
Here's part of the code header definitions in my e-switch driver. I added more comments than what was there originally. I'm a consulting software engineer with 35 years experience in software development, so know how important it is to have good doc and reference material. but also know there can be too much, redundancy can be a bad thing, and attempting to document things you really don't understand can be worse than no documenting. Sorry for the poor formatting in html:
//-------------------------------------------------------------------------------------
// Used for FET based Phase Corrected PWM:
//-------------------------------------------------------------------------------------
#define MODES 0,2,25,255 // 4 modes %: 1-10-100 (for Cheng - no strobe)
//#define MODES 0,12,64,128,255 // 4 modes %: 5-25-50-100 (for Kenny's Warsun, Y3 - no strobe)
//#define MODES 0,1,12,102,255 // 4 modes: %: ml-5-40-100 (for Michael G. w/strobe)
//#define MODES 0,1,4,16,100,255 // 5 modes
// RMM - used in a MT-G2 build (5 modes):
//#define MODES 0,1,4,25,120,255
// RMM - also used this set (6 modes):
//#define MODES 0,1,4,8,20,110,255
//-------------------------------------------------------------------------------------
// Used for 7135 based Phase Corrected PWM:
//-------------------------------------------------------------------------------------
//#define MODES 0,5,15,92,255 // 5=moonlight, 15=6%, 92=36%, 255=100%
// Original mode settings, used with Fast PWM:
//#define MODES 0,16,32,125,255 // Must be low to high, and must start with 0
//-------------------------------------------------------------------------------------
#define LONG_PRESS_DUR 21 // How long until a press is a long press (32 is ~0.5 sec), 21 = 0.336 secs
#define PWM_OPTION 0x21 // 0x21 for phase corrected (9.4 kHz) or 0x23 for fast-PWM (18 kHz)
// ----- One-Click Turn OFF option --------------------------------------------
#define IDLE_LOCK // Comment out to disable
#define IDLE_TIME 75 // make the time-out 1.2 seconds
// ----------------------------------------------------------------------------
// ----- Option Strobe Mode ---------------------------------------------------
//#define ENABLE_STROBE
//#define XLONG_PRESS_DUR 48 // 38=0.6 secs, 48=0.75 secs
// ----- Turbo Settings -------------------------------------------------------
//#define TURBO // Comment out to disable - full output, step downs after n number of secs
// If turbo is enabled, it will be where 255 is listed in the modes above
//#define TURBO_TIMEOUT 5625 // time before dropping down (16 msecs per, 5625=90 secs)
// ----------------------------------------------------------------------------
// ----- Voltage Monitoring Settings ------------------------------------------
#define VOLTAGE_MON // Comment out to disable - ramp down and eventual shutoff when battery is low
#define ADC_LOW 130 // When do we start ramping (3.1v), 5 per 0.1v
#define ADC_CRIT 115 // When do we shut the light off (2.80v)
#define ADC_DELAY 188 // Delay in ticks between low-bat rampdowns (188 ~= 3s)
// ----------------------------------------------------------------------------
/*
* =========================================================================
*/
#include <avr/pgmspace.h>
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>
#include <avr/eeprom.h>
#include <avr/sleep.h>
//#include <avr/power.h>
#define STAR2_PIN PB0 // Star 2, MCU pin #5
#define STAR3_PIN PB4 // Star 3, MCU pin #3
#define SWITCH_PIN PB3 // Star 4, MCU pin #2, pin the switch is connected to
#define PWM_PIN PB1 // PWM Output, MCU pin #6
#define VOLTAGE_PIN PB2 // Voltage monitoring input, MCU pin #7
#define ADC_CHANNEL 0x01 // MUX 01 corresponds with PB2
#define ADC_DIDR ADC1D // Digital input disable bit corresponding with PB2
#define ADC_PRSCL 0x06 // clk/64
#define PWM_LVL OCR0B // OCR0B is the output compare register for PB1
#define DB_REL_DUR 0b00001111 // time before we consider the switch released after
// each bit of 1 from the right equals 16ms, so 0x0f = 64ms