Gas station without pumps

2015 August 25

PteroDAQ frequency channels on FRDM-KL25Z

Filed under: Circuits course,Data acquisition — gasstationwithoutpumps @ 23:53
Tags: , , , , ,

In PteroDAQ frequency channels I said

The next step for me is to implement frequency channels for the FRDM-KL25Z board (pretty much identical to the KL26 on the Teensy LC, except for having to use the MBED syntax for the register setting rather than the one Teensyduino uses) and the Teensy 3.1 board (the K20 DMA is much more complicated, so it will probably take me a while to figure out and set up—especially if it also has undocumented race conditions). Once I get those working, I’ll have to figure out how to do the GUI so that people can quickly figure out that which combinations of frequency channels are legal. I’ll probably want to do that with separators in a menu, greying out sections that already have frequency channels in use.

I got about half of that done today.  I started out with how to grey out the frequency channels that were inaccessible (because another pin on that port was being used)—but doing that lead me to needing to list all the current channels, which was done in several different places already and was rather awkward.  From there I decided to clean up and refactor a lot of the GUI code, which had gotten rather long and confusing.

So most of the day was spent on refactoring the GUI, breaking it up into classes and getting rid of global variables.  I think that the GUI code is more maintainable  now, but there are still a few things that feel like they are in the wrong place in the code, so some stuff may move around a little in future releases.

After the refactoring, greying out the unavailable frequency pins was pretty easy, and I’m reasonably happy with the user interface for pin selection now, though I think I need a new icon for frequency measurement.  I have a period of a sine wave for analog channels, and a period of a square wave for digital channels, but I don’t have as obvious an icon for frequency channels.  (I was considering just a big “Hz”, but that would not look compatible with the sine and square wave icons.)

Adding frequency channels for the FRDM KL25Z board did not take long—the biggest trouble was converting the KL26 code for the Teensy LC into MBED’s format for accessing registers.  Just about everything else is the same (except that the KL25 has only 2 ports that can control the DMA counters: A and D, rather than the 3 (A, C, and D) of the KL26. I have pushed the code for the frequency channels up to the PteroDAQ site on BitBucket.

I don’t know whether I’ll get the Teensy 3.1 code done tomorrow—I have to go into the office for office hours and for the banana slug genomics meeting, and I need to start working on my biobibliography and teaching/research statements for my merit review.  They are due early in September, and I’ve not started on them yet.

I hope to have the frequency channels working on the Teensy 3.1 by the end of the week, so that I can rewrite the chapter of my book on the hysteresis oscillator, to use the frequency channels, rather than a separate frequency detecting program as I used for the last couple of years.

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.