Multi-Input Frequency Measurement Tutorial

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

I decided to create a tutorial on various design strategies of reading multiple digital inputs (up to 16) and calculating each frequency.

Although intended to help students and those new to embedded processing, it can be used by anyone for the attached example projects and as a refresher.

I've attached a workspace with 8 projects each implementing different methods in different combinations.  Each project is an improvement on the previous one.

Here are the different methods used:

  • Polling
  • Interrupt Service Routines (ISRs)
  • Status Register Capture (SRs)
  • Direct Memory Access (DMA)
  • Multi-sample Averaging
  • Frequency Down-scaling

I've also attached a document describing each of the 8 projects with:

  • Theory of Operation
  • Design Tradeoffs
  • Design Improvements
  • Design Scalability.

The document includes Appendices about:

  • Measurement Accuracy
  • Jitter Factors
  • Measurement Range
  • Measurement Resolution

Requirements:

  • PSoC Creator 4.2

Target Hardware:

  • CY8CKIT-059.   However, little to no modifications need to be make to work on other PSoC5 platforms.  Many of the projects can be modified to run on other PSoC chips.

The example code is free to be used and modified for your own projects.

Enjoy!

Len

Len
"Engineering is an Art. The Art of Compromise."
4 Replies