Using MicroPython on the PMK

by Steve Beckman N3SB


DOCUMENTATION

A Beginner's Guide to MicroPython on the Pi Pico

Installing MicroPython on the Pi Pico


SOFTWARE

MicroPython Keyer v0.1 program

 

Si5351 Test Program & Libraries

 

 

 

 

 

 

 

When Dave Benson K1SWL developed the PicoMite Memory Keyer (PMK) in 2023 using MMBasic as his language of choice, others began developing alternative programs and applications for that very flexible single-board platform. 

One such intrepid individual is Steve Beckman, N3SB, who wrote his own KEYER program ... using the MicroPython language!  Recall that the Raspberry Pi Pico chip is able to run a wide number of development languages. Besides the MMbasic and MicroPython mentioned, one can also write programs in C, C++, Arduino C++, Forth, AP/L, LiSP, and more!

So Steve gathered a small 'team' of interested hams in his area up in western Maryland and together they built up numerous PMK boards and began experimenting to see what they might be able to do with the project.

I'm chronicling N3SB's adventure here in the PMK web pages to illustrate the flexibility in programming and in use of the hardware so that others might get some ideas for their own projects.  For example, here in East TN our club is pursuing use of the PMK board (with a voice module add-on) as a repeater controller!  What ideas might you have?

George N2APB

PS:  I'm not duplicating much of the basic PMK background information and details.  Be sure to check back to the PMK home page for all this, including purchasing information.
 


The MicroPython Chronicles -- by Steve Beckman, N3SB

I recently received a surprise email from Steve N3SB who had developed his own keyer program for the Pico Memory Keyer (PMK).  Within minutes I had it loaded onto my PMK board and put it through its paces here on my own bench.  In a word, marvelous!  I urge you all to follow his simple instructions in the Readme.txt file (contained in the zip file downloadable below) which will have you put the uP.uf2 bootloader on your own Pico, or using a spare/fresh one you have laying around, and boot up that new environment in the same manner as we do for MMBasic.   (Hold down button while plugging in the USB cable.)  Then install the Thonny editor program, and load his program and ‘run’.

I was surprised at the elegance and simplicity of his keying logic, so far handling both Iambic Modes A and B. As Steve explains, this can be another excellent ‘MicroPython trainer’ for hams using the PMK as their development or learning platform … Way cool.  And way to go Steve!

Download the N3SB MicroPython Keyer v0.1 program

==============
I have a very simple keyer program for the PMK written in MicroPython that I would like to share. It might encourage some PMK experimenting. Our little dinner group has been busy building PMKs and learning MicroPython. We are finding the language to be great for experimenting / prototyping, and a version of MicroPython is available for the Pi Pico W which makes a web server extremely easy to set up. Just imagine controlling the PMK from a web browser on a smart phone...
 
MicroPython is faster than MMBasic, and there's lots of good books and YouTube videos to support learning the language.
 
Rich N3III has been making progress with controlling an SI5351 in MicroPython. He is trying to develop a Raduino replacement that includes a keyer, real-time clock, and other features, all built on the PMK.  Those libraries will come along next for use on the PMK Shield 1 containing the Si5351 board.

73, Steve, N3SB
===============

Oct 16, 2023

I can recommend the Raspberry Pi Pico W tutorial series by Paul McWhorter (toptechboy.com) on YouTube. He starts out at an absolute beginner level so that anyone can follow along and learn. Paul has created tutorials on several other microcontroller boards so he is an experienced educator.

MicroPython seems to be the perfect language for projects like keyers. There's no compile/download cycle like there is with Arduino, so experimenting is real easy. The PMK hardware makes it even easier.

73, Steve, N3SB 

===============

Oct 28, 2023

Here's an SI5351 MicroPython library and Test program that works with the Raspberry Pi Pico, and is compatible with the PMK. I've been developing on a breadboard, but it works fine on Pins 2 and 3, which the PMK uses for I2C.

The library works from 800 KHz to 90 MHz, and generates independent signals on outputs 0 and 1. Resolution is precise to 10 Hz across the entire range, and much of the range supports 1 Hz resolution. Provisions for calibrating for reference 25 MHz crystal inaccuracies are provided.

There are actually two libraries included - one supports the hardware I2C interface, and the other supports software based I2C. The hardware library uses I2C interface #1. The test program allows for selection of either library.

73; Steve, N3SB 

===============

Nov 10, 2023

The test program runs fine and calibrates well Steve.  The signal quality issue you suggest is just that it’s a square wave running at a very fast rate.  It doesn’t look like the classic “text book” waveform due to the capacitance of the scope probes and the frequency limitations.  Congrats to you and the 'team' on this!

Photo below:  Screen snapshot showing the uPython editor "Thonny" open on my Windows 11 desktop with three files 'open'ed and 'save'd the Pico.  Two are shown currently open in the Thonny editing window: the TEST_SI5351.py program and the SI5351.py library.  The Test program window has the 'focus' and all I needed to do was click on the green RUN arrow to run that program, which programs frequencies into the CLK0 and CLK1 registers, which can be viewed on a scope.

Shown below is the simple test platform with the Shield 1 sitting atop the PMK board and the green Si5351 Synthesizer board from QRP Labs sitting in its spot on the Shield.

Photo below shows the 3.57954 MHz waveform being generated on Clk0.  Again, this is a square wave signal coming directly from the Si5351 chip.  The signal appears 'distorted' from that of a pure square wave due to the frequency response limitations of the test bed, scope probes and the scope itself.