Pages: 1 [2] 3   Go Down
Author Topic: What is the status of serial on a tiny85  (Read 8225 times)
0 Members and 1 Guest are viewing this topic.
Denmark
Offline Offline
Edison Member
*
Karma: 35
Posts: 1029
Happy Hobbyist
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

Code:

#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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)'
~~~~
Logged

Denmark
Offline Offline
Edison Member
*
Karma: 35
Posts: 1029
Happy Hobbyist
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Code:
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
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

With the version in Reply #14?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


@Erni: Thanks!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

With the version in Reply #14?

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

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

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

Do you think the issue is in this library?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

This file is part of the jeelib library: https://github.com/jcw/jeelib/
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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Please post the sketch you are trying to compile.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is the sketch.

* TinyRF12_Demo.pde (8.17 KB - downloaded 20 times.)
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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...

Quote
// 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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Pages: 1 [2] 3   Go Up
Jump to: