Continuing my adventures with the XGS I decided to make use of the larger breadboard along with a nice pre cut set of jumper wires.

My long term plan is to build a simple games console capable of loading games from an external flash rom (possibly sd-card based or simply on-board via switching to access a handful of pre-loaded games). This is a lot more work than it sounds since the SX range of chips can only execute instructions from their internal rom, 2K on the SX28 and 4K on the SX52. There are ways around this though which I’ll cover at a later date.

There are a lot of hurdles between now and the simple console I’m picturing, so the first versions of the console will be limited to 2K of ROM and 144 bytes of RAM i.e the onboard rom/ram for the SX28. The SX28 (parallax micro-processor) is going to be the heart of my games console. The reason, I have a boat load of reference docs, manuals and papers about it plus a local supplier and I’m already slightly familiar with SX assembly. Also, the SX28 is available in a DIL package which makes prototyping much simpler than the surface mount versions of the SX48 and SX52.

Start Simple

The plan is to start very simple and progressively add more and more features to the console such as graphics/sounds/external flash rom & sram/joystick port etc If you’ve read the XGS ebook then you’ll probably notice many similarities to the PICO and XGS which are used as a base reference, however I plan to expand the feature set of the PICO, for example with the addition of graphics and sound hardware. How far this can be taken with just the SX28 and the limited output pins, I’m not sure. At the expense of speed I can probably serialise a number of the systems and in the worst case scenario can step the design up to use the SX48. Thats the rough plan anyway, I’m sure it will change as I learn more.


Step one was getting a power supply up and running, actually very easy to do. A 7805 regulator did all the hard work plus there is quite a good section on power supply regulation in the XGS ebook (notice a trend?) I’m still not 100% certain on how the capacitors reduce the ripple in the DC supply. I understand the concept but don’t quite understand the calculations enough to work out which frequencies are getting through and which are filtered. Something to work on in the future.

Enough reading, here’s a picture of a very basic SX28 project. The 7805 voltage regulator is in the top right, that takes a 9V DC supply and produces a 5V supply, along with the smoothing and noise filtering capacitors to clean up the 5V output.



Located at the top/middle of the image is the SX28, the heart of this project. Pin one is the top right pin with pin 28 been the bottom right pin. The connection is pretty simple, pins 2 and 4 provide +5V and GND along with decoupling capacitors. On the other side of the chip pins 26 and 27 carry the oscillator 1 and 2 lines which are connected to the pin header in the top left of the photo where the SX Key Programmer connects. Pin 28 is the /mclr line used to reset the processor by grounding (via the connected reset switch). Finally pin 18 (output port RC.0) is connected to an LED to be used during testing/debugging.

Missing from the circuit is an external osciallator to provide an accurate clock to the SX28. I plan on ordering a selection of oscillators next week. In the mean time the SX28 has an internal oscillator that can provide frequencies in the range 31.25kHz to 4MHz. There’s also the SX Key which can generate a clock between 400kHz and 100Mhz more than enough for my purposes (although it can be less accurate than an external oscillator it will do for now).

Programming the SX28 with this setup is simple, connect the SX Key to the pin header, program the chip then remove the SX Key and you’re done. That is assuming you’re running the chip via its internal osciallator, otherwise the SX Key remains connected to provide a clock source.

Heres the program I used to test the hardware:

; //////////////////////////////////////////////////////////////////////
; SX28 - V0.1 LED Blink
; (c) Gary Preston 29th April 2006
; //////////////////////////////////////////////////////////////////////
include ""

; ----------------------------------------------------------------------
; Global Data $08-$0F in all 8 banks on SX28
org $08
counter1  ds  1
counter2  ds  2
counter3  ds  3

; ----------------------------------------------------------------------
; Banked Data

; ----------------------------------------------------------------------
; Main entry
; ----------------------------------------------------------------------

; clear up mem avoiding 00-07 in each bank
clr fsr

  sb  fsr.4                 ; skip if accessing $10 - $1F, $30 - 3F...
  setb  fsr.3               ; offset by 8 bits to avoid first 8 mem locations
  clr ind
  ijnz fsr, :cleardata      ; keep looping until wrap around to $00

  mov W, #%11111110         ; RC.0 set to output
  mov !RC, W               

  setb  RC.0                ; default to on

  mov W, /RC
  mov RC, W
  ; Running @ 1MHz one clock cycle = 1.0uS
  ; 1023 cycles per loop = 525833 cycles = ~0.53 seconds

  mov counter3, #2

  decsz counter1            ; 1/3
    jmp :loop               ; 3
  decsz counter2            ; 1/3
    jmp :loop               ; 3
  decsz counter3            ; 1/3
    jmp :loop
  jmp :blink   

The layout of the board leaves a bit to be desired, I’ll probably shuffle things around a little for the next iteration. A few months ago I wouldn’t have had a clue what any of the above did, but today it actually looks quite simple (aside from circuit analysis of the capacitor filter frequency)

The next task is graphics generation and adding an RCA output to the TV. How successful this will be using the SX Key as a clock source rather than a good oscillator remains to be seen.