Pages: [1] 2   Go Down
Author Topic: AtTiny85 SoftwareSerial and TinyDebugSerial Not working properly  (Read 2973 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've been trying to get either library to work with the AtTiny85 and had no luck. Everything uploads just fine and the attiny works but when I hook up to a serial monitor I just get gibberish. I tried every possible thing I could already. I burnt the bootloader with trying both 8mhz and 1mhz to change clock, tried changing the baud rate, tried different AtTiny85. Nothing seems to work. I just keep getting junk. Im using my mac book mostly but tried on my latitude and same problem.

AtTiny works just fine otherwise.

Im not sure what I'm doing wrong. Any help appreciated.

Pin 3(Literal pin2) of attiny goes to Rx of my serial monitor.
My example code:
#include <TinyDebugSerial.h>
void setup()
{               
Serial.begin(9600);
}
void loop()
{
 Serial.println("Why isn't this crap working?!");
 delay(100);
}
Logged

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

Quote
Im not sure what I'm doing wrong.

Failing to describe the hardware comes to mind.
Logged

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

Arduino UNO R3 as ISP. AtTiny85.
Logged

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

Quote
Pin 3(Literal pin2) of attiny goes to Rx of my serial monitor

How do you make this connection? Which hardware ?
Logged

Offline Offline
Edison Member
*
Karma: 29
Posts: 2352
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First thing, make sure you burnt the 8mhz bootloader... or you're not going to get anything happening.

Secondly, I'd switch to SoftSerial, which is native and comes with Arduino's IDE (I know, I use SoftSerial myself on Attiny85's no problem, but you have to burn the bootlader of 8mhz)

Logged

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

I did burn 8mhz boot loader. That's what I was saying in the original post. Tried it a few times. I have a pin on AtTiny connected to the Rx pin on arduino UNO(with capacitor over reset and gnd). I also have a USB to serial adapter that I tried and I get the same trash with it. I tried changing baud rate around too. Every combination I could.
Logged

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

Also I tried Software serial too and I get the same stuff. It seems to be working but I get junk on the monitor. I feel like I'm doing something wrong on the software side.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 143
Posts: 5309
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

junk on the monitor usually means wrong baud rate

(which could also be wrong clock speed on the Tiny85)
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

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

junk on the monitor usually means wrong baud rate

(which could also be wrong clock speed on the Tiny85)


Thats what I figured but I tried different baud rates. I even tried different baud rates on the monitor then in the program. I still get junk, just different characters.

I don't see why the clock speed wouldn't be right at 8mhz. I selected AtTiny85 8mhz from the cores and then burnt the boot loader(obviously doesn't burn anything, but should change the clock speed to 8mhz).

Also I checked with my oscilloscope a blinking led set at 1 sec. Its shows perfectly one second on the oscilloscope.
Logged

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

Quote
I have a pin on AtTiny connected to the Rx pin on arduino UNO

And the ground pins ?

Quote
with capacitor over reset and gnd

No it should be either
1. A jumper wire between reset and ground (and a small resistorr on the tx/rx lines for safety)
or
2. remove the processor from your UNO board
Logged

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

Quote
I have a pin on AtTiny connected to the Rx pin on arduino UNO

And the ground pins ?

Quote
with capacitor over reset and gnd

No it should be either
1. A jumper wire between reset and ground (and a small resistorr on the tx/rx lines for safety)
or
2. remove the processor from your UNO board


Got it working. Thanks! Can't believe it was just a wire instead of a capacitor.
Logged

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

Good to hear you got it working.

BTW this line is not needed:

Code:
#include <TinyDebugSerial.h>

The TinyDebugSerial  is part of the core
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 143
Posts: 5309
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a pin on AtTiny connected to the Rx pin on arduino UNO(with capacitor over reset and gnd).

'A' pin... or the pin?

Having another chip connected to the serial line might cause interference, yes.
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

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

Has anyone accomplished powering an attiny85 using softwareSerial with a battery?
I don't get output when i use a battery. Yet, serial output works fine when powered from an arduino connected to USB (500mA).
The Circuit: 9volt battery regulated by a 7805 to 5v, attiny85 decoupled with a .1uF ceramic.
I thought maybe the battery didn't supply enough amps so i tried dropping a 9volt power supply (650mA) in its place, but no luck there either.
I realize this is not an arduino problem so much as a power supply problem, but thought maybe someone out there must have something like this working.  I'm a total beginner when it comes to electronics.. thanks for any help.  Ric
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 143
Posts: 5309
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I realize this is not an arduino problem so much as a power supply problem, but thought maybe someone out there must have something like this working.  I'm a total beginner when it comes to electronics.. thanks for any help.  Ric

No, it's an AVR chip problem. The internal clock varies with voltage. A different power supply will run the chip at a different clock speed. To fix it you need an external crystal.

Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Pages: [1] 2   Go Up
Jump to: