Denmark
Offline
God Member
Karma: 19
Posts: 674
|
 |
« Reply #15 on: July 10, 2012, 06:31:33 am » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #16 on: July 10, 2012, 10:42:09 am » |
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
God Member
Karma: 19
Posts: 674
|
 |
« Reply #17 on: July 10, 2012, 11:05:13 am » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 116
Posts: 10134
|
 |
« Reply #18 on: July 10, 2012, 12:59:18 pm » |
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
Shannon Member
Karma: 116
Posts: 10134
|
 |
« Reply #19 on: July 10, 2012, 01:00:28 pm » |
@Erni: Thanks!
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #20 on: July 10, 2012, 01:18:49 pm » |
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
Shannon Member
Karma: 116
Posts: 10134
|
 |
« Reply #21 on: July 10, 2012, 02:00:02 pm » |
Where did you get this file... C:\Users\John\Documents\arduino\libraries\jeelib/Ports.h
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #22 on: July 10, 2012, 02:10:24 pm » |
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
Shannon Member
Karma: 116
Posts: 10134
|
 |
« Reply #23 on: July 10, 2012, 11:55:43 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #24 on: July 11, 2012, 04:18:31 am » |
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
Shannon Member
Karma: 116
Posts: 10134
|
 |
« Reply #25 on: July 11, 2012, 03:34:39 pm » |
Please post the sketch you are trying to compile.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #26 on: July 11, 2012, 04:15:38 pm » |
Here is the sketch.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 116
Posts: 10134
|
 |
« Reply #27 on: July 12, 2012, 03:14:04 am » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #28 on: July 12, 2012, 07:33:18 am » |
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
Shannon Member
Karma: 116
Posts: 10134
|
 |
« Reply #29 on: July 12, 2012, 01:03:02 pm » |
Do you have an ATtiny25, ATtiny45, or ATtiny85 board selected?
|
|
|
|
|
Logged
|
|
|
|
|
|