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

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
.
.
As you can see the code to extract and rebuild the SPI packets is tricky, a lot of bit fiddling and masking to get the data
back from the ASM SPI driver that is passing the data into the global shared memory. All packets are 3-bytes long and
look like this:
Command Packet Format
Commands that only require 8-bits of data or operand only use the first data byte, commands that require 2-bytes use
both the low and high. The bottom line is all commands only are 3-bytes, so you can’t send a string or something large,
you have to design your commands so they are simple and can be constructed with only 2 bytes of data at most. Thus,
most commands are atomic in nature. For example, there is no “print string” command, there is only a “print character”
command, but by stringing a collection of “print chars” together at the master/client side you can print a string. All the
commands are designed with this in mind.
16.2 Selecting the Drivers for the Virtual Peripherals
The drivers for each of the media devices were selected based on functionality and popularity. There are definitely better
drivers for many of the devices. For example, more robust graphics drivers, or more advanced sound drivers, etc.
However, this default driver isn’t about using the best, but more about system integration. Thus, drivers that are easy to
interface to and easy to control with a simply subset of commands where used. In the sections below we will cover the
exact drivers used, but the point is, they were chosen more or less for ease of use and user base.
' catch all commands right here
GPU_GFX_BASE_ID..(GPU_GFX_BASE_ID + GPU_GFX_NUM_COMMANDS - 1):
' // NTSC GFX/TILE SPECIFIC COMMANDS ///////////////////////////////////////////////////////////////////////////////////
' 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
GFX_CMD_NTSC_PRINTCHAR:
GFX_CMD_NTSC_GETX:
GFX_CMD_NTSC_GETY:
GFX_CMD_NTSC_CLS: ' eventhough this command is supported above,we break it out as a separate SPI command just in case we want to
' call single processing function...
g_spi_result := gfx_ntsc.GPU_GFX_Process_Command( g_cmd, g_data16 )
' this command pipes right to the out() function of the driver which supports the following sub-commands already
'
'
'
'
'
'
'
'
'
'
gfx_ntsc.Out_Term( g_data )
' return x position in spi buffer, next read will pull it out on last byte of 3-byte packet
g_spi_result := gfx_ntsc.GetX
' return y position in spi buffer, next read will pull it out on last byte of 3-byte packet
g_spi_result := gfx_ntsc.GetY
gfx_ntsc.Out_Term( $00 )
' add other functionality to the clear screen here...
anything else, prints the character to terminal
[command8, data_low8, data_high8]
$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
' add functionality on top of, like "overloading" and handling manually, notice we end up calling the $00 sub-command
' but we have the flexibility to add stuff if we desire...
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
130

Related parts for Chameleon-PIC