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

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
Each register is actually a message to the SPI driver, so we cleverly pass these register access requests right thru and
tunnel them thru the SPI interface. Now, there are a lot of registers (37 to be exact currently), but they are all more or less
self explanatory if you read the comments. To start, we see a couple lines at the top:
// advanced GFX commands for GFX tile engine
#define
#define
These are important since they give the base offset for these commands 192, and there are 37. So from 192 to (192+37-
1) we know are graphics commands. Thus, in the graphics driver, it will get these messages since the SPI message
dispatcher is looking for this range. If we open up the Default2 driver, we can see this as shown below:
' now process command to determine what user is client is requested via spi link
/////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
.
.
.
.
The yellow highlighted code is in the Default2 SPI message dispatcher, as you can see this highlighted section “catches”
all the graphics function calls/messages and pipes them to yet another function call inside
CHAM_GFX_DRV_001_TB_001.SPIN which is the actual graphics driver! Now, let’s take a quick peek into that:
PUB GPU_GFX_Process_Command( g_cmd, g_data16 ) : g_spi_result
/////////////////////////////////////////////////////////////////////////////////////
SUBFUNCTION/STATUS///////////////////////////////////////////////////////////////////////////////////////////
' we only expose a subset of the commands the driver supports, you can add/subtract more commands as desired
' some commands like PRINTCHAR for example internally support a number of sub-commands that we don't
' need to expose at this level unless we want to add functionality
' this function can be called with parameters to execute various commands to the register model of the GPU
' the SPI client running on the control COG with the virtual SPI interface will typically catch the GPU
' command and then pass it along here for efficient processing.
' BEGIN REGISTER INTERFACE CASE
' process command with proper handler
case (g_cmd)
' GPU
GPU_GFX_SUBFUNC_STATUS_R: ' Reads the status of the GPU OR Writes the GPU Sub-Function register and
GPU_GFX_SUBFUNC_STATUS_W:
case ( g_cmd )
GPU_GFX_subfunc := g_data16 & $FF ' lower 8-bits defines sub-function
GPU_GFX_data
GPU_GFX_BASE_ID
GPU_GFX_NUM_COMMANDS
' this command pipes right to the out() function of the driver which supports the following
' sub-commands already
GFX_CMD_NULL:
' GFX GPU TILE ENGINE COMMANDS
' catch all commands right here
GPU_GFX_BASE_ID..(GPU_GFX_BASE_ID + GPU_GFX_NUM_COMMANDS - 1):
' // NTSC GFX/TILE SPECIFIC COMMANDS
GFX_CMD_NTSC_PRINTCHAR:
' extract API subfunction and data
' call single processing function...
g_spi_result := gfx_ntsc.GPU_GFX_Process_Command( g_cmd, g_data16 )
'
'
'
'
'
'
'
'
'
'
gfx_ntsc.Out_Term( g_data )
anything else, prints the character to terminal
$00 = clear screen
$01 = home
$08 = backspace
$09 = tab (8 spaces per)
$0A = set X position (X follows)
$0B = set Y position (Y follows)
$0C = set color (color follows)
$0D = return
:= g_data16 >> 8
192
37
' issues a high level command like copy, fill, etc.
' upper 8-bits defines data for sub-function
// starting id for GFX commands to keep them away from normal command set
// number of GFX commands
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
183

Related parts for Chameleon-PIC