Teletext Experimenter’s Board – Tutorial 4 – Page data

This should be considered an addendum to tutorial 3 … it’s just that I felt that was long enough already!

If you have a Teletext project in mind which involves getting decoded pages from a Teletext feed into your computer, you’ll need a way of getting the currently-decoded page from the RAM of the Teletext IC.

This is fairly straightforward. It is done by moving the cursor position to wherever you’d like to start reading (so if you want the full page, move it to 0,0) and then just read from register 11.

This reading transfers the byte at that location, and then automatically moves the cursor to the next position. So reading a screenful of data is just a case of reading 40×24 bytes from register 11.

To see this working, run the Arduino sketch from Tutorial 3, and enter a “D” into the serial monitor. You’ll see something like this:

The code examples transfers the data, and sends it to the serial port in a “human readable” manner. So any ASCII codes in the visible range will be sent as normal, and any values outside that range will be shown as a two-character hex value, wrapped in square brackets.

This gives us the opportunity to examine pages from the Teletext feed, and see how they’re built.

In the example above, you can see the top (“status”) row, showing the “[07]” code (which selects white text), printing “TEEFAX 100 Sun 10 May”, selecting yellow text with “[03]”, and then printing the time.

Under this there are four rows of graphics commands, which draws the red, green and blue boxes and the TEEFAX logo.

Row 6 starts with “[01]” (which selects red text) and then “[0d]” which selects double-height text. This makes the text appear on rows 6 and 7.

The rest of the screen is ordinary text with colour-change codes buried in there, to make the screen look more visually appealing.

One last thing worthy of note is that the very bottom line of text on-screen (which displays the FASTEXT prompt for the four colour buttons) is not downloaded by this code! If you were to increase the loop inside the DownloadPage function so that it grabbed more rows, you’d find that the cursor would loop back to the start, and send you the first line again.

This is done for compatibility reasons – before FASTEXT, this is how downloading the current page would have behaved. To add an extra row now risks breaking compatibility with older hardware.

The solution is that if you want to download row 24, you must explicitly set that value in register 9 before retrieving 40 bytes for the row.

Click here to visit the Teletext Experimenter’s Board main project page.


Comments are closed.