What is the status of serial on a tiny85

Success.
I tried with attiny85 at 8Mhz and it worked just fine.
I only tried with 4800, but will test with higher baudrate.

my test sketch:

#include <SoftwareSerial.h>
const int rx=2;
const int tx=3;


SoftwareSerial mySerial(rx, tx);

int i=0;
char buf[10];

void setup() 
{ 
  pinMode(rx,INPUT);
  pinMode(tx,OUTPUT);
   mySerial.begin(4800);
  
} 
 
void loop() 
{ 
  if (mySerial.available()>0){
   
    buf[i]= mySerial.read(); 
   
    if (int(buf[i])==13 || int(buf[i])==10 ){  //If Carriage return has been reached
  
        mySerial.println(buf);
        
      for(int x=0;x<=8;x++){
      buf[x]=' ';
      }
     i=0;  //start over again
   
    } //if enter
    i++; 
    } //IF mySerial.available
    
}//LOOP

Hi, I am keen to see this fix in the tiny84 currently I get the compile error:

C:\Users\John\Documents\arduino\libraries\jeelib/Ports.h:325: error: conflicting return type specified for 'virtual void UartPlug::write(byte)'
C:\Dropbox\SKETCHES\hardware\tiny\cores\tiny/Print.h:73: error: overriding 'virtual size_t Print::write(uint8_t)'

In the first sketch I used the serial monitor as input.

Now I tried this sketch on my Uno, connected UNO tx->tiny rx
It works as it should, no garbled characters and at 9600 baud.

I use a CP2103 serial/USB converter from Ebay to test the output from the Tiny

int x=0;
char buffer[10];

void setup() 
{ 
   Serial.begin(9600);
 
} 
 
void loop() 
{ 
  sprintf(buffer, "Test:%03d",x);
 Serial.println(buffer);
  x++;
  delay(500);
}//LOOP

JohnO:
Hi, I am keen to see this fix in the tiny84 currently I get the compile error:

With the version in Reply #14?

@Erni: Thanks!

With the version in Reply #14?

Hi, I tried the above version before posting. It doesn't appear to clear the issue for me.

Where did you get this file...
C:\Users\John\Documents\arduino\libraries\jeelib/Ports.h

Hi,

This file is part of the jeelib library: https://github.com/jcw/jeelib/

Do you think the issue is in this library?

Hi,

JohnO:
This file is part of the jeelib library: GitHub - jeelabs/jeelib: JeeLib for Arduino IDE: Ports, RF12, and RF69 drivers from JeeLabs
Do you think the issue is in this library?

You will have to use a previous version of the Tiny Core...
http://arduino-tiny.googlecode.com/files/arduino-tiny-0100-0013.zip

No joy yet I'm afraid:

In file included from TinyRF12_Demo.cpp:7:
C:\Users\John\Documents\arduino\libraries\SoftwareSerial/SoftwareSerial.h:92: error: conflicting return type specified for 'virtual size_t SoftwareSerial::write(uint8_t)'
C:\Dropbox\SKETCHES\hardware\tiny\cores\tiny/Print.h:71: error: overriding 'virtual void Print::write(uint8_t)'

I replaced my tiny & tools directory with the ones in arduino-tiny-0100-0013.zip

Thank you for spending time on this.

Please post the sketch you are trying to compile.

Here is the sketch.

TinyRF12_Demo.pde (8.17 KB)

I hate to be a pain but in the long run it will be worth it...

• Remove the previous version of the Tiny Core (arduino-tiny-0100-0013.zip).

• Install the latest version of the Tiny Core...
http://arduino-tiny.googlecode.com/files/arduino-tiny-0100-0014.zip

• Navigate to the libraries/JeeLib directory

• Locate and open Ports.h in a text editor

• Towards the top of the file make this change...

// keep the ATtiny85 on the "old" conventions until arduino-tiny gets fixed
#if ARDUINO >= 100 // && !defined(AVR_ATtiny84) && !defined(AVR_ATtiny85) && !defined(AVR_ATtiny44) && !defined(AVR_ATtiny45)
#define WRITE_RESULT size_t
#else
#define WRITE_RESULT void
#endif

• Save and close Ports.h

• If the Arduino IDE was running, close it and restart it

• Try again to compile the sketch

You are certainly not a pain! I have made the changes you recommended and you have indeed move the problem forward. I am now seeing:
C:\Users\John\Documents\arduino\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'void SoftwareSerial::begin(long int)':
C:\Users\John\Documents\arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:396: error: 'digitalPinToPCICR' was not declared in this scope
C:\Users\John\Documents\arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:398: error: 'digitalPinToPCICRbit' was not declared in this scope
C:\Users\John\Documents\arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:399: error: 'digitalPinToPCMSK' was not declared in this scope
C:\Users\John\Documents\arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:399: error: 'digitalPinToPCMSKbit' was not declared in this scope
C:\Users\John\Documents\arduino\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'void SoftwareSerial::end()':
C:\Users\John\Documents\arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:414: error: 'digitalPinToPCMSK' was not declared in this scope
C:\Users\John\Documents\arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:415: error: 'digitalPinToPCMSKbit' was not declared in this scope

Do you have an ATtiny25, ATtiny45, or ATtiny85 board selected?

Hi,

I have ATTiny84 selected.

A flash of light this morning suggested adding the following lines to cores\tiny\pins_arduino.h

// Pinched from https://raw.github.com/mharizanov/TinySensor/master/NewSoftSerial_Attiny84/NewSoftSerial.cpp
#elif defined(__AVR_ATtiny84__)
#define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 10) ? (&GIMSK) : ((uint8_t *)NULL))
#define digitalPinToPCICRbit(p) (((p) <= 2) ? 5 : 4)
#define digitalPinToPCMSK(p) (((p) <= 2) ? (&PCMSK1) : (((p) <= 10) ? (&PCMSK0) : ((uint8_t *)NULL)))
#define digitalPinToPCMSKbit(p) (((p) <= 2) ? (p) : (((p) - 10) * -1))

to reveal a new challenge:


c:/users/john/documents/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn84.o: In function `__vector_default':
(.vectors+0x2): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_1' defined in .text.__vector_1 section in core.a(WInterrupts.c.o)
c:/users/john/documents/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn84.o: In function `__vector_default':
(.vectors+0x16): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_11' defined in .text.__vector_11 section in core.a(wiring.c.o)
c:/users/john/documents/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn84.o:(.init9+0x0): relocation truncated to fit: R_AVR_13_PCREL against symbol `main' defined in .text.main section in core.a(main.cpp.o)
c:/users/john/documents/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn84.o:(.init9+0x2): relocation truncated to fit: R_AVR_13_PCREL against symbol `exit' defined in .fini9 section in c:/users/john/documents/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_exit.o)
TinyRF12_Demo.cpp.o: In function `saveConfig':
C:\Users\John\AppData\Local\Temp\build2326828889045529077.tmp/TinyRF12_Demo.cpp:93: relocation truncated to fit: R_AVR_13_PCREL against symbol `Print::println(char const*)' defined in .text._ZN5Print7printlnEPKc section in core.a(Print.cpp.o)
TinyRF12_Demo.cpp.o: In function `showString':
C:\Users\John\AppData\Local\Temp\build2326828889045529077.tmp/TinyRF12_Demo.cpp:117: relocation truncated to fit: R_AVR_13_PCREL against symbol `Print::print(char, int)' defined in .text._ZN5Print5printEci section in core.a(Print.cpp.o)
C:\Users\John\AppData\Local\Temp\build2326828889045529077.tmp/TinyRF12_Demo.cpp:118: relocation truncated to fit: R_AVR_13_PCREL against symbol `Print::print(char, int)' defined in .text._ZN5Print5printEci section in core.a(Print.cpp.o)
TinyRF12_Demo.cpp.o: In function `showHelp':
C:\Users\John\AppData\Local\Temp\build2326828889045529077.tmp/TinyRF12_Demo.cpp:124: relocation truncated to fit: R_AVR_13_PCREL against symbol `Print::println(char const*)' defined in .text._ZN5Print7printlnEPKc section in core.a(Print.cpp.o)
C:\Users\John\AppData\Local\Temp\build2326828889045529077.tmp/TinyRF12_Demo.cpp:143: relocation truncated to fit: R_AVR_13_PCREL against symbol `Print::print(int, int)' defined in .text._ZN5Print5printEii section in core.a(Print.cpp.o)
C:\Users\John\AppData\Local\Temp\build2326828889045529077.tmp/TinyRF12_Demo.cpp:144: relocation truncated to fit: R_AVR_13_PCREL against symbol `Print::print(char const*)' defined in .text._ZN5Print5printEPKc section in core.a(Print.cpp.o)
C:\Users\John\AppData\Local\Temp\build2326828889045529077.tmp/TinyRF12_Demo.cpp:145: additional relocation overflows omitted from the output

Wow, I was pointed at:

http://arduino.cc/forum/index.php?topic=91491.0

and now it compiles. Further testing of the actual image is ahead.

The Tiny Core now works with SoftwareSerial (the one included with Arduino 1.0). Sorry the update took so long.