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

User avatar
By urbanze
#67544 See images of 26MHz crystal, and testing PWM with timer, i only made 71KHz and 83KHz, because 77.5KHz is ~13uS, i used 14uS and 12uS (frequency of this time is correct).

26MHz Crystal:


Frequencymeter: http://i.imgur.com/X3kGqDd.jpg
Oscilloscope (Time div = 0.05uS): http://i.imgur.com/KN0S6Ul.jpg

71KHz with OS_TIMER_US:

In math, frequence of 14uS is 71428Hz, using timer i get ~71420Hz

Frequencymeter: http://i.imgur.com/8ITRoZb.jpg

83KHz with OS_TIMER_US:

In math, frequence of 12uS is 83333Hz, using timer i get ~83390Hz

Frequencymeter : http://i.imgur.com/IA1OmKr.jpg
User avatar
By urbanze
#67545 12Mhz is probably to FTDI? I really don't know, but if you open ESP12, you see 26MHz

Dakota wrote:The crystal in my nodemcu says 12 Mhz :?
You are right, without measuring equipment I am lost :-) but it is just for fun and learning.
I'm learning a lot abour timers and interruptions with this proyect.
Well it is easy with a Arduino Uno or Attiny85, it will be fun that ESP8266 won't make it.

Thanks again for your comments, all of them are apreciated.

Get fun.

urbanze wrote:
schufti wrote:no, crystal frequency IS NOT 80MHz.
take a look and see: 26MHz

so what is the 80MHz? --> the cpu clock

how do you get 80MHz from 26MHz ??? not really a multiple --> PLL (cheap) so you will have phase jitter

What quality does the crystal have ??? probably low +/- --> ???ppm --> so the 80MHz will be ???

Temperature stability will be ???

As I wrote, your generated frequency needs to be within a window of several 10Hz +/- around the 77500Hz
stable for at least 2 minutes for the clock to detect one correct packet (usually they take several for security).

Don't get me wrong: I am not saying it is impossible. But without taking into account the real conditions and without necessary measuring equipment I doubt you will make it by just blindly coding along ...

Have fun ....


i have one frequencymeter and show 26MHz from pin special function, and 77kHz too.. let's see how ESP work.. i will post images later
User avatar
By schufti
#67551 ok, so you see that the deviation @71kHz is much lower than @83 kHz, which is not what is expected.

The scope can't show anything about accuracy of frequency but would show irregularities (glitches) caused by background tasks (e.g. wifi)


@Dakota:
Well it is easy with a Arduino Uno or Attiny85, it will be fun that ESP8266 won't make it.

Why? Each µC is built for a certain purpose. Is it same fun that AT don't do wifi?
But you are correct about learning, that is allways good.
BTW: I get lots of fun at my day job ....
User avatar
By Dakota
#67553 Well, the ESP8266 can generate and modulate a TV signal maybe a low frequency AM radio as well.
But you're right again, you can never presume anything. But you have to try.
If you have fun in your daily work, you are a lucky guy. :)
Regards, take care.

Pd. Can I see your code ? I can't generate any wave with OS_TIMER_US ? How do you get a sinus wave with OS_TIMER_US ?