Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By urbanze
#67501
Dakota wrote:Thank a lot for your answer. I make this piece of code , it seems to work in a ESP8266 (Lolin nodemcu v3)
It give a 77.5 khz signal ( a lot of noise at least in my radio receiver XDD , I have not any oscilloscope :? )
but my clock does not syncronize, it does not work :cry: :cry: :cry:

Antenna is pin D8
-----------------------------------------------------------
#define Antenna D8
unsigned long frec = 80000000L / 77500 ;
volatile unsigned long next;

boolean TickTock = false;

void inline radioISR(void){

TickTock = !TickTock;
digitalWrite(Antenna,TickTock);
timer0_write(ESP.getCycleCount()+frec);

}

void setup()
{

noInterrupts();
timer0_isr_init();
timer0_attachInterrupt(radioISR);
timer0_write(ESP.getCycleCount()+frec);
interrupts();

}
----------------------------------------------------------------


try to use OS_TIMER_US, i tested and works! find in google how to active OS_TIMER_US, because is default "disable".. if you can't do this, tell me. i help you!
User avatar
By schufti
#67510 with the wifi not disabled, there will be no stable frequency.
without knowing the accurate crystal frequency you will most likely be way off the correct frequency for the receiver to detect.
with only an unmodulated carrier, what do you expect the clock to do?
User avatar
By Dakota
#67526 Do you really think that I expec to to syncronize a radio clock with only this code ?
:D
Crystal freq is 80 Mhz , isn't ?

Thanks for your answer.



Code: Select allvoid modulate(byte b)
{
 
   if (b == 0)
   {
     digitalWrite(LedPin,LOW);

     delay(100);

     digitalWrite(LedPin,HIGH);
   }
   else
   {
     digitalWrite(LedPin,LOW);

     delay(200);

     digitalWrite(LedPin,HIGH);
   }
 
}



schufti wrote:with the wifi not disabled, there will be no stable frequency.
without knowing the accurate crystal frequency you will most likely be way off the correct frequency for the receiver to detect.
with only an unmodulated carrier, what do you expect the clock to do?
Last edited by Dakota on Sat Jun 24, 2017 12:18 pm, edited 1 time in total.
User avatar
By Dakota
#67527 Thanks a lot. Any help wil be great.
This is my code right know.

https://pastebin.com/Yi2UepfX

The original program is for arduino ... I just change it a bit :)


[/quote]

try to use OS_TIMER_US, i tested and works! find in google how to active OS_TIMER_US, because is default "disable".. if you can't do this, tell me. i help you![/quote]