[Swlug] Further interesting calculations

Rhys Sage rhys_sage at yahoo.com
Sat Jun 10 13:14:08 UTC 2023


I ordered a DIY frequency counter kit from eBay and put that together. It has a few issues such as the on-off switch not actually doing anything and the power socket is a bit dodgy. Nothing wrong with my soldering though nor with the way I put the components on.

Anyway, I ran a Python program on the Pi Pico to test the timing and came up with

import time
from machine import Pin
led=Pin(13,Pin.OUT)        #create LED object from pin13,Set Pin13 to output
while True:
  led.value(1)            #Set led turn on
 # time.sleep(0.000001)
  led.value(0)            #Set led turn off
 # time.sleep(0.000001)

Using my frequency counter:

With the sleeps in use rather than commented out, I got a figure of 33907.22hz.
With the sleeps commented out I got a figure of 74770.20hz
Interestingly sleep seems to minimise out at .0001 second. No matter how much below .0001 seconds I go, they get no shorter.

This is quite interesting. I do wonder whether the 2N2222A transistor I had to put on the output pin might have slowed things down a little. The signal from the Pi pins was not enough to trigger the counter.

I'll probably do a video on this in a while. At the moment it's looking that the Pi just isn't fast enough to control a microflash other than perhaps being a microflash trigger. On the other hand I did discover I can get really fast times out of a 555 chip so the solution might be partially hardware.

Rhys Sage



More information about the Swlug mailing list