The ATTiny85 code fails to read input from a 433Mhz RF receiver when working at 1MHz. The following example compiles perfectly and runs OK wihen the ATTiny85 is working at 8MHz. However, it compiles but does not receive anything (the LED connected in pin 3 does not toggle) when working at 1MHz. Any advice to solve this problem?

#include <Manchester.h>
#define LED_PIN 3
uint8_t moo = 1;

#define TX_433_PIN 0
#define RX_433_PIN 1
#define BUFFER_SIZE 10
uint8_t buffer[BUFFER_SIZE];

void setup() {
  pinMode(LED_PIN, OUTPUT);
  digitalWrite(LED_PIN, moo);
  man.setup(TX_433_PIN, RX_433_PIN, MAN_1200);
  man.beginReceiveArray(BUFFER_SIZE, buffer);

void loop() {
  if (man.receiveComplete()) {
    // Toggle LED in pin 3 if something received
    moo = ++moo % 2; digitalWrite(LED_PIN, moo);
    man.beginReceiveArray(BUFFER_SIZE, buffer);

I am using this Manchester based library for the RF transmision. The ATTiny hardware description for Arduino IDE is provided by the Arduino-Tiny library. I am using the 1.0 Arduino IDE.

  • 1
    Have you tried it without the man.workAround1MhzTinyCore(); line? – Gerben Sep 24 '14 at 20:52
  • Ignore that last comment. That is only used for sending data, not receiving. – Gerben Sep 24 '14 at 20:59
  • 1
    You probably have to somehow instruct the compiler that F_CPU is to be set to 1MHz instead of 8MHz. That is a macro used during compilation to calculate things like baud rate settings and delays. This is the disadvantage for using an abstraction layer like Arduino to program varying hardware, you're just unaware of what is actually done under water. – jippie Sep 24 '14 at 21:37
  • Have you tried "#define LED_PIN A1" or "#define LED_PIN A2" or "#define LED_PIN A3" yet? If this were my project, I would put a LED on each and every output pin -- often what Arduino calls "pin 3" and what Atmel calls "pin 3" are not the same as each other, much less what I thought was pin 3. – David Cary Sep 25 '14 at 2:57
  • 1
    @jippie The F_CPU macro is correctly set to 1000000UL. As you say, the RF library is using that macro to set the attiny timer prescaler to the write value for 1MHz and 1200bps. #if F_CPU == 1000000UL TCCR1 = _BV(CTC1) | _BV(CS12); // 1/8 prescaler OCR1C = (64 >> speedFactor) - 1; and the compiler is processing this part of the code. – Enrique Comesaña Sep 25 '14 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.