Deving The XGameStation/Printable version

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Deving The XGameStation

The current, editable version of this book is available in Wikibooks, the open-content textbooks collection, at

Permission is granted to copy, distribute, and/or modify this document under the terms of the Creative Commons Attribution-ShareAlike 3.0 License.

LCD Interfacing

Character-Based Displays[edit | edit source]

A 16x2 character LCD display.

Your First Program

Welcome to the first software development chapter of the book! To start this exercise you must have at least the following equipment:

  • An XGameStation
  • A Home PC
  • The XGameStation Development Toolchain

The Development Toolchain can be found at under the downloads section. The XGameStation itself costs $199, and you're on your own as to a Home PC. I myself have no experience with the Linux version created by a user - (Someone enter information on it here).

First of all, plug your XGS unit up to the power adaptor and into the wall. Then use the parallel cable provided with it and connect it to LPT1 of your computer. Finally, start the XGS IDE.

In this exercise we will create the most simple program possible that will give immediate feedback. First, Wire an LED up. It should be connected between rb.0 and ground. Be sure to check the datasheet for your LED so that you have it properly biased, as putting it in backwards won't work! Also, make sure to put a 330ohm resistor in series with it to limit current. Not doing that will result in a burned out LED or even damaging a battery in some cases! Let's start by entering this simple program into the IDE:

 DEVICE SX52       ;The XGS uses the SX52
 RESET Start       ;Start at 'Start' when processor is reset
 FREQ 80_000_000   ;Set for debug purposes, the SX-Key will use this as operating frequency (80 Mhz)
 IRC_CAL IRC_FAST              ;This prevents assembler warning
 org $0  ;Start program here
 Start:     ;Where program begins
  mov   !RB, #%00000000   ;Make RB output
  mov    RB, #%11111111   ;Turn on all bits in the port. The LED will light up!

Now, hit the 'Assemble and Run' button on the Toolbar. If everything is connected correctly and you typed the program in correctly, it should say 'Programming Successful'. Now turn on your XGS and switch the SYSMODE switch to 'RUN'. Hit the Reset button. You LED should light up!


To do:
More LED's, maybe some animation with them, or something else.

Edit Guide

This editing guide is to help guide those wishing to add to the book "Deving The XGameStation".

How to Edit this book[edit | edit source]

Links[edit | edit source]

First of all, the links used in this book are in the form of:

[[Deving_The_XGameStation/Your_Page_Here|Link Text]]

Which appears as:

Link Text

Important: Do not create that page or click on that link!
Notice that we use the book name as the main directory and that we replace spaces with underscores ("_").

Inserting Code[edit | edit source]

To insert code in book text, enclose it in <code></code> and make sure that every line starts with a space. Doing so correctly will result in something that looks like this:

 PRINT "I can count to 100!"
 FOR i = 1 TO 100

Signatures[edit | edit source]

Signatures are used to tell people who wrote what, or to mark something as their text. They should not, however, be found in the general text. This is a community effort, and there is no need to clutter text with signatures. You should only use your signature for opinionated areas, pages you created (use it once, to show yourself as 'controller' of that page, as most of the knowleadge should have come from you).

To place a signature, you must first be logged in. Although you can create and edit pages without an account, it is highly recommend you create one. Without an account you cannot place signatures.

Simply insert --~~~~ where you want your signature or click on the signature button above the textarea, 2nd button from the right. A signature looks like this:

--Cjmovie 22:10, 12 August 2005 (UTC)

Major Contributions[edit | edit source]

If you do a Major Contribution to this book, such as adding a complete section, please add your 'signature' to the list of Major Contributors as linked to on the main page.

Editing Rules[edit | edit source]

There are a few rules that must be followed to make this book work. Without rules, there would be chaos. Being the starter of the book I have assumed responsibility for it's upkeep and therefore will organize it and set it's guidelines. Not to say that someone else couldn't help me! These are the rules for editing this book:

  • Creating A Page
    • Don't create a page you're not going to fill it in yourself
    • Never expect someone else to check behind you. Check your work!
    • Pages you create are not your page. It may be edited, changed, even completely removed if needed
    • A page should really be a 'Chapter', meaning it should be organized and sectioned
  • Other Rules
    • Anything with opinion to it should be marked with your signature. Please login and use an account while editing this book

--Cjmovie 21:46, 12 August 2005 (UTC)


Page/Information Contributions[edit | edit source]

--Cjmovie 11:29, 12 August 2005 (UTC)

  • Book Creation
  • 'Creating Your First Program' Section 1
  • 'How to Edit' Original Sections
  • Misc. Fixes, Organization, etc.

--Ashmantle 01:09, 13 August 2005 (UTC)

  • (Insert Contributions Here)

Grammar/Spelling Contributions[edit | edit source]

Other Contributions[edit | edit source]