# Frequency generate

**URL:** <https://forum.xod.io/t/frequency-generate/6829>\
**Category:** Uncategorized\
**Created:** [March 26, 2024, 5:32pm UTC](https://forum.xod.io/t/frequency-generate/6829 "2024-03-26T17:32:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nazarijtipusak080](https://avatars.discourse-cdn.com/v4/letter/n/7c8e57/32.png) [@nazarijtipusak080](https://forum.xod.io/u/nazarijtipusak080)\
**Post date:** [March 26, 2024, 5:32pm UTC](https://forum.xod.io/t/frequency-generate/6829/1 "2024-03-26T17:32:57Z")

</div>

I am looking for a node to generate an 80kHz signal (rectangular). “clock” (via flip-flop) and “waves” give a maximum of 500Hz (checked on an oscilloscope). The “tone” node gives a maximum of about 50 kHz. Are there other options?

---

<div class="post-metadata">

**Author:** ![zsound1973](https://avatars.discourse-cdn.com/v4/letter/z/d78d45/32.png) [@zsound1973](https://forum.xod.io/u/zsound1973)\
**Post date:** [March 28, 2024, 11:49am UTC](https://forum.xod.io/t/frequency-generate/6829/2 "2024-03-28T11:49:00Z")

</div>

Use the square wave node for the rectangular signal.

[https://xod.io/libs/xod/waves/](https://xod.io/libs/xod/waves/)

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [March 28, 2024, 3:47pm UTC](https://forum.xod.io/t/frequency-generate/6829/3 "2024-03-28T15:47:48Z")

</div>

You may need to use interrupts, or perhaps even additional hardware to get such a high frequency. Arduino boards have hard limits on how quickly they can process data. The Micro, UNO, and Mega boards run at 16Mhz. Other models can have faster AVR chips allowing them to process higher frequencies (like the Due which runs at 84Mhz)

> **[How Fast is an Arduino: Guide to Arduino Speeds | Chip Wired](https://chipwired.com/arduino-speed-guide/)**
>
> When choosing an Arduino board, I've often found people are concerned about the speed of the processor. In my experience I've found that faster boards…

---

<div class="post-metadata">

**Author:** ![wayland](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/wayland/32/1590_2.png) [@wayland](https://forum.xod.io/u/wayland)\
**Post date:** [April 2, 2024, 6:49pm UTC](https://forum.xod.io/t/frequency-generate/6829/4 "2024-04-02T18:49:23Z")

</div>

I’ve created a node that will generate rectangular waveforms up to 1MHz:  
[https://xod.io/libs/wayland/rectangular-waveform/](https://xod.io/libs/wayland/rectangular-waveform/)

However, as the period of the waveform is specified in microseconds, it will not give you a frequency of exactly 80kHz. You’ll get quite close with a period or 12 or 13 microseconds:  
1,000,000 / 12 = 83.3kHz  
1,000,000 / 13 = 76.9kHz

 ![Screenshot from 2024-04-02 19-01-57](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/c/cf35858892b5f36230d1b1ca608d6b7e193f4284.png)

 ![IMG_20240402_190139](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/2/2d4c598c0d819df67c87f5bff0dfe20ffbdb5c66.jpeg)

This node uses Paul Stoffregen’s TimerOne library ([https://github.com/PaulStoffregen/TimerOne](https://github.com/PaulStoffregen/TimerOne)). For a list of supported boards see [https://www.pjrc.com/teensy/td\_libs\_TimerOne.html](https://www.pjrc.com/teensy/td_libs_TimerOne.html).

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/eb7348baa04192c2ef932d1db54d44f09f8a7888.png) [@system](https://forum.xod.io/u/system)\
**Post date:** [May 2, 2024, 6:49pm UTC](https://forum.xod.io/t/frequency-generate/6829/5 "2024-05-02T18:49:39Z")

</div>

Closed on May 2, 2024, 6:49pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
