Skip to content

When tone() is called with a specific pin, the frequency of the square wave that was previously output by tone() from another pin is not correctly maintained. #8

@MikiyaKobayashi

Description

@MikiyaKobayashi

■ Corresponding version
v.1.2.0 and Before v.1.2.0

■ API function affected by defect

  • tone()
    • tone() is a function that generates a square wave with a specified frequency.
    • The first argument is the pin, the second argument is the frequency, and the third argument is the time to maintain the output.

■ Contents and Occurrence conditions
The Arduino specification does not allow tone() to output from two or more pins simultaneously.
Due to hardware limitations, the RL78/G24 also does not support simultaneous output from multiple pins with tone().
When tone() is called on multiple pins at the same time, there was a problem that the output of the first tone() call did not stop.
Also, depending on the combination of pins, the frequency of the square wave of the tone() called first becomes incorrect.

The pin combination that causes the incorrect frequency of the square wave is shown below. (The numbers in parentheses are port numbers.)

  • 3(P17) and 5(P16)
  • 6(P15) and 9(P14)
  • 10(P13) and 11(P12) and 12(P11) and 13(P10)

■ Workaround
When a new call to tone() is made on another pin to output, the output of the pin in use should be stopped with noTone().

■ Permanent measures
In the next version, when tone() is called, it will be modified to stop output by the previously called tone().

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions