MCUdude / MicroCore

A light-weight Arduino hardware package for ATtiny13
539 stars 87 forks source link

UART (Serial) on PIN5 #156

Closed gavazquez closed 6 months ago

gavazquez commented 6 months ago

Hi. It seems that I can transmit UART data using Serial on every pin except on pin 5

I tried using #define UART_TX_PIN B,5 I also changed the core_settings.h

It works on all the other pins but unfortunately on the board I'm trying to work with I only have the pin 5 free and I don't know how can I get data out of there.

Do you know if it's a limitation of the attiny13a?

This is the sketch I'm using (grabbed from here):

#include <EEPROM.h>
#define UART_TX_PIN B,5

uint32_t counter = 0;
uint8_t small_count = 0;

void setup() 
{
  // Check if there exist any OSCCAL value in EEPROM addr. 0
  // If not, run the oscillator tuner sketch first
  uint8_t cal = EEPROM.read(0);
  if (cal < 0x80)
    OSCCAL = cal;
}

void loop() 
{
  Serial.print(F("Serial Test ")); // The F macro should be here!
  Serial.print(counter);
  Serial.println(); // Occupies only 8 bytes
  counter++;
  small_count++;
  delay(1000); // Uses _delay_ms(1) inside a while loop to prevent inlining
}
gavazquez commented 6 months ago

Closing. Attiny13 can't use reset pin as output without changing fuses and then not being able to program it again unless you have a high voltage programmer :(