2

I'm using the OneWire library to try and read temperatures from a MAX31888 sensor using this Arduino program:

#include <SoftwareSerial.h>
#include <OneWire.h>

#define RX PB4 #define TX PB3 #define OW PB0

SoftwareSerial serial(RX, TX); OneWire ds(OW);

void setup() { serial.begin(19200); delay(1000); serial.println("TX_INIT"); }

void loop() { byte addr[8]; if (!ds.search(addr)) { serial.println("No more addresses."); serial.println(); ds.reset_search(); delay(250); return; } serial.print("ROM ="); for (byte i = 0; i < 8; i++) { serial.write(' '); serial.print(addr[i], HEX); } delay(5E3); }

When I test this on an Arduino Nano, with hardware serial instead of software, I get the output I expect:

ROM = 54 36 25 5 0 0 0 3C
No more addresses.

But when I compile and burn the same program to an Attiny85, using the internal 8 MHz clock bootloader, all I get is:

No more addresses.

What could be the issue here? I've read DS18B20 sensors just fine with the 8 MHz internal clock bootloader before.

Software & library versions used:

Wiring diagram for ATTiny setup: ATTINY_WIRING

Diagram legend:

  • U1: USB
  • U2: ATTiny85
  • U3: MCP2221
  • J1: OneWire header

Please note that the VUSB pin of the MCP2221 outputs a regulated 3.3V.

Boyfinn
  • 245
  • 3
  • 11

0 Answers0