darkfader.net <- ARM


ARM (Advanced RISC Machines) is a company that designs core logic for CPU's and toolkits.
ARM-based CPU's are very popular and are mostly used in handheld devices because of their low power consumption.
They are cheap to manufacture and exist in big all-in-one chips that include timers, LCD controller and other I/O.
The instruction set is also very nice, although a divide instruction would be handy sometimes.

Here are some ARM platforms I touched:

Platform CPU Core
GamePark GP32 Samsung S3C2400X ARM920T (ARM9TDMI), up to 133 MHz
Nintendo GBA Nintendo custom CPU ARM7TDMI, 16 MHz
O2 XDA (PDA) Intel SA1110 SA-1 (StrongARM), 206 MHz



ARM - Advanced RISC Machines


Joint Test Action Group standards are made for debugging and device configuration. JTAG uses a synchronous serial bus that runs as a chain through all JTAG-capable devices in a target. The connection to the chips is called a Test Access Point (TAP). It's a stateful protocol and allows selection of several chains. Each type of chain can have a different length and the data is serially shifted in and out.
For example, the EmbeddedICE chain allows full debugging of the target... control, status, debug communications, hardware watchpoints, etc.
The Boundary Scan chain allows reading/writing of device pin states (internal or external), thus the whole device can be tested and controlled without having to execute any instruction on the CPU. This is often used to program flashroms.

Cheap hardware / software

A cheap solution is to make a JTAG cable that connects to the parallel port. Since most new chips use 3.3V and a PC outputs 5V, a conversion chip is need. This can be a simple 74ACxxx or 74HCxxx.
There exist several parallel-port cables, and each use different datapins for the JTAG signals.
One of them is the Macraigor Wiggler. You can either build this one yourself or buy it for too much money (hehe :). I made my own using just a quad OR-port 74HC32 or something and it worked. The chip is only there to buffer the voltage difference.
(For GP32: See "ioport(gp32)-en.pdf" & "ioport-en.pdf" from GamePark dev-website for pin-out).
You can use GDB with ArmLibRemote. ArmLibRemote will accept a GDB remote connection via TCP and then connects to the ARM7/ARM9 device using the Wiggler cable.
It's a dumb cable, so the speed isn't very fast and only suitable for uploading very small programs (a bootloader for example) or to debug/trace.


ArmLibRemote.txt - How to use ArmLibRemote
Example GDB script.txt - Example of a GDB script connecting to ArmLibRemote
JTAG_stuff.zip - some JTAG classes... debugging doesn't still work yet, but some parts might be usable
JTAG_stuff2.zip - some newer JTAG code... chains split up in seperate files etc
JTAG_RDI.dummy.zip - v1.00 - a dummy/skeleton (nothing to do with JTAG yet) for a Remote Debugging Interface (RDI) 1.5.1 DLL for use with debuggers like ARM AXD and GDB.


OCDemon - "Free GNU Toolkits for OCDemonTM BDM/JTAG Devices". Has ArmLibRemote.
- JEENI JTAG developer tool
XILINX - JTAG/Parallel download cable. Register with Product ID: DAE657107572 or something for their software :)
ALTERA - ByteBlasterMV Parallel Port Download Cable & some free software (for their devices).
Chameleon POD - A JTAG device that is compatible with Raven and wiggler hardware at low cost.
http://www.ti.com/sc/docs/jtag/c3.pdf - What is IEEE 1149.1
http://www.ti.com/sc/docs/jtag/format.htm - Data Formats
http://www.ti.com/sc/docs/jtag/seminar1.pdf - JTAG Seminar (Introductory)
http://www.ti.com/sc/docs/jtag/seminar2.pdf - JTAG Seminar (Intermediate)
http://www.ti.com/sc/docs/jtag/low_voltage.pdf - Low-Voltage JTAG and Scan Support
http://developer.intel.com/design/flcomp/applnots/29218602.PDF - JFlash in-system flashing
http://www.actel.com/appnotes/JTAG_ccn.pdf - timings, BSDL
http://www.rsn-tech.demon.co.uk/pjtag/download.html - Personal JTAG download
JTAG Base Layer - yet another base layer and some links to free JTAG software
jtag-arm9 - simple debugger source code
ianjtag - jtag flasher & testing
jtag - more source (cvs)
jtag - more source (cvs)
jflash - intel jtag flasher

3D engine for ARM

some thoughts...

- no divide instruction, slow divides, no per-pixel perspective texture correction (could be per 8 or 16 pixels)
- no floating point, fixed point inaccurate, maybe combination

cache coherency
- use same texture on triangles in a row
- small lookup tables (scanline division for triangle rasterizer)

software rasterizer
- no z-buffer, use z-sorting, buckets / ordering table, pre-sorting
- no s-buffer?. divide by Z is required for polygon edges. maybe with c-buffer?

culling / clipping
- backface culling, clustering (2x2x2 unit cube, normal masks)
- occlusion depends on type of game, many techniques, portals,

- Hierarchic View Frustrum Culling

Organize objects in scene into a precomputed hierarchy of bounding volumes.
• (E.g., AABBs, OBBs, OCT Trees or BSP Trees.)
• For each frame:
– Use recursive algorithm to determine which objects potentially intersect the current view frustrum.
– Render only the potentially visible objects.

- clipping in worldspace (using arbitrary planes) or in clipspace (requires matrix transformation).

check out my GP32 3D demo for what I've done already

(C) Copyright Dark Fader