|
| 1 | + |
| 2 | +Why am doing this? Primarily because it's a fun challenge. I've been interested in Timecode for a while |
| 3 | +and the PIO blocks on the Pico make it very possible... |
| 4 | + |
| 5 | +# Now we're JAM'ing in the real world. |
| 6 | + |
| 7 | +We've moved past the Proof-of-concept stage! Well past.... |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +Mk-1 of the audio inteface is built, and I was able to Jam with the LTC from my Sync-IO, and feed |
| 12 | +the regenerated LTC to an Evertz 5300 LTC Analyzer. After Jam the LTC is spot on, but (as expected) |
| 13 | +'drifted off' as time went by. |
| 14 | + |
| 15 | +The project stalled in the summer, there was a scheduler bug in MicroPython which was causing |
| 16 | +occassional lock-ups, and I couldn't figure it out.... anyhow they're smarter than me and the |
| 17 | +`RPI_PICO-20240105-v1.22.1.uf2` release works fine. |
| 18 | + |
| 19 | +I've added some compensation for XTAL frequencies, the device can 'Sync after Jam' to learn the |
| 20 | +correction factor required to match RX/incoming LTC. It then remembers this as part of it's config. |
| 21 | + |
| 22 | +Not yet looked at using a more precise/temp compensated XTAL... |
| 23 | + |
| 24 | +[Demo Video](https://youtu.be/miWlGS6fJNI) |
| 25 | +[Demo2 Video](https://www.youtube.com/watch?v=WEdSII-7nx4) |
| 26 | + |
| 27 | + |
| 28 | +The script(s) now has a menu which can be used to control the device, and to navigate the settings. |
| 29 | +The incoming LTC is now validated before Jam is performed, and the RX monitor has indicator bar to |
| 30 | +show the relative timing between RX and TX. |
| 31 | + |
| 32 | +This code is in five files; upload all seven if you have the same hardware. |
| 33 | + |
| 34 | +`PicoOled13.py` is library of screen functions, `umenu.py` is menuing library, `neotimer.py` is timer |
| 35 | +library, `pid.py` is a PID controller and `config.py` holds the settings for the unit. |
| 36 | + |
| 37 | +`pico_timecode.py` and `main.py` combine to make the GUI app. |
| 38 | + |
| 39 | +The first 5 are from other projects, which I use permissively under their own licenses: |
| 40 | + |
| 41 | +- https://github.com/samveen/pico-oled-1.3-driver (*) |
| 42 | +- https://github.com/plugowski/umenu |
| 43 | +- https://github.com/jrullan/micropython_neotimer |
| 44 | +- https://github.com/m-lundberg/simple-pid |
| 45 | +- https://github.com/aleppax/upyftsconf |
| 46 | + |
| 47 | +(*) actually using my port, as some changes are not yet accepted upstream |
| 48 | + |
| 49 | +I created a sub-directory for the 'libs' to clarify that they are not really part of this project. |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | +The `pico_timecode.py` script is also self contained for use without a display, ie can be used on |
| 54 | +its own on a 'bare' Pico board. |
| 55 | + |
| 56 | +In the following screen shot the top trace is the 'raw' bitstream, and the lower is the encoded |
| 57 | +LTC stream. We will need some interfacing hardware before the TTL level can be fed nicely into other |
| 58 | +hardware. |
| 59 | + |
| 60 | +# Build Your Own |
| 61 | + |
| 62 | +My intent is that the project could be used to build your own devices. The proof-of-concept script(s) can |
| 63 | +just be dropped onto a 'bare-bones' Pico. |
| 64 | + |
| 65 | +There's some DIY suggestions [here](docs/DIY.md) |
| 66 | + |
| 67 | +If you do use my code for a personal project, drop me an email/picture. |
| 68 | +If you make a device to sell, please send me an sample to test. |
| 69 | + |
| 70 | +# How it works |
| 71 | + |
| 72 | +It's fair to say that this task should be far above a $3 MCU. |
| 73 | + |
| 74 | +All of the LTC decoding is done in the PIO blocks, each has it's own task. Communincation |
| 75 | +between the PIO is via their in/out pins, and with interrupts. |
| 76 | + |
| 77 | +The `pico_timecode.py` script just needs to monitor the FIFOs, to keep them feed or emptied. |
| 78 | + |
| 79 | +The `main.py` forms the user interface/application, and controls the OLED screen |
| 80 | + |
| 81 | +There's an indepth description on the workings [here](docs/PIO.md) |
| 82 | + |
| 83 | +## So how good is it? |
| 84 | + |
| 85 | +*Time will still tell...* |
| 86 | + |
| 87 | +Given my interest (nee obsession) with TimeCode, I have already aquired some specialised test equipment. I |
| 88 | +will measure the accuracy of the Pico modules and post results soon. |
| 89 | + |
| 90 | +On the above 'first jam' video the two units started well in sync, but after ~20hrs it was clear that the |
| 91 | +LEDs had drifted appart - by around 4 frames. This is still pretty good for a 'crappy' crystal. I will |
| 92 | +need to do some investigations as to whether this is coding error, or attributed to some other (fixable) |
| 93 | +issue. Otherwise we'll have to look at compensating somehow, or replacing the crystal with a better one. |
| 94 | + |
| 95 | +My approach will be to get the code to a point where it will 'Jam' to incoming LTC and then 'free-run' it's |
| 96 | +output LTC. Using my test equipment I can monitor the LTC value from my source, as well as from the |
| 97 | +'Pico-Timecode' device. |
| 98 | + |
| 99 | +For more details see [testing](docs/testing.md) |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | +Evertz #2 will also tell me the phase difference between the VITC (embedded in Video) and the LTC. |
| 104 | + |
| 105 | + |
0 commit comments