Hello, I have a sketch with the following defined pins of ATtiny2313.
#define TLLIMIT 4
#define TULIMIT 5
#define BLLIMIT 6
#define BULIMIT 7
#define START_RELAY_PIN 8
#define STOP_RELAY_PIN 15
#define START_RELAY_LED_PIN 16
#define TULIMIT_LED_PIN 9
#define TLLIMIT_LED_PIN 10
#define LED1 11
#define BULIMIT_LED_PIN 12
#define BLLIMIT_LED_PIN 13
#define LED2 14
Pin configuration:
The issue is, I connected led to pin START_RELAY_LED_PIN. The led is lit up with barely visible but all the other functionalities are working fine. I tried with 2amp/3amp 5v smps but still I am facing the same issue. I swapped the pins 15 and 16 but still same issue.
All relays and other LEDs are working fine.
I tried with other Attiny2313 but still same issue. What could be the issue?
Could be a problem with circuit components, the wiring or the code.
The code is simple and straight forward.
digitalWriteFast(START_RELAY_LED_PIN, HIGH);
That line of code is indeed simple and straightforward, but what does it have to do with the LED?
Are there any other lines of code?
this is the code in void loop. Except START_RELAY_LED_PIN all are working fine means the led is lit up but barely visible.
digitalWriteFast(START_RELAY_PIN, closed); //turn on relay
digitalWriteFast(STOP_RELAY_PIN, closed); //turn on relay
digitalWrite(START_RELAY_LED_PIN, HIGH);
digitalWrite(TULIMIT_LED_PIN, HIGH);
digitalWrite(TLLIMIT_LED_PIN, HIGH);
digitalWrite(LED1, HIGH);
digitalWrite(BULIMIT_LED_PIN, HIGH);
digitalWrite(BLLIMIT_LED_PIN, HIGH);
digitalWrite(LED2, HIGH);
xfpd
November 30, 2024, 5:04pm
6
This LED is not like the other LEDs.
All LEDs are same type and same color but not sure why this particular pin behaves differently. I tested this code with new Attiny2313 as well but same results.
xfpd
November 30, 2024, 5:38pm
8
I guess the dimness is the clock (SCK/SCL) on that pin, acting like a PWM/fade LED.
Sorry you are correct this pin indicates SCL so how to use this pin as normal pin??
xfpd
December 1, 2024, 3:41am
10
Yes, DIO (hard to find the reference), but it also is "SCK/SCL".
Yes you are correct then how to use this pin as normal digital pin??
xfpd
December 1, 2024, 4:00am
12
I do not know. I found no references to PB7 as a DIO pin. Does it have an internal pullup? Can you use an external pullup/pulldown? Maybe try a different pin? I am looking at the datasheet (250 pages) for data about PB7...
https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-2543-AVR-ATtiny2313_Datasheet.pdf#G1184762
What code are you using? Did you set the pinMode() of PB7 as OUTPUT?
The more I look, the more I see it as I2C SCL, like D5 on Uno/Nano.
Please check my post number 1. Pin mode of this particular pin as Output