woensdag 10 december 2008

This is a copy of the text on the other website, to ensure that it is preserved in case it goes down.

Version 0.1

Version 2, with its old-style joystick interface, desparately needed a TV interface as well. I therefore started working on this. After some experimenting with an old television, I discovered that at 20 MHz it is quite possible to get 14 characters on one line without any real problems. You can also get quite a few characters vertically, but memory of a 16F628 is limited, so I decided on 10 characters, making a grand total of 140 characters. The memory is set to two segments, one starting from A0-F4, the other from 20-58. Each byte represents one character. If the top bit is set, it is assumed to be a regular ASCII character (see picture for the entire set).

Version 0.2

If the top bit is not set, it is assumed to be a user defined character, and retrieved from the local EEPROM. A next version will implement a three-byte code that can be sent over RS-232 in order to change memory and EEPROM locations.

Version 0.3

I then continued developing the "low resolution graphics option" which allows a
screen of 56*20 pixels, shown in the picture. This can be configured per line, so you can have one line of text, and 56*18 pixels, if desired. I originally planned on also have a line-by-line configurable 28*40 resolution, but am probably going to make that a global setting.

Currently I'm working more on the RS-232 interface, which understands the following commands:

Sequence Effect
0 1 2 Sync sequence. Send this if you're not certain if the chip is in sync with its RS-232 communication.
128 A0+14*Y+X V Prints character V at location X,Y. This works for lines 0-5. To print an ASCII character, set bit 7 of V. To print a user defined character, reset bits 0, 1, 2 and 7. This leaves a choice of 16 user defined characters. You can "scroll" through the user defined graphics by changing the lower three bits.
128 20+14*Y+X V See above, for lines 6-9.
128 106/107 V Defines which lines will be text, and which lines will be 56*20 graphics. The bits of 106 define the first eight lines, the lower two bits of 107 define lines 9 and 10. A 0 means text, a 1 means graphics. V is the value assigned.
129 Y*8+X V Defines a user defined character. Y (0-15) defines which user defined character is changed, X (0-7) defines which line in the user defined character is changed. V is the value assigned. Changing a user defined character takes time: do not send multiple changes in rapid succession or some changes might be lost.
130 .. .. Similar to commands starting with 128, but instead the value is XORed instead of assigned. Sending this sequence twice would result in no change.
132 255 0 Set speed to 1200 bits/second.
132 129 0 Set speed to 2400 bits/second (default).
132 129 1 Set speed to 9600 bits/second.
132 64 1 Set speed to 19200 bits/second.
132 32 1 Set speed to 38400 bits/second.
132 21 1 Set speed to 57600 bits/second.
132 3 0 Set speed to 76800 bits/second. This exceeds the maximum processing speed of the device. Do not send data continuously.
132 10 1 Set speed to 115200 bits/second (not continuous).
132 4 1 Set speed to 250000 bits/second (not continuous).
132 0 0 Set speed to 312500 bits/second (not continuous).
132 1 1 Set speed to 625000 bits/second (not continuous).
132 0 1 Set speed to 1250000 bits/second (not continuous).
132 111 4 Odd times: disables fake interlace (makes screen more stable, but makes dark lines inside letters visible), even times: enable fake interlace.
128 126 V 130 111 8 Change all locations on the screen to V. This can be used as a clear screen (with 0xA0 in text mode and 0x00 in graphics mode). V needs to be set only once, and defaults to 0xA0.
128 121 L 128 122 H 130 111 1 Play a musical note through the television. L,H=65536-(15660/frequency). To turn the note off, send 132 111 1 again.
Version 1
TV I built the first daughterboard version (see picture) and discovered that the bytecode is way to slow to even send a continuous 2400 bits/second data stream, let alone higher bit rates. I therefore decided to code some of the commands in bytecode (in fact adding a "TV mode") which worked well, until I tried higher speeds. It turned out I didn't call HandleRS232 often enough, and had to change that. It can now run at 9600 bits/second, and tonight I'll start trying higher speeds. Hopefully I'll get the 57600 bits/second that I promised myself earlier on this page. And yes, the system works also without the LCD display, and only the TV daughterboard connected.

TV Game Update: the speed is now up to 78600 bits/second continuous, where it belongs. To the left you can see a picture of a conversion of the "Version 1" meteor game to TV. The space ship has pixel level (two TV line level) up and down movement, and the meteors are moving quite fast compared to its speed. This is still in the beginning stages, but development goes quite well.

Version 1.01

Version 1.01 now has the Drake v2.0 logo when it boots. I also modified the output not to be on cables, but on the PCB itself. A good picture of the board is now available on this page as well. The final version of this system will be on a smaller board, but will still have three outputs (though it is still mono: the two sound outputs are provided with the same stream). TV Card

Version 1.02

Here is a picture of the current font of the TV card. It includes the suits of cards, a ball, an overscore, a solid block and a grayed block, four triangles in four corners and a number of digraphs (and ...) which allow more characters to be squeezed on a line, improving the amount of text that can be displayed on one line.

Version 1.03

To show how the digraphs help in increasing the number of characters per line, you can see a text in the picture on the right. The content is a Dutch song which has been roughly translated into English. As you can see, the digraphs allow a lot more characters per line than would normally be possible. This is version 1.03 because the digraphs are different from the ones in version 1.02. As you can see, the largest number of characters on one line in this example is 21, which is 50% more than the normal 14. The only line with less than 14 characters is "first had", this line still has six regular spaces left. The average line length is 16.6 characters, almost a 20% increase.

Version 1.04

This is the first picture of the version using the 16F628A. The 16F628A has the unfortunate aspect that disallows reading from the EEPROM while it is being written to (the 16F628 had no problems with that). I'm still working on making tbhe meteor pattern more random, which is more difficult than it seems. The random generator might need more work. I'm also working on porting the application to the 16F688. This will increase the amount of user defined characters to 32, and the number of characters in the character set to 256. However, it will disallow user defined characters and regular characters to appear on the same line.
Purchasing
If people are interested in buying this TV card, which can easily be used in other Microcontroller/PC projects, I would be welcome to send it to you. It can be configured to your desires, will come unassembled with a preprogrammed PIC16F628A, and will be $10 excluding shipping. Features:

* 14*10 character resolution
* 56*20 graphics mode, selectable on a per line basis
* 16 user definable characters, can be combined on a pixel line basis
* Communication speed up to 250000 bits/second (3 bytes/charater)
* 1 voice audio with frequencies up to 15660 Hz
* Fast clear screen operation
* Special character set with digraphs for an average of 18 letters/line

Geen opmerkingen: