Chameleon-PIC Nurve Networks, Chameleon-PIC Datasheet - Page 179

MCU, MPU & DSP Development Tools PIC24 & PROPELLER DEV SYSTEM (SBC)

Chameleon-PIC

Manufacturer Part Number
Chameleon-PIC
Description
MCU, MPU & DSP Development Tools PIC24 & PROPELLER DEV SYSTEM (SBC)
Manufacturer
Nurve Networks
Datasheet

Specifications of Chameleon-PIC

Processor To Be Evaluated
PIC24
Data Bus Width
16 bit
Interface Type
USB, VGA, PS/2, I2C, ISP, SPI
Operating Supply Voltage
3.3 V, 5 V
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
these as well with direct memory access if you wish to. The font file was handmade and based on the Commodore 64 and
Atari 800 fonts as well as some extra characters for fun. The font file is located on the DVD here:
Figure 22.2 shows a screen shot of the font file for reference.
Tile Bitmap Format
The font bitmap was converted using a tool I wrote which you can find here:
The tool takes as an input a BMP file and outputs SPIN compatible data statements. Read the C source file for the control
parameters and to understand how it works. For example, the output of the tool for the “!” character looks like this:
' Extracted from file "c64_font_05_16b.bmp" at tile=(1, 0), size=(8, 8), palette index=(1)
c64_font_05__tx1_ty0_bitmap
The tool outputs a text line description of the location and file where the tile was extracted from then encodes the tile in 2-
bit pixels where each 2-bit pixel value represents one of four colors from the tile palette to use. Thus, each tile has its own
palette of 4 colors. Also, you may notice the funny “%%” character sequence this is how SPIN indicates binary
representation, but “%%”means to use 2-bit encoding to simplify your typing thus instead of writing 00
can write 1,2,3,4 – which is convenient. Summing up, each tile is a 8x8 pixels. Each pixel is 2-bits, therefore, each tile
bitmap row is a single 16-bit WORD, and there are 8 WORDs that make up a tile. Each 2-bit pixel represents 1 of 4 colors
from the palette that is indexed from the tile entry’s high byte. So each tile has its own palette.
The tile bitmaps themselves are defined by the declaration _tile_bitmaps in the driver and you can change the pointer to
them with the global tile_bitmaps_base_ptr_parm in the register interface. However, this is rare unless you want to point
the tile_bitmaps_base_ptr_parm to another character set. If you move the pointer only one bitmap in length, then it would
have the effect of shifting all the character, so “A” would be “B” etc. not very useful.
DVD-ROM:\ CHAM_PIC \ TOOLS \ GRAPHICS \ c64_font_05_16b.bmp
DVD-ROM:\ CHAM_PIC \ TOOLS \ GRAPHICS \ BMP2SPIN.EXE
TIP
WORD %%1_1_1_2_2_1_1_1
WORD %%1_1_1_2_2_1_1_1
WORD %%1_1_1_2_2_1_1_1
WORD %%1_1_1_2_2_1_1_1
WORD %%1_1_1_1_1_1_1_1
WORD %%1_1_1_1_1_1_1_1
WORD %%1_1_1_2_2_1_1_1
WORD %%1_1_1_1_1_1_1_1
Figure 22.2 the tile engine font (I added a couple Space Invaders at the end for fun!).
The tile engine is very optimized and thus needs the tile bitmaps in a specific format.
That is reversed. So the 2-bit pixels are reversed when output, that is the bitmaps you
enter must be mirrored, so that when displayed they are correct. Normally, bitmaps in
tile engines might be left to right as they are on the screen, but in this case the left most
pixels will display on the right, etc. So keep that in mind when making your own tiles.
WORD
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
b
, 01
b
, 10
b
, 11
b
, we
179

Related parts for Chameleon-PIC