I'm trying to set up a transmitter made by the following components :
- Attiny85 (I need 1MHZ speed)
- Cheap 433mhz transmitter (FS1000A)
The library I am using is the Manchester library GitHub. The attiny85 and the transmitter are powered with regulated 5V. I set up 1MHZ when burning the bootloader for the tiny.
I am successful at transmitting with 8 AND 16MHZ with my Attiny85, however, 1MHZ seems to malfunction. For 1MHZ on the tiny, this line need to be added in order to adjust timings :
man.workAround1MhzTinyCore();
Here is the complete code :
#include <Manchester.h>
/*
Manchester Transmitter example
In this example transmitter will send one 16 bit number
per transmission.
Try different speeds using these constants, your maximum
possible speed will depend on various factors like transmitter
type, distance, microcontroller speed, ...
MAN_300 0
MAN_600 1
MAN_1200 2
MAN_2400 3
MAN_4800 4
MAN_9600 5
MAN_19200 6
MAN_38400 7
*/
#define TX 2 //pin where your transmitter is connected
uint8_t transmit_data = 11;
void setup() {
man.workAround1MhzTinyCore();
//pinMode(RX, OUTPUT);
man.setupTransmit(TX, MAN_300);
pinMode(1, OUTPUT);
}
void loop() {
digitalWrite(1, HIGH);
man.transmit(transmit_data);
delay(100);
digitalWrite(1, LOW);
delay(200);
}
Someone else has/had this issue Can't transmit on @1MHZ attiny85, and i don't know if it has been fixed or not. I am unsure if the library is still updated, and if this issue isn't with the library itself.
Does anyone have any leads or fix for that issue ? That would greatly help, Thanks
delay()
does not work correctly (a value of 5000ms giving only 1s delay). Does this also happen for you? Please also testdelayMicroseconds()
since that is the function used in the Manchester librarydelay()
anddelayMicroseconds()