Close
0%
0%

Digital TV signal from Parallax P2 microcontroller

Some home computers used to have RF video output. The P2 could bring that back with ATSC HDTV output.

Similar projects worth following
Transmitting ATSC using Gnuradio and a software defined radio is easy. This project is an investigation into transmitting a digital TV signal with only a microcontroller.

Status: Can play a 12 second loop from an unmodified MPEG transport stream file. All signal encoding done on the micro.

Microcontroller: Rated 180MHz. Overclocked to 300MHz.
Video generator: Processing 8VSB symbols instead of pixels.
Chroma modulator: Forget the 3.58MHz chroma carrier, let's generate an 82MHz radio signal.
RF spectrum: So dirty it would give the FCC a heart attack.
DTV converter box: Not really bothered when the timestamps step back in time. (MPEG decoders are supposed to tolerate discontinuities)



Possibly inspired by this project to generate a DVB-T signal from a VGA card: https://bellard.org/dvbt/

Note: The spectrum is terribly dirty. (see plot) Please do not send this signal into an antenna. The main lobe occupies 4 channels and the side lobes are significant.

The Parallax P2 is a very powerful microcontroller, capable of generating 1080p component and VGA video. Unfortunately component and VGA inputs are disappearing from new monitors.  The P2 can generate HDMI but maximum of about 330 Mbps falls short of the 750Mbps needed for 1080i.   

If we could generate an ATSC signal we could feed that into the RF input on all TVs.  The we could use the TV's MPEG decoder as a graphics accelerator. The 4MB required to buffer a full frame full color image would be stored in the TV memory. A big benefit on a microcontroller with 512kB ram.  Scrolling could be done with motion vectors. 

✅ Proof of concept with minimal microcontroller code to determine whether an unfiltered ATSC signal would work.

✅ Complete ATSC implementation.

❌ Generating MPEG data on the micro. TBD

❌ Reducing the latency inherent in the TV's MPEG decoder. TBD

❌ Audio. TBD

p2_atsc_complete1.zip

Sends a 12 second loop video from an unmodified pre-recorded transport stream.

Zip Archive - 26.56 MB - 11/11/2025 at 04:16

Download

p2_atsc_proofofconcept.zip

Sends a 6 second loop video from a pre-generated bitstream.

Zip Archive - 24.10 MB - 01/24/2024 at 05:17

Download

  • 1 × P2 Edge Module with 32MB RAM
  • 1 × Base Board for P2 Edge Module (several options available, all will work)
  • 1 × micro SD card
  • 1 × Digital TV or converter box (North American ATSC standard)
  • 1 × Cables and Adapters to get the radio signal into the TV

  • Double Play with on-board Trellis Encoder

    Real Solar Cars11/10/2025 at 23:32 0 comments

    The trellis encoder is the part of the ATSC standard that adds the most excess data. It's also one of the last steps before transmission.  It takes in 2 bits of data and outputs 3 bits.   I opted to store the 3 bit symbols in 4 bits.  At least initially, getting it to work correctly was more important that maximizing video play time.

    If the trellis encoding could be done on the P2 the video playback time would be doubled. It would also make it easier to play longer videos directly from the SD card due to the reduced data rate required. 

    A Look-Up-Table can be a good way of computing complex operations quickly, provided the input space is not too large.  In the graph we can see that the trellis encoder has 3 bits of memory inside.  The table will need the current state as an input and the next state as an output. 

    InputInputOutputOutput

    Total% of
    StateDataStateDataTable
    tableOn-chip
    bitsbitsbitsbitsentriesbitsbytesRAM used
    3233326240.00
    343612891440.03
    3831220481538400.73
    316324524288271769472337.50








    38312204864163843.13

    Processing 8 bits of data at a time results in a table of 2048 entries. Quite reasonable. 

    I opted to use 64 bits per entry to save time unpacking the results. The P2 has a burst memory access mode such that additional 32 bit words add only 1 clock cycle.  Memory usage of 16kB of the 512kB is quite tolerable. 

    The trellis encoder along with associated housekeeping uses about 50% of one core of the P2 microcontroller at 300MHz.

  • Could this even work? Yes!

    Real Solar Cars11/10/2025 at 22:17 0 comments

    For proof of concept, I used the Gnuradio ATSC transmitter blocks to add the forward error correction to the video data. The encoded symbols are saved onto a microSD card. Since the micro struggled to read from the SD card fast enough I loaded the data into the 32MB ram on the P2 edge module and played it in a loop. I thought that this was the easiest way to feed a sustained 33mbps into the P2. Well, for 6.19 seconds :) It works! And the 6 seconds of video plays in a loop, with some pixelization as it restarts.

    The Parallax P2 microcontroller has hardware to handle the heavy lifting for generating composite video signals. The quadrature modulator included for generating the chroma signal can also be used as a general purpose radio signal modulator. 

    The ATSC signal is vestigial side band, which means the lower side band signal is mostly filtered out.  I knew from experience with Gnuradio that applying the root-raised-cosine filter to the output of the ATSC modulator is very computationally intensive.  The signal could be pre-filtered with Gnuradio.  However, the end goal is to run everything on the microcontroller.  The transmitted symbols contain 33 Mbps of information. The filtered signal might need 6 megasamples per second with 8 bits for I and Q at a minimum. This would increase the storage requirement to 6M*16 = 96 Mpbs, over double. But because the P2 would upsample the data with a zero order hold the transmitted signal may not be much cleaner anyway. 

    For this project I opted to generate an unfiltered double side band signal.  The cheap channel 3 modulators used in VCRs are also double side band for cost reasons.  

    This way the P2 video generation hardware would do all the work of reading symbols from memory and feeding them to the RF (chroma) modulator.  The palette memory even maps the symbols to the appropriate RF levels. 

    ATSC has a segment sync and a field sync similar to NTSC video. Thus in order to keep synchronization we need the output loop to occur at a whole number of frames.  One ATSC frame contains 2 fields of 312 packets each, for a total of 624 packets.   

    Each packet has Reed-Solomon error correction added lengthening it to 207 bytes.  These are sent 2 bits at a time resulting in 828 symbols. Then a 4 symbol segment sync is added, lengthening it to 832 symbols.  After every 312 packets a field sync is sent, adding another 832 symbols.  Thus an ATSC frame is (832*312 + 832)*2 = 520,832 symbols long.  

    With the constraint of 32MB of PSRAM I determined that the largest whole number of frames that would fit was 128 frames.  128*520,832 = 66,666,496 symbols.  Each symbol requires 3 bits but I opted to store 4 bits per symbol for simplicity.  This would require 33,333,248 bytes of memory, filling the PSRAM to 99.34% capacity.

    Since each frame is 624 packets, the input file would need to be 128*624 = 79,872 packets.  Since an MPEG-TS packet is 188 bytes, the file would be 79872*188 = 15,015,936 bytes. The unix dd command is able to extract data of the exact size needed. Due care needs to be taken to ensure that the loop file starts with the MPEG-TS sync byte 0x47.  Setting the start position to a multiple of 188 bytes worked. 

View all 2 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates