Skip to content

calling CPPM.read at a high rate creates problems #1

@R-Ronald

Description

@R-Ronald

When I first used the library to build my CPPM switcher, I was getting very erratic results. The sync boolean and the channels values were invalid. During troubleshooting, I found that my program would work fine so long as I didn't perform my processing loop (and call CPPM.read) faster than every 40-50 ms (50 was perfect, 40 had a few errors per minute, lower numbers had tons of errors).

I removed the "no interrupts/interrupts" statements around the CPPM.read function. This resolved the problem (at the cost of making the mapping of the channel values non-atomic). After doing this, I changed my program to do the CPPM.read once per millisecond and all was good.

My supposition is that disabling interrupts for a high percentage of the time led to missing some of the timer reads.

I don't need a fix since the two values I want do not need to come from the same frame. But, I thought it would be good to share the issue to aid others who may encounter it.

Thanks for sharing the library. It was very helpful and I appreciate its elegant brevity/simplicity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions