ATTINY 85 SERIAL DATA

Thread Starter

AJIN NADH

Joined Dec 18, 2014
84
Hi,
I need to display the serial data avalable in attiny 85 to the terminal...How can i Please Help....
Ajin nadh
 

DickCappels

Joined Aug 21, 2008
10,153
Oh, that one; it has a USI but no real USART. I would bit-bang it myself, though there is an Atmel application note that describes contortions that one can go through to use the USI, maybe a little better than bit-banging as far as freeing up the cpu a little bit goes.

This thread on AVRFreaks is a good starting point.

http://www.avrfreaks.net/forum/implementing-software-uart-attiny85


This assembly language code includes a bit-banged serial output (4 MHz ATTINY2313)
http://www.cappels.org/dproj/wfcp/wfcaa.htm
 

Thread Starter

AJIN NADH

Joined Dec 18, 2014
84
Thank you sir,

I am a starter in attiny85 and my circuit is as follows
9AJg1Dh.png
and i used the following code

Code:
#include "SoftwareSerial.h"
const int LED = 0; // this is physical pin 8 for the LED
const int Rx = 3; // this is physical pin 6
const int Tx = 4; // this is physical pin 7
SoftwareSerial mySerial(Rx, Tx);
void setup()
{
pinMode(LED, OUTPUT); // tell Arduino LED is an output
mySerial.begin(19200);
digitalWrite(LED,LOW);
}
void loop()
{
mySerial.println("SANTHOSH");
delay(100);
digitalWrite(LED,HIGH);
delay(100);
mySerial.println("ajinnadh");
delay(100);
digitalWrite(LED,LOW);
}

but its not working....(boudrate of atmega 328 is also 19200).
i tested by changing the rx and tx


thanks ,
Ajin nadh

Moderators note: Please use code tags for pieces of code
 
Last edited by a moderator:

djsfantasi

Joined Apr 11, 2010
9,156
It looks like there's a problem on the Arduino UNO side, to start.

You are using the software serial library and define your TX/RX pins to be pins 3/4 on the Uno (I don't understand your comment about physical pins). Yet, you've wired your communications to the built-in USART on pins 0/1. So, you're sending data to pin 4 while the ATTiny is wired to pin 1.

There is no need to use the software serial library. Just use the built in communication functions for the TX0/RX0 pins.

You have a similar issue when defining the LED pin. You have a comment about pin 8, but define it as pin 0 (The Rx pin on the Uno).

Go back and review how to use pins on the Arduino Uno. Here is a reference to the pinmode command.
 

Thread Starter

AJIN NADH

Joined Dec 18, 2014
84
It looks like there's a problem on the Arduino UNO side, to start.

You are using the software serial library and define your TX/RX pins to be pins 3/4 on the Uno (I don't understand your comment about physical pins). Yet, you've wired your communications to the built-in USART on pins 0/1. So, you're sending data to pin 4 while the ATTiny is wired to pin 1.

There is no need to use the software serial library. Just use the built in communication functions for the TX0/RX0 pins.

You have a similar issue when defining the LED pin. You have a comment about pin 8, but define it as pin 0 (The Rx pin on the Uno).

Go back and review how to use pins on the Arduino Uno. Here is a reference to the pinmode command.

Hi sir,
I used the pin 3,4 th of attiny 85 as the software serial....which is connected to the arduino uno, and i found that the serial data is received but only getting the data when boud rate is 2400( at terminal),
But i programmed as the boud rate as 19200.... why is like this...?



Regards
ajin nadh
 

DickCappels

Joined Aug 21, 2008
10,153
What is the electrical layer in your connection to the terminal? (RS-232? In the case of RS-232 the data needs to be inverted and strictly speaking swing from above 2.5 volts to below -2.5 volts).
 
Top