What is the status of serial on a tiny85

NewSoftwareSerial 10c from this post does not work?

Osgeld:
here is what I am getting with the "new" software serial included in 1.0 ...error: conflicting return type specified for ‘virtual size_t SoftwareSerial::write(uint8_t)’

Several folks are complaining about that problem. I'll try to get it knocked out this week. The problem is that the Tiny Core still includes Print.* from 0022. You may be able to drop in the two files from 1.0. Wait, that probably won't work.

it doesnt :slight_smile:

I used

http://hlt.media.mit.edu/?p=1695

and its quite crappy but I was able to get 2400 baud to work properly once tonight @8Mhz, maybe with a arduino tiny tuneup I can get it consistant, and maybe faster (though I am sending 3 whole bytes at a time speed isnt really an issue here)

Perfect! That is exactly what I needed to know. I've been trying to set aside some time to run that exact test. Thank you for posting!

I can now go back to mucking with the TIny Core.

maybe with a arduino tiny tuneup I can get it consistant, and maybe faster

If you want to test drive an experimental replacement let me know.

Please give this a try...
http://arduino-tiny.googlecode.com/files/arduino-tiny-0100-0014.zip

Only support for the ATtiny85 family was added. After a few folks have tested it, I will add support for the ATtiny84 family and the ATtiny2313 family.

If anyone reading this tests SoftwareSerial with the Tiny Core, please report back.

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