Serial communication with the ATTiny85

arduinoattiny

I'm moving my project from the Uno to the smaller ATTiny85, and I'm having some problems. It builds and uploads just fine, but I think I've messed up the serial communication somewhere along the way.

What I have is a cheap RF link and a Dallas 18B20 temperature sensor. When I moved to the ATTiny the compiler stated it could not find SoftwareSerial.h, so I'm using TinyDebugSerial.h instead.

I connected the RF transmitter on the pysical pin 2 (or digital 3 / analog 3) but nothing happens. Anyone have a clue?

The code: http://pastebin.com/m0W1SNuY

The wireless transmitter: http://www.dx.com/p/433mhz-wireless-transmitter-module-superregeneration-for-arduino-green-149254#.VJqsZl4AQ

The temperature sensor: http://www.dx.com/p/ds18b20-temperature-measurement-module-blue-215793#.VJqsq14AQ

Best Answer

When you say "nothing happens" ... something's happening, just you don't know what it is. Hook your circuit up to a logic analyser or run it through an AVR simulator so you can find out what is happening.

Also regarding serial comms, you could look at (https://github.com/nickandrew/avr-fd-serial) which is a software serial interface I wrote specifically for the ATTiny85; it's timer-driven so your tiny can do other things while communicating bidirectionally at 9600 bits/second.

I also wrote (https://github.com/nickandrew/avr-onewire) which implements the 1-Wire protocol for the DS18B20 sensor ... put the two together and that's a lot of the code for your project.