-->
Page 1 of 2

Timer interrupts from Arduino to ESP8266

PostPosted: Sat Jun 17, 2017 3:09 pm
by Dakota
I want to adapt a DCF77 radio transmiter in 77.5 khz from Arduino to ESP8266
it use timer registers but I can't find how to translate it from Arduino to ESP

https://github.com/CodingGhost/DCF77-Tr ... ocoll_.ino

Everything compiles ok except these functions ...


void setFrequency(int d)
{
//Frequency = 16000000/d

if(d<0)
d=-d;
if(d<2)
d=2;
TCCR1B&=0xfe; //-Stop generator
TCNT1=0; //-Clear timer
ICR1=d; // |
OCR1A=(d/2); //-+
TCCR1B|=0x01; //-Restart generator
}

void setupFrequencyGen()
{
TCCR1A=0b10000010; //-Set up frequency generator
TCCR1B=0b00011001; //-+
setFrequency(16); //-Start with 1MHz
pinMode(11,OUTPUT); //-Signal generator pin
}


Thanks a lot.

Re: Timer interrupts from Arduino to ESP8266

PostPosted: Sat Jun 24, 2017 9:18 pm
by urbanze
Hi dakota! These register's are from arduino! (i think). Don't work in esp. You see my post from HIGH FREQUENCY, there i paste an code using timer to generate pwm, see in page 9-11 of my post

Re: Timer interrupts from Arduino to ESP8266

PostPosted: Sat Jun 24, 2017 10:02 pm
by rudy
Those are hardware (processor) specific references. Not "Arduino". Arduino is just a framework for working with different hardware.

Re: Timer interrupts from Arduino UNO to ESP8266

PostPosted: Mon Jun 26, 2017 6:35 am
by Dakota
Ok, I mean "Arduino UNO" not Arduino

rudy wrote:Those are hardware (processor) specific references. Not "Arduino". Arduino is just a framework for working with different hardware.