961 ASCII to Morse Code Converter

961 : ASCII to Morse Code Converter

Design render

How it works

A hardware ASCII-to-Morse converter. The host places a 7-bit ASCII code on ui[6:0] and strobes load (ui[7]); the chip looks the character up in an on-chip ROM and serializes the ITU-R M.1677-1 element sequence on the key line (uo[0]) at a selectable, human-perceptible speed. The chip owns all Morse timing; the host only feeds bytes and respects the ready flag, so a simple polling loop in MicroPython can stream arbitrary-length text without dropping characters.

The Morse stream is presented three ways simultaneously:

  1. Key line (uo[0]): raw on/off keying for a scope, LED, or relay.
  2. Audio (uo[7]): the key line gated with a square-wave sidetone, encoded as 5-bit PWM at f_clk/32 (~312 kHz at 10 MHz) for the TT Audio Pmod. Silence is 50% duty, so the Pmod's filter output rests at mid-rail; keying is aligned to tone zero crossings to suppress clicks.
  3. Visual: uo[7:0] is also the demoboard's 7-segment bus, so the status bits light segments in sync with the transmitted code (segment a flashes with key). Setting display_en = 0 blanks the fast-toggling diagnostic segments (element, tick); key, the handshake lines and the audio are unaffected so the host protocol keeps working.

Character set: letters A-Z (lowercase folded to uppercase), digits 0-9, and the punctuation . , ? ' ! / ( ) & : ; = + - _ " @. An ASCII space emits a word gap. Anything else asserts invalid, produces no key-down, and is discarded; ready returns after one dit-time and invalid clears on the next successful load. ($ is excluded: its seven-element pattern does not fit the 6-bit ROM field.)

Timing (all durations are multiples of the dit-time T; PARIS is exactly 50 T):

Interval Duration Key state
Dit 1 T down
Dah 3 T down
Intra-character gap 1 T up
Inter-character gap 3 T up
Word gap (space) 7 T up

Gaps are non-overlapping: the inter-character gap replaces the final intra-character gap, and a word gap replaces the inter-character gap (a space between letters gives exactly 7 T, not 10 T).

Speed selection (wpm_sel, dit-time = 2^N clocks; values at 10 MHz):

wpm_sel Divider Dit-time Approx. WPM
000 2^21 ~210 ms ~5.7 (default)
001 2^20 ~105 ms ~11.4
010 2^19 ~52 ms ~23
011 2^18 ~26 ms ~46
100 2^16 ~6.6 ms ~183
101 2^12 ~0.41 ms scope work
110 2^8 ~26 µs hardware test
111 2^4 1.6 µs simulation turbo

Timing is strictly clock-proportional. Speed and configuration changes take effect only at character boundaries, so a mid-character change cannot produce a malformed element.

Handshake: on a rising edge of load with ready high the character is captured and ready falls. ready rises again during the trailing 3 T inter-character gap, giving the host a full 3 T window to supply the next character, so a continuous stream has no inserted pauses. A load edge while ready is low is ignored. char_done pulses for one dit-time when a character (including its gap) completes. load is two-flop synchronized; pulses shorter than two clock periods are not guaranteed to register.

With auto_repeat = 1 the last character is re-sent indefinitely with correct 3 T gaps until load is strobed again or the design is reset.

How to test

The design is meant to be driven from the demoboard's RP2350 running MicroPython with the ttboard SDK (mode = ASIC_RP_CONTROL, since the RP2 drives the project inputs and the configuration byte on uio). A suitable config.ini section:

[tt_um_morse_converter]
mode = ASIC_RP_CONTROL
clock_frequency = 10e6
uio_oe_pico = 0b11111111   ; RP2 drives all config pins
uio_in = 0b00001000        ; wpm_sel=000 (slowest), audio_en=1, tone=600Hz
ui_in = 0

Copy test/morse_demo.py to the demoboard and run the canonical bring-up check:

import morse_demo
morse_demo.demo()   # sends "HELLO WORLD" at ~5.7 WPM

or drive it by hand:

from ttboard.demoboard import DemoBoard
from morse_demo import MorseSender

tt = DemoBoard.get()
tt.shuttle.tt_um_morse_converter.enable()
tt.clock_project_PWM(10e6)
tt.uio_oe_pico.value = 0xFF

sender = MorseSender(tt)
sender.configure(wpm_sel=0, audio=True, tone=0)
sender.send("CQ CQ CQ DE TT")

Confirm the code is audible on the Audio Pmod and visible as pulses on uo[0] (segment a of the 7-segment display). Verify by ear against a Morse reference, or capture uo[0] on a scope and measure the dit-time against the speed table above.

The cocotb testbench (test/test.py) covers the reset state, every element class, gap and PARIS timing, case folding, the handshake back-pressure rules, streaming, speed scaling, audio gating, reset during transmission, and auto-repeat. It interacts with the design only through the pins, so it is portable to microcotb for hardware-in-the-loop runs.

External hardware

  • TT Audio Pmod on the output Pmod header; it takes the PWM sidetone on uo[7] and drives a piezo or headphone jack.
  • Fallback without the Pmod: an LED (demoboard 7-segment already works) on uo[0], or a piezo buzzer on uo[0] through a series resistor: a click-per-element rather than a tone, but the rhythm is fully audible.

Pinout

Pin Dir Name Description
ui[6:0] in char_in 7-bit ASCII code, sampled on the rising edge of load
ui[7] in load Load strobe, edge-detected, accepted when ready is high
uo[0] out key Morse key line: high = mark
uo[1] out ready High when a new character may be loaded
uo[2] out busy High while serializing, including the trailing gap
uo[3] out element High during a dah, low during a dit (valid while key is high)
uo[4] out char_done One dit-time pulse at the end of each character
uo[5] out invalid Latched for characters with no Morse encoding
uo[6] out tick One-clock pulse at each dit boundary
uo[7] out audio_pwm PWM sidetone for the TT Audio Pmod
uio[2:0] in wpm_sel Speed select (see table)
uio[3] in audio_en 1 = sidetone enabled
uio[5:4] in tone_sel Sidetone pitch: 600 / 800 / 1000 / 440 Hz
uio[6] in display_en 0 = blank the element and tick segments
uio[7] in auto_repeat 1 = re-send the last character indefinitely

The design never drives the bidirectional pins (uio_oe = 0).

IO

#InputOutputBidirectional
0char_in[0]keywpm_sel[0]
1char_in[1]readywpm_sel[1]
2char_in[2]busywpm_sel[2]
3char_in[3]elementaudio_en
4char_in[4]char_donetone_sel[0]
5char_in[5]invalidtone_sel[1]
6char_in[6]tickdisplay_en
7loadaudio_pwmauto_repeat

Chip location

Controller Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Analog Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Analog Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux tt_um_chip_rom (Chip ROM) tt_um_factory_test (Tiny Tapeout Factory Test) tt_um_teuscher_eml_fabric (EML Fabric — analog exp/ln compute cells) tt_um_wokwi_465656663515438081 (Convert binary to hex on 7 segments) tt_um_nikita_face_detect (FPGA Face Detection) tt_um_obstacle_avoider (Obstacle Avoider State Machine) tt_um_poket_animal (Poket Animal) tt_um_drewbabel_uart (Configurable FIFO-buffered UART with APB CSR) tt_um_wokwi_469163916296039425 (TT Workshop Test) tt_um_jonahsaunders_slsvga (tt_um_jonahsaunders_slsvga) tt_um_fatigue_monitor (Fatigue Monitor (PPG Pulse-Interval Variability)) tt_um_vedam_dual_port_ram (Dual Port RAM) tt_um_wokwi_469739097665887233 (Tiny Tapeout Template Copy) tt_um_spdif_to_i2s_kilpelaj (S/PDIF to I2S receiver) tt_um_morse_converter (ASCII to Morse Code Converter) tt_um_wokwi_469806914724000769 (Spin, Text and VGA) tt_um_wokwi_469701770572338177 (TinyTapeout) tt_um_garnetkoebel_communotron (Communotron) tt_um_wokwi_469449970323169281 (full adder) tt_um_duzabf_2026_ow (A WIP Online Workshop 2026 project) tt_um_wokwi_469807513638180865 (Tiny Tapeout NAK) tt_um_ttsky26c_oguz (ttsky26c-202607-mehmetoguzderin by Oguz) tt_um_kashif_fp4_sparse_tpu (FP4 Sparse Mini-TPU) tt_um_moein_maleki_arm16 (arm16) tt_um_wokwi_469453454643027969 (ON Check System) tt_um_felixcheng_neural_core (Neural Compute Core (V0.15)) tt_um_wokwi_469788774011248641 (Spin Display - select-reset-reverse) tt_um_wokwi_469449443070765057 (Samuel's first chip) tt_um_wokwi_469449007236383745 (testinttrsv01) tt_um_vga_ca (VGA cellular Automaton) tt_um_dosci_500hz (Digital Oscillator 500 Hz) tt_um_wokwi_469747443569078273 (XOR test project - Tiny Tapeout workshop) tt_um_wokwi_469585758593419265 (spinner) tt_um_fp16_mac (FP32 Math Unit) tt_um_1DC_vga_dyoa (VGA Design Your Own ASIC) tt_um_haydenevans_top (Systolic Processing Element) tt_um_wokwi_469806252715961345 (TT_Proj_SA) tt_um_wokwi_469448996577604609 (Tiny Tapeout - Reto) tt_um_ehofmannbr_pmodvga_06 (VGA Color Tiles) tt_um_lfglabs_lsc1u (leanSilicon LSC-1 Micro arithmetic kernel) tt_um_wokwi_469804280240495617 (Zetterling SRAM) tt_um_wokwi_469806066852696065 (TileTestchase) tt_um_wokwi_469449118072978433 (binary_add_v1) tt_um_voltage_amplifier_neuron (Voltage Amplfier Neuron) tt_um_wokwi_469449686545956865 (Tiny Tapeout Template Copy_JinoShiono) tt_um_wokwi_469448887171240961 (Tiny Tapeout - Mini CORDIC) tt_um_wokwi_469809033878555649 (Tiny Tapeout Yummy Chip - bgianfo) tt_um_sirajmuhammad_bpsk_mod (BPSK Baseband Modulator) tt_um_K_coder_9 (TENs device frequency controller) tt_um_wokwi_469758119198926849 (LL_6BitShiftRegister_ToggleEnabledFeedback) tt_um_Asaadkhex_6x6u (6x6 UART Bussbar Switch) tt_um_wokwi_469809198944364545 (tt8-8bit-cpu Copy) tt_um_wokwi_469710279607305217 (Tiny Tapeout Submission KL - SiliDize) tt_um_wokwi_469629799092815873 (2:1 Mux with differential outputs) tt_um_poundbrad_reciprocal_counter (Two-Channel Reciprocal Counter) tt_um_joonatanalanampa_cordic (CORDIC-1) tt_um_x4ntha_nova (Data General Nova 1200 CPU) tt_um_quick_bus (quick_bus) tt_um_wokwi_470058539448408065 (Nigel's Tiny Tapeout Project) tt_um_wokwi_470058244557293569 (Tiny Tapeout Kabisan) tt_um_wokwi_470058241869790209 (Abdi's desgin) tt_um_wokwi_470060107756808193 (Sukhraj Deol's Chip) tt_um_wokwi_470058578588614657 (The Chip of Master George Stead) tt_um_wokwi_470069286344622081 (Tiny Tapeout ISHA) tt_um_ucl_display (Flashing... lights) tt_um_wokwi_470058746279043073 (Arihant's first Wokwi design) tt_um_wokwi_470060103260512257 (Tiny Tapeout Jabriel Copy) tt_um_wokwi_470069460157662209 (haadi's tiny tapeout) tt_um_wokwi_470058418706939905 (Kitty) tt_um_wokwi_470058490118136833 (Iris) tt_um_wokwi_470060098828179457 (Temz_ tiny tapeout) tt_um_wokwi_470058023187099649 (Osman WOKWI project 1) tt_um_wokwi_470057988621827073 (Viraj Tiny Template Full Adder TEST) tt_um_wokwi_470069802034377729 (Tiny Tapeout Template Copy) tt_um_wokwi_470070136685362177 (full adder) tt_um_wokwi_470070449402211329 (Anastasia Copy (2)) tt_um_wokwi_470059864883484673 (Keyaan’s first Wokwi design) tt_um_wokwi_470071200164912129 (full adder tiny tapeout Copy) tt_um_wokwi_470060671178857473 (SBUSixth First Chip Design Mentored by Tiny Tapeout) tt_um_wokwi_470099562753182721 (Isaac Tiny Tapeout) tt_um_wokwi_470120538476737537 (efwz8voices) tt_um_lelo_gr01_analogicus (LELO-GR01) tt_um_lelo_gr04_analogicus (LELO-GR04) tt_um_lelo_gr02_analogicus (LELO-GR02) tt_um_pump_out (60 Hz RMS Pump-Out Controller) tt_um_urish_simon (Simon Says memory game) tt_um_lelo_gr03_analogicus (LELO-GR03) tt_um_wokwi_470299374901578753 (Shrimp) tt_um_vga_clock (VGA clock) tt_um_frequency_counter (Frequency counter) tt_um_z2a_rgb_mixer (RGB Mixer demo) tt_um_mattvenn_r2r_dac_3v3 (Analog 8 bit 3.3v R2R DAC) tt_um_rebeccargb_universal_decoder (Universal Binary to Segment Decoder) tt_um_rebeccargb_hardware_utf8 (Hardware UTF Encoder/Decoder) tt_um_rebeccargb_intercal_alu (INTERCAL ALU) tt_um_rebeccargb_vga_pride (VGA Pride) tt_um_ogggggish_ota_ldo (SSF Capless LDO) tt_um_hariri4534_audioplayback (audioplayback) tt_um_wokwi_470637150792846337 (Joni - Tiny Tapeout Teardown2026 Workshop) tt_um_wokwi_470635013242210305 (Tom's first Wokwi design) tt_um_wokwi_470635780983408641 (Tiny Tapeout-AyeshaTeardown26) tt_um_wokwi_470639152626282497 (KeKoaM Tiny Tapeout) tt_um_wokwi_470637073520124929 (Tiny Tapeout workshop) tt_um_toby43479_iox (IO Expander with PWM) tt_um_wokwi_470635764113915905 (Divider Demo) tt_um_wokwi_470635580461052929 (Mann-teardown-project) tt_um_wokwi_470639672984256513 (KCs 001 TinyTapeout Design) tt_um_wokwi_470635507665754113 (Tiny Tapeout Template Copy) tt_um_wokwi_470637047364443137 (Pixel-Curio-Chip) tt_um_terihear_tinytearout (TinyTearout) tt_um_wokwi_470643025042834433 (TT 2026) tt_um_wokwi_470637360757626881 (Tiny Tapeout Template Copy) tt_um_wokwi_470635627278929921 (Tiny Tapeout Workshop) tt_um_wokwi_474471160110403585 (Cylon-Scanner) tt_um_wokwi_470646659230201857 (bloopbloop) tt_um_pthomas_sigma_delta (Continuous-Time Sigma-Delta ADC (1st order)) tt_um_sky_tpu_3x3 (Sky TPU 3x3) tt_um_tpcannon7_fir (tinyfir) tt_um_bruniliomuy_top (Fir_Filter) tt_um_semiqa_diff_opamp (Diff-In-Diff-Out-OpAmp) tt_um_TinyProcessor_naiyar_ (TinyProcessor) tt_um_CCDmos3D (ADC for CCDmos3D pixel) tt_um_snn_lif_neuron (snn_lif_neurons) tt_um_galaguna_NanoSys_fit (Nano-120_CPU@ler.uam.mx) tt_um_rowles_regime (Single-Bit Macro Regime Classifier) tt_um_rowles_fedmodel (The Fed Model (F1/F2)) tt_um_sky26c (tt_sky26c) tt_um_aka_regfile_ecc (regfile_ecc) tt_um_fwilson12_mac (int8 MAC) tt_um_davidbroughsmyth_ecg_sar12 (heart_monitor_adc_art) tt_um_foxworks_picorv32 (TCD Foxworks PicoRV32) tt_um_saltworks_ndf_c32 (Neural dataflow fabric — bit-serial MAC cells on a self-routing switch) tt_um_yjeum11 (DTMF (Touch-Tone) decoder) tt_um_vedic_mult (4-bit Vedic Multiplier) tt_um_atx_phased_interferometer (Acoustic Interferometer) tt_um_tilesos_dual_adc (Dual-Path Noise-Shaping ADC) tt_um_darga_cirom (Darga CiROM digital read + ternary MAC) tt_um_azara_cirom (Azara CiROM ternary read) tt_um_spi_reg_bank (8-bit Modified RISC-V) tt_um_aialaqili_updown_counter (4-bit Up/Down Counter) tt_um_noahzperez29_riscv_core (Noah RISC-V Core) tt_um_fp8_fpu (FP8 (E4M3) Floating-Point Unit) tt_um_costinemanuelv_gps_daily_trigger (GPS Daily Trigger) tt_um_ja_achtung_1x1 (JA Achtung Compact) tt_um_ja_achtung_1x2 (JA Achtung Full) tt_um_pwm_spice (spice-pwm-tapeout) tt_um_wecallemjazzyfact_bgr_ldo (BGR + LDO 3.3V/1.8V Integrated IP) tt_um_lelo_temp_wulffern (LELO-TEMP) tt_um_wokwi_472389622799861761 (3-Bit 101 Pattern Detector) tt_um_LnL_SoC (Lab and Lectures SoC) tt_um_dash_lucas_risc (risc_processor) tt_um_serdes_ephotonics (UCIe-style SERDES with analog TX driver & RX slicer) tt_um_joram200 (Kalman Filter Hardware Accelerator) tt_um_colbywonn_poly_synth (Poly Synth v1.0) tt_um_nobleg30_uart_vga_scroller (UART VGA Text Scroller) tt_um_multi_precision_mult (Multi-Precision Multiplier) tt_um_pratibha_munnangi_qkt_mac (QKT MAC Accelerator) tt_um_akankaan_bf16_fma (BF16 Fused Multiply-Add (FMA)) tt_um_rtfce (RTFCE - Reconfigurable Temporal Fault/Constraint Engine) tt_um_hdc_classifier (HDC Classifier) tt_um_preethi8a_adaptive_lfsr_prng (Self-Seeding Adaptive 16-bit Galois LFSR PRNG) tt_um_dilip951_cpu_systolic_array (Reconfigurable mixed-precision 2x2 systolic MAC array) tt_um_pqc_ntt_bfly (Crypto-Agile NTT Butterfly (ML-KEM / ML-DSA / FN-DSA)) tt_um_mlkem_coefficient_integrity (Fault-Aware Constant-Time FO Backend for ML-KEM) tt_um_vital_ap (VITAL-AP: Adaptive Pixel Register) tt_um_olaf8 (OLAF-8: Bounded-Memory Online Adaptive Fuzzy Inference) tt_um_Median_MAD (Streaming Median-MAD Estimator) tt_um_tnt_mosbius (tnt's variant of SKY130 mini-MOSbius) tt_um_undip_ann_q610 (UNDIP ANN Accelerator (SPI + bring-up self-test)) tt_um_cpu8 (CPU8) tt_um_vaishnavipatil5_configurable_cam (Configurable CAM with Masked Pattern Matching and Priority Resolution) tt_um_gina_env_monitor (Environmental Mapping Processor) tt_um_manasvibhat_bloom_filter (Bloom Filter Membership Tester) tt_um_amazing_sage_snn (LIF Neuron SNN) tt_um_nkanderson_lut_snn (LUT Spiking Network Classifier) tt_um_bigmanraffa_clm (Clementine: 4-lane int8 SIMT GPU) tt_um_adityarprasad_fft (Adaptive-Precision FFT) tt_um_oscillating_bones (Oscillating Bones) tt_um_silicon_edge_ns_sar_adc (NS SAR ADC) tt_um_sishi888_tinymind (TinyMind SoC) tt_um_afra_123_ecc_memory (Runtime-Reconfigurable ECC Memory) tt_um_kenchangh_mnist (MNIST Digit Recognition) tt_um_ece298a_8_bit_cpu_top (8-Bit CPU) tt_um_libormiller_SIMON_V2 (SIMON V2) tt_um_WaiMingLee888_nanov_1tile (NanoV RV32E one-tile RISC-V processor) tt_um_four_bit_nn_accel (4-bit Neural Network Accelerator) tt_um_rsa_simple (RSA Simple Encryptor) tt_um_synapticrw_lif_neuron (LIF Neuron (SynapticRW Teardown 2026)) tt_um_smunigan_ipv4_filter (IPv4 Header Filter) tt_um_jjy_spi_watchdog (SPI-Configurable Watchdog Timer) tt_um_osian_beam_controller (Programmable Metasurface Beam Controller) tt_um_namramazhar_popcnt_shiftreg (17-bit Wallace-tree POPCNT with shift-register input) tt_um_obookstay_puf (An arbiter PUF) tt_um_arminkardovic_montenegro_securekey (Montenegro SecureKey) tt_um_rcyaon_droop (All-Digital Supply Droop Detector) tt_um_ctw_spms (CTW-SPMS — Programmable Smart Power Management & Supervisor) tt_um_taiwoopesade_tempo_detector_sky26c (Hardware Audio Tempo Detector) tt_um_wokwi_470059878406973441 (Ehan's first TinyTapeout Project) tt_um_wokwi_470637170309995521 (My First Wokwi Thing!) tt_um_wokwi_470637401137246209 (Teardown Tiny Tapeout) tt_um_wokwi_469443433165025281 (Tiny Tapeout First Design Beth Plummer) tt_um_wokwi_472423526521678849 (4-bit to 5x7 Matrix Decoder for Tiny Tapeout) tt_um_wokwi_470057961258181633 (Tiny Tapeout Template Kavana) tt_um_wokwi_470057993933917185 (ivane- Tiny Tapeout (full adder)) tt_um_wokwi_470088776251343873 (training_project_kaylem) tt_um_neuropong (NeuroPong) tt_um_tamagotchi (TamaGotThis) tt_um_group02_seethebeat (SeeTheBeat) tt_um_kul_chromechain (Chrome Chain) tt_um_baked_weights (Baked-Weights Shakespeare GPT) tt_um_gilangfajrul_sar_adc (sar-adc) tt_um_Logy_FMAC (FMAC) tt_um_porkfreezer_rrio_opamp (RRIO Op-amp) tt_um_diff_engine (DSLX finite_difference) tt_um_dragonochi (WISH) tt_um_siliconsonics (ultrasonic sonar: range and bearing) tt_um_kul_conway (Interactive Conway's Game of Life) tt_um_algofoogle_ttsky26c_analog (Assorted analog in 1 tile) tt_um_mariavictoriaalm_qubit_sim ( tt-2qubit-sim) tt_um_andre_dpe (Dot product engine) tt_um_rmranjitkarNULL_pong_top (last_minute_Pong) tt_um_SAR_ADC (CTW LDO and Dynamic Comparator) tt_um_fabulous_sky_26c (Tiny FABulous FPGA) tt_um_tomvdsch_tiny32_soc (Tiny32 RV32IMA Zephyr-target SoC) tt_um_np523_pong (Pong) tt_um_usfq_adc_procmon (USFQ 8-bit Tracking ADC and Process Variation Monitor) tt_um_rangfuu_alu (Tiny ALU PD) tt_um_wokwi_473800139156677633 (Tiny Snake with PRISM 8) tt_um_mini_nn (Four-MAC Core Neural Network Inference Engine) tt_um_kianv_rv32_regfile (KianV uLinux RISC-V regfile edition) tt_um_2048_vga_game (2048 sliding tile puzzle game (VGA)) tt_um_urish_rings (VGA Rings) tt_um_silicon_art_vga_screensaver (VGA Screensaver with Silicon Art ROM) tt_um_rom_vga_screensaver (VGA Screensaver with embedded bitmap ROM) tt_um_krisjdev_manchester_baby (Manchester Baby) tt_um_urish_sic1 (SIC-1 8-bit SUBLEQ Single Instruction Computer) tt_um_ThomasCowieEngineering_LMC (Little Man Computer CPU) tt_um_pranavUl_ascon_aead128 (Ascon bit-serial permutation engine) tt_um_orca (ORCA — Online Reconfigurable Circuit with Adaptation) tt_um_krisjdev_artwork (Silicon Artwork) tt_um_htfab_caterpillar (Simon's Caterpillar) tt_um_htfab_vga_tester (Video mode tester) Available Available Available Available Available Available Available Available Available Available