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

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
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////
.
.
.
I have highlighted the register access code fragments at the top of each section. So the idea is the AVR/PIC sends the
GFX command message via SPI, the SPI message dispatcher catches these messages and passes all of them to the
function, then this function, cases on each possible register access message and processes it – viola! Of course, the
above code is a partial listing, the complete function is really long and you can look it yourself in the Propeller source file.
GPU Functions Overview
These functions deserve a bit of explanation. I am using the word “GPU” pretty freely here and it’s not meant to infer there
is a hidden GPU somewhere, but rather than indicate that the hardware or driver is capable of doing large operations via a
single command. Two things that we do a lot of in computer graphics is copying data and moving data. Copy, move, copy,
move, copy, move. 90% of operations are copy, move! So, one thing you want your GPU/graphics engine, software,
whatever to do is copy and move – fast!
Thus, one of the simple additions to the tile driver is the ability to copy and fill memory. So, I added some sub-functions
that I call “GPU functions” these are macro level functions that can fill and copy memory 8/16 bits at a time. If you take a
look at the listing above at the very top you will see the processing of GPU sub-functions. First, we use the SPI command
itself to identify a GPU function, the register messages are GPU_GFX_SUBFUNC_STATUS_R and
' TILE MAP POINTER
GPU_GFX_TILE_MAP_R:
GPU_GFX_TILE_MAP_W:
' TILE DISPLAY POINTER
GPU_GFX_DISPLAY_PTR_R:
GPU_GFX_DISPLAY_PTR_W:
' TILE TERMINAL POINTER
GPU_GFX_TERM_PTR_R:
GPU_GFX_TERM_PTR_W:
' BITMAP POINTER
GPU_GFX_BITMAP_R:
GPU_GFX_BITMAP_W:
case (GPU_GFX_subfunc)
g_spi_result := tile_map_base_ptr_parm
tile_map_base_ptr_parm := g_data16
g_spi_result := tile_display_ptr
tile_display_ptr := g_data16
g_spi_result := tile_term_ptr
tile_term_ptr := g_data16
g_spi_result := tile_bitmaps_base_ptr_parm
tile_bitmaps_base_ptr_parm := g_data16
GPU_GFX_SUBFUNC_COPYMEM16: ' 0 - Copies numbytes from src -> dest in wordsize chunks
GPU_GFX_SUBFUNC_FILLMEM16: ' 1 - Fills memory with data16, 2 bytes at a time
GPU_GFX_SUBFUNC_COPYMEM8:
GPU_GFX_SUBFUNC_FILLMEM8:
' END CASE GPU_GFX_subfunc
wordmove( tile_dest_addr_parm, tile_src_addr_parm, tile_numbytes_parm)
wordfill( tile_dest_addr_parm, tile_data16_parm, tile_numbytes_parm >> 1)
bytemove( tile_dest_addr_parm, tile_src_addr_parm, tile_numbytes_parm >> 1)
bytefill( tile_dest_addr_parm, tile_data16_parm & $FF, tile_numbytes_parm)
' Reads or Writes the 16-bit tile map ptr which points to the current tile map
' displayed.
' Reads or Writes the 16-bit tile terminal ptr which points to the location where
' high level terminal mode printing is displayed
' Reads or Writes the low byte of the 16-bit tile bitmaps ptr which points to the
' bitmaps indexed by the tilemap.
' Reads or Writes the 16-bit tile display ptr which points to the location
' where low level printing is displayed
' 2 - Copies numbytes from src -> dest in byte size chunks
' 3 - Fills memory with low byte of data16, 1 bytes at a time
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
184

Related parts for Chameleon-PIC