PICs in Space

21,496

PICs in Space
PICs in Space

The circuit diagram is shown to the right. A larger or PostScript version is available if preferred. The design centers around a Microchip PIC16F628A microcontroller, which is currently available for less than one pound from various suppliers, including Crownhill Associates. All functions, including color video and synchronization signal generation, are performed by the microcontroller, eliminating the need for other active components. Purists who argue that the LED is an active component may opt to replace it with a light bulb. The circuit will be described from left to right. On the far left are the battery, power switch, and decoupling capacitors. The smaller decoupling capacitor should be placed as close to the power pins of the microcontroller as possible. Three buttons with pull-up resistors serve as game controls. The buttons are shown wired in parallel with a 9-pin D connector, allowing for the connection of an Atari-style digital joystick. It is possible to exclude either the buttons or the connector if desired. The connector located above and to the left of the microcontroller is intended for in-circuit programming of the device, which may require modifications to accommodate the specific programmer used. It is important to note that MCLR must be pulled high and RB4 must be pulled low for normal operation. The microcontroller receives its clock signal from a 20MHz crystal, with the load capacitor values indicated being suitable for most commonly available crystals. A ceramic resonator could serve as an alternative to the crystal and should provide sufficient accuracy for most televisions to lock onto the generated signal. To the right, several resistors and capacitors adjust the audio (top right) and video (bottom right) signal levels to meet the requirements of the television. Basic anti-alias filtering is included for the audio. The LED illuminates when the microcontroller activates the RGB select pin on the SCART connector, which happens shortly after power-up, indicating that the circuit is functioning properly. It is essential to use a fully-wired SCART lead to connect the game to the television, as not all leads carry RGB signals. The television must also support RGB signals; most modern televisions include at least one SCART input with this capability, though it may be necessary to consult the manual or conduct experiments to identify the correct input. The software represents the most complex aspect of the design and will not be elaborated upon here. Much of the software is automatically generated using custom tools. Nearly all resources of the PIC microcontroller are utilized: 99.9% of the program memory (2046 out of 2048 locations), all but two of the data EEPROM locations, and nearly all of the data RAM. A programmer capable of writing to the program memory, data EEPROM, and configuration bits of the device is required. Object code in Intel HEX format is provided, with gratitude to Adrian Higginson for preparing this file and testing it with MPLAB. The code is available without warranty and is intended for hobby use only; commercial use is prohibited. A couple of images of the prototype are included, assembled using a DIL version of the microcontroller and predominantly surface-mount resistors and capacitors. Proper panel-mounted SCART connectors are challenging to source, leading to a unique mounting arrangement for mechanical stability. The board has been modified at the corners to fit into a type H2855 ABS enclosure (available from Maplin Electronics) along with three AA cells. The enclosure dimensions are 83mm by 53mm by 31mm. Rickard GunG©e has documented the generation of black-and-white video signals using a PIC microcontroller, as well as the development of Tetris and Pong games. Similar games have been created using a Scenix microcontroller and an external digital-to-analog converter for NTSC composite output.

The circuit design incorporates a Microchip PIC16F628A microcontroller, which serves as the core processing unit. The microcontroller executes all necessary functions for generating video and audio signals, ensuring a compact and efficient design. The power supply section consists of a battery connected to a power switch, with decoupling capacitors placed strategically to stabilize the power supply to the microcontroller. The design includes three user interface buttons connected with pull-up resistors, which can be used for game control, and a 9-pin D connector for an Atari-style joystick, providing flexibility in user input.

Programming capabilities are facilitated through an in-circuit programming connector, which allows for easy updates and modifications to the microcontroller's firmware. The microcontroller's clock is derived from a 20MHz crystal oscillator, ensuring precise timing for signal generation. The accompanying load capacitors are chosen to match the specifications of the crystal used, allowing for reliable operation.

Signal conditioning components, including resistors and capacitors, are utilized to ensure that the audio and video outputs meet the specifications required by the connected television. Basic anti-aliasing filters are implemented to enhance audio quality. The LED indicator provides a visual confirmation of circuit operation by lighting up when the RGB select pin is activated, a simple yet effective diagnostic feature.

The design emphasizes compatibility with modern televisions that support RGB input, which is crucial for achieving high-quality video output. The software controlling the microcontroller is complex and resource-intensive, utilizing nearly all available memory and storage capabilities of the device. This highlights the sophistication of the design, which leverages advanced programming techniques to deliver a functional gaming experience.

The prototype's physical construction demonstrates practical considerations in electronic design, such as mechanical stability and component placement, while also showcasing the use of readily available materials and enclosures. Overall, the circuit represents a comprehensive approach to creating a gaming console using a microcontroller, combining hardware and software elements to achieve the desired functionality.The circuit diagram is shown to the right. You can get a larger version or a PostScript version if you prefer. The design is based around a Microchip PIC16F628A microcontroller. At the time of writing, this device is available for less than one pound from (among others) Crownhill Associates. All the work, including colour video and synchronisatio n signal generation, is done in the microcontroller, and so there are no other active components. Purists who contend that the LED is an active component may replace it with a light bulb. We will describe the circuit from left to right. On the far left of the circuit diagram are the battery, power switch and decoupling capacitors. The smaller decoupling capacitor should be wired as close to the power pins of the microcontroller as possible. Three buttons with pull-up resistors provide the game controls. We have shown the buttons wired in parallel with a 9-pin D connector, into which you can plug an Atari-style digital joystick.

You can of course dispense with either the buttons or the connector if you wish. The connector to the above left of the microcontroller is for in-circuit programming of the device. You may need to change this part of the circuit to suit your programmer. Note that MCLR must be pulled high and RB4 pulled low for normal operation. The microcontroller derives its clock from a 20MHz crystal. The load capacitor values shown should be suitable for most readily-available crystals. A ceramic resonator could be used instead of the crystal, and should be accurate enough to allow most televisions to lock on to the resulting signal. On the right, a handful of resistors and capacitors match the audio (top right) and video (bottom right) signal levels to those required by the television.

Crude anti-alias filtering is provided for the audio. The LED lights when the microcontroller takes the RGB select pin on the SCART connector high: this occurs shortly after power-up, and so the LED provides some indication that the circuit is functioning correctly. Note that the SCART lead you use to connect the game to your television must be fully-wired: not all leads carry the RGB signals.

Your television must also be capable of accepting the RGB signals. Most modern televisions have at least one SCART input with this facility, though you may need to check the manual (or experiment) to determine which one it is. The software is by far the most complex part of the design, and it will not be described in detail here.

Large parts of it are automatically generated using specially-written tools. Almost all the resources of the PIC microcontroller are used: 99. 9% of the program memory (2046 out of 2048 locations), all but two of the data EEPROM locations, and almost all of the data RAM. You will need a programmer capable of writing to the program memory, data EEPROM and configuration bits of the device.

Here is the object code in Intel HEX format: many thanks to Adrian Higginson for preparing this file and testing it with MPLAB. The code is made available without warranty of any kind and is for hobby use only. Commercial use is not permitted. Here are a couple of pictures of the prototype, assembled using a DIL version of the microcontroller and mostly surface-mount resistors and capacitors.

Proper panel-mounted SCART connectors are hard, if not impossible, to obtain, and so the prototype employs a rather odd mounting arrangement to achieve mechanical strength. The corners have been cut away from the board so that it fits (just!) in a type H2855 ABS enclosure (available from Maplin Electronics) along with three AA cells.

The enclosure measures 83mm by 53mm by 31mm. Rickard GunG©e has described generating black-and-white video signals with a PIC microcontroller, making a Tetris game and a Pong game. He has also made similar games using a Scenix microcontroller and an external digital-to-analogue converter to produce an NTSC composit

🔗 External reference