Go Down

Topic: AtTiny85 SoftwareSerial and TinyDebugSerial Not working properly (Read 3785 times) previous topic - next topic

PavelK

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);
}

Coding Badly

Quote
Im not sure what I'm doing wrong.


Failing to describe the hardware comes to mind.


Erni

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


How do you make this connection? Which hardware ?

cjdelphi

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)


PavelK

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.

PavelK

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.

fungus

junk on the monitor usually means wrong baud rate

(which could also be wrong clock speed on the Tiny85)
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

PavelK


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.

Erni

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

PavelK


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.

Erni

Good to hear you got it working.

BTW this line is not needed:

Code: [Select]
#include <TinyDebugSerial.h>

The TinyDebugSerial  is part of the core

fungus


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.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

ricg

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

fungus


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.

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

Go Up