HackerBox 0061: Props

by HackerBoxes in Circuits > Microcontrollers

6945 Views, 18 Favorites, 0 Comments

HackerBox 0061: Props

Whole Box HB0061.png

Greetings to HackerBox Hackers around the world!

HackerBox 0061 brings you the Parallax Propeller 8-Core Microcontroller. Assemble the exclusive Prop Kit, and experiment with parallel programming, game development, the Propeller Spin programming language, keyboard/mouse interfacing, game controllers, basic surface mount soldering, audio/video signal generation, audio/video signal capture, and brush up on the applications of matrix math.

HackerBoxes is the monthly subscription box service for enthusiasts of electronics and computer technology - Hardware Hackers - The Dreamers of Dreams.

There is a wealth of information for current and prospective members in the HackerBoxes FAQ. Almost all of the non-technical support emails that we receive are already answered there, so we really appreciate your taking a few minutes to read the FAQ.

Supplies

This Instructable contains information for getting started with HackerBox 0061. The full box contents are listed on the product page for HackerBox 0061 where the box is also available for purchase while supplies last. If you would like to automatically receive a HackerBox like this right in your mailbox each month with a $15 discount, you can subscribe at HackerBoxes.com and join the revolution!

A soldering iron, solder, and basic soldering tools are generally needed to work on the monthly HackerBox. Box 0061 can use an old PS/2 Keyboard and PS/2 Mouse, but these are not absolutely necessary. A computer for running software tools is also required. Have a look at the HackerBox Deluxe Starter Workshop for a set of basic tools and a wide array of introductory activities and experiments.

Most importantly, you will need a sense of adventure, hacker spirit, patience, and curiosity. Building and experimenting with electronics, while very rewarding, can be tricky, challenging, and even frustrating at times. The goal is progress, not perfection. When you persist and enjoy the adventure, a great deal of satisfaction can be derived from this hobby. Take each step slowly, mind the details, and don't be afraid to ask for help.

Parallax Propeller Microcontroller

Prop Chip.png

The Propeller is a microcontroller from Parallax Inc. Its eight cores each have access to all 32 I/O pins and internal shared memory for simplified system integration and data conveyance among processes. A central hub and common system clock preserve shared memory integrity by allowing one core at a time to access main RAM in a round-robin fashion, optionally augmented by eight lock bits. Each core has its own memory for independent code and data processing, and a pair of configurable counter modules, a video generator, and I/O registers that can be utilized as a variety of software peripherals.

The Parallax Propeller is known in the hardware hacking community for its use in some very cool projects such as the JTAGulator and the DEF CON 22 Badge.

The HDL source files for the Propeller chip itself have been released under GNU Public License. Not that you'd probably want to roll your own Propeller chip, but it is quite interesting to see the inner workings. Also, the source might be useful for an FPGA project.

As of late 2020, there is a new Propeller 2 chip finally entering the market, and quite possibly coming to future HackerBox near you!

Propeller Chip Documentation

Books.png

You can download the Propeller Manual, and one or both of these...

Programming and Customizing the Multicore Propeller Microcontroller

Game Programming for the Propeller-Powered HYDRA

HackerBox 0061 Prop Kit

HB0061 Kit.png

The exclusive HackerBox 0061 Prop Kit is based on the Propeller CPU running eight PIC-like CPU cores each with 496 32bit-words of workspace plus a shared 32kB RAM and 32kB ROM. The kit also features a 24LC512 serial EEPROM chip with a capacity of 512Kb (or 64KB).

The Prop Kit also includes an FT232 USB interface with a MiniUSB programming port. Other ports include two SNES Compatible Game Ports, a PS/2 Keyboard Port, a PS/2 Mouse Port, a 3.5mm TRRS A/V Jack providing audio and composite video output, and an I/O header configured to support a MicroSD card module.

HackerBox 0061 Prop Kit Components:

  • Exclusive Custom PCB
  • Parallax Propeller Chip P8X32A-D40 DIP 40
  • FT232RL Module - switch jumper to 3.3V
  • 24LC512 Serial EEPROM DIP 8
  • Two SNES Game Controller Sockets
  • Two Mini DIN 6 pin PCB Sockets
  • Micro SD Card Module
  • 10MHz HC49 Crystal
  • AMS1117-3.3 LDO Voltage Regulator
  • Tactile SMD Reset Button
  • Five 10K Resistors 1206 SMD
  • Four 100R Resistors 1206 SMD
  • Three 270R Resistors 1206 SMD
  • Three 560R Resistors 1206 SMD
  • One 470R Resistor 1206 SMD
  • Four 0.1uF Ceramic Capacitors 1206 SMD
  • Two 10uF Tantalum Capacitors 1206 SMD
  • 3.5mm TRRS Female Socket
  • 5mm Red Diffused LED
  • DIP IC Socket 40 pin
  • DIP IC Socket 8 pin
  • 40 pin Single Row Header
  • Four 3M Adhesive Rubber Feet

Prop Kit - FT232 and Initial Assembly

Minimal.png

VOLTAGE

The red FT232 module features a MiniUSB connector and a FT232RL chip (datasheet) to support USB to serial UART interfacing. The Prop Kit is also powered through the USB port of the FT232 module. The FT232 module has a 5V/3.3V jumper which must be set to 3.3V

OPTIONAL FT232 MODIFICATION

Since the six right-angle pins on the top of the FT232 module are not used, they can be desoldered to make the board look a little cleaner. This is totally optional since leaving the pins in place will not affect operation in any way. The pins are easier to desolder if the header's plastic insulators are first removed or cut apart. Similarly, the three pins for the voltage jumper switch can be removed as long as the two pins for selecting 3.3V are shorted together with a blob of solder to configure the FT232 module for 3.3V operation.

MINIMAL INITIAL PROP KIT ASSEMBLY

It's choose your own adventure time... You can follow the procedure in this step to set up and test a minimal initial assembly of the Prop Kit board. Or you can jump right into the full assembly by following the procedure in the next step. The choice is yours!

  1. Perform the FT232 modification above or set the jumper to 3.3V
  2. Break off two nine pin lengths from the 40 pin header
  3. Use the cut pin headers to solder the FT232 module to the Prop Kit PCB (Optionally remove the insulators from the header if you want the FT232 module to sit flat against the PCB)
  4. Solder the AMS1117 LDO regulator
  5. Solder the red LED (orient the short pin closest to the flat side on the PCB silkscreen)
  6. On the bottom of the PCB, find pads for the 270 Ohm resistor closest to the LED (about 5mm away) and install one of the resistors marked "271" which means 27*10^1 (or 270) - resistors may be oriented in either direction
  7. Match the half circle notch indicator on the 40 pin IC socket to the same shape on the PCB silkscreen and solder the IC socket into place
  8. Match the half circle notch indicator on the 40 pin Propeller IC to the same shape on the IC socket and carefully press the IC into the socket (sometimes it helps to bend the two rows of IC pins very slightly closer together by laying the chip sideways on the table and gently forcing each row of pins towards the center of the IC about 1mm)

These few parts are all that is needed to program the Propeller and blink the LED, so now we're ready to jump ahead to the "Hello World Blinky" example.

Prop Kit - Full Assembly

Schem.png

Solder time! You may want to review the online guide from our Soldering Workshop paying particular attention to the surface mount soldering pointers in Step 6. If this is all very new, you may want to watch the Learn to Solder video in Step 1.

  1. Start by placing all of the 1206-sized SMT devices according to the PCB markings
    • Two 10uF Tantalum Capacitors (yellow with brown stripe) - orient the brown stripe towards the silkscreen marking with chamfered corners
    • Four 0.1uF Ceramic Capacitors (light brown, no markings) - may be oriented either way
    • Five 10K Resistors (marked "103") - may be oriented either way
    • Four 100R Resistors (marked "101") - may be oriented either way
    • Three 560R Resistors (marked "561") - may be oriented either way
    • Three 270R Resistors (marked "271") - may be oriented either way
    • One 470R Resistors (marked "471") - may be oriented either way
  2. Solder AMS1117 LDO regulator
  3. Solder reset button
  4. Solder the red LED (orient short pin closest to the flat side on the PCB silkscreen)
  5. Solder 10MHz crystal may be oriented either way
  6. For both IC sockets, match the half circle notch indicator on the socket to the same shape on the PCB silkscreen and solder the IC sockets into place
  7. For both IC chips, match the half circle notch indicator on the IC to the same shape on the IC socket and carefully press the IC into the socket (sometimes it helps to bend the two rows of IC pins very slightly closer together by laying the chip sideways on the table and gently forcing each row of pins towards the center of the IC about 1mm)
  8. Perform the FT232 modification from the previous step or set the jumper to 3.3V
  9. Break off two nine pin lengths from the 40 pin header
  10. Use the cut pin headers to solder the FT232 module to the Prop Kit PCB (optionally remove the insulators from the header if you want the FT232 module to sit flat against the PCB)
  11. The six pins on the lower left corner of the PCB can be used as an I/O expansion header, or a Micro SD Card Module may be installed (optionally remove the insulators from the header of the Micro SD Card Module if you want the module to sit flat against the PCB)
  12. The five connector sockets go exactly where you think they do
  13. Place the adhesive rubber feet on the bottom of the PCB, one in each corner

Hello World Blinky

hello world.png

Install the Propeller Tool software from the Parallax Download Page.

Plug the Prop Kit board into a USB port.

From within the Propeller Tool, hit F7 (or menu to Run > Identify Hardware)

The tool will report "Propeller Chip found on COM n"

Paste the following code into the workspace:

PUB main
  dira[0] :=1
  repeat
    outa[0] := 1
    waitcnt(clkfreq + cnt)
    outa[0] := 0
    waitcnt(clkfreq + cnt)

Save the Code to create a file.

Hit F10 (or menu to Run > Compile > Load RAM)

This will load the code into RAM and run it, which will blink the LED on P0.

Since the code is in RAM, it will disappear when you cycle power. Hitting F11 is similar to F10, but stores the code onto the EEPROM.

Obviously, F11 will fail if the board doesn't have an EEPROM chip yet, so if you jumped to this step from the minimal build, go back and assemble the rest of the Prop Kit board.

HYDRA Game Development

hydra.png

The Prop Kit implements many similar Propeller based features as the HYDRA Game Development Kit. A lot of the HYDRA code examples will run on the Prop Kit with little or no modification. Two major functional differences are in the PS/2 ports for keyboard and mouse. Switching to a different driver/library and specifying the I/O pins as shown in the modified examples below will often suffice to reuse a piece of HYDRA code.

If you haven't already done so, download the Game Programming book linked earlier. Also grab this zip file of the HYDRA CD-ROM. The folder Hydra/sources within the zip is filed with example code. Try some of these after making any of the noted modifications for keyboard and/or mouse.

  • FROGGER_DEMO_030 (video, sound, gamepad)
    • works as is
  • gamepad_demo_011 (video, gamepads)
    • works as is
  • keyboard_demo_010
    • "keyboard_iso_010.spin" to "keyboard"
    • key.start(3) to key.start(13, 15)
  • JTC_B_Buster_005 (video, sound, mouse)
    • "keyboard_iso_010.spin" to "keyboard"
    • "mouse_iso_010.spin" to "mouse"
    • key.start(3) to key.start(13, 15)
    • mouse.start(2) to mouse.start(9, 11)
  • hydra_test_rev_a (all the things!)
    • "keyboard_iso_010.spin" to "keyboard"
    • "mouse_iso_010.spin" to "mouse"
    • key.start(3) to key.start(13, 15)
    • mouse.start(2) to mouse.start(9, 11)
  • sound_demo_020 (sound, mouse)
    • "mouse_iso_010.spin" to "mouse"
    • mouse.start(2) to mouse.start(9, 11)
  • NS_deep_cavern_020 (video, sound, gamepad)
    • works as is with gamepad, or
    • modify two keyboard entries to use arrow keys
  • REM_LockNChase_012 (video, sound, gamepad)
    • works as is with gamepad, or
    • modify two keyboard entries to use arrow keys.

NOTE: Regarding the little green passive USB to PS/2 adapters that we all have lying around, these do not work with all USB keyboards. Some keyboards are designed to switch into PS/2 mode, and should work with the passive adapter. The keyboard that the adapter originally came with, for example. However, more and more newer USB keyboards do not support PS/2 interfacing as well as USB.

Generating and Capturing Composite Video

Composite Video.png

Composite Video (Wikipedia) is an analog video signal format that carries standard-definition video (typically at 480i or 576i resolution) as a single channel. Video information is encoded on one channel, whereas the higher-quality S-video uses two channels and the even higher-quality component video uses three or more channels. In all of these video formats, audio is carried on a separate connection. Composite video is also known by the initials CVBS for composite video baseband signal or color, video, blanking and sync. It is also simply referred to as SD video for the standard-definition television signal it conveys. There are three dominant variants of composite video: NTSC, PAL, and SECAM.

Chapter 7 of the HYDRA Game Development book does an amazing job of explaining the generation of composite video on the Propeller Chip.

We can even generate a simple composite video signal using a humble 8-bit Arduino with the TVout Library and even more elegantly on the ESP32.

USB Audio/Video Capture Device

With televisions and computer monitors featuring composite video inputs becoming less and less common, we need a way to view (or capture) these video signals generated by our small embedded systems, classic computers, older game platforms, and even VCRs, camcorders, or aging set top boxes. An A/V capture device operable to bring these composite video signals into a modern computer is a good tool for any hardware hacker to keep on the bench. The one here is based on the MS2106 Macrosilicon chip. Captured video from the MS2106 dongle can be viewed (or saved) on most computers systems. On a Windows 10 system, run the camera application and switch the input to the AV Capture device. To hear the audio live, go into the system settings for sound, select the AV Capture device as the input (microphone), enter advanced settings, select the "Listen" tab, click the checkbox for "Listen", and hit "Apply". This seems rather circuitous, but it makes sense (in a weird Microsoft kind of way) once you think about it.

Take the Red Pill...

The Applications of Matrices | What I wish my teachers told me way earlier

you stay in wonderland, and I show you how deep the rabbit hole goes."

You will not regret kicking back with this video on the applications of matrix math. It is pleasantly accessible and we could all use a little more time in the matrix.

HackLife

outro.png

We hope you are enjoying this month's HackerBox adventure into electronics and computer technology. Reach out and share your success in the comments below or other social media. Also, remember that you can email support@hackerboxes.com anytime if you have a question or need some help.

What's Next? Join the revolution. Live the HackLife. Get a cool box of hackable gear delivered right to your mailbox each month. Surf over to HackerBoxes.com and sign up for your monthly HackerBox subscription.