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

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
KEY_CMD_STOP
KEY_CMD_PRESENT
' mouse commands
MOUSE_CMD_RESET
MOUSE_CMD_ABS_X
MOUSE_CMD_ABS_Y
MOUSE_CMD_ABS_Z
MOUSE_CMD_DELTA_X
MOUSE_CMD_DELTA_Y
MOUSE_CMD_DELTA_Z
MOUSE_CMD_RESET_DELTA = 31 ' resets the mouse deltas
MOUSE_CMD_BUTTONS
MOUSE_CMD_START
MOUSE_CMD_STOP
MOUSE_CMD_PRESENT
' general data read back commands
READ_CMD
' sound commands
SND_CMD_PLAYSOUNDFM
SND_CMD_STOPSOUND
SND_CMD_STOPALLSOUNDS = 42 ' stops all channels
SND_CMD_SETFREQ
SND_CMD_SETVOLUME
SND_CMD_RELEASESOUND
portion of ADSR envelope
' propeller local 8-bit port I/O commands
PORT_CMD_SETDIR
PORT_CMD_READ
PORT_CMD_WRITE
' general register access commands, Propeller registers for the SPI driver cog can be accessed ONLY
' but, the user can leverage the counters, and even the video hardware if he wishes, most users will only
' play with the counters and route outputs/inputs to/from the Propeller local port, but these generic access
' commands model how you would access a general register based system remotely, so good example
' these commands are DANGEROUS since you can break the COG with them and require a reset, so if you are going to
' write directly to the registers, be careful.
REG_CMD_WRITE
buffer
REG_CMD_READ
register buffer
REG_CMD_WRITE_BYTE
REG_CMD_READ_BYTE
' system commands
SYS_RESET
As you can see, there is a lot of commands supported. This is necessary, so the PIC master/client can issue commands
to the Propeller/slave to do what it needs it to do. However, this is only a template, you can re-write the default2 driver if
you wish, modify, optimize, change the objects it uses etc. But, you will have to modify all the APIs on the PIC side as well
with the new commands and SPI API calls, so we suggest you start simply by adding commands and/or modifying
commands that already exist.
Once a valid command is detected then its parsed and a case handler in the MCP tries to dispatch it to the proper driver
object (themselves running on other cores potentially). An excerpt from that section of the driver code looks like this:
' ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
' MAIN LOOP - Listen for packets to finish then execute commands sent to Prop over SPI interface
' the longer this loop is the slower processing will be, thus you will want to remove unnecessary driver support for
' your customer drivers and of course port to ASM and blend this with the virtual SPI driver code as well for the
' best performance.
' ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
repeat
' wait for SPI driver to receive a command packet in shared memory
if ( (g_spi_cmdpacket & $1_00_00_00) > 0)
' reset the reception flags
g_spi_buffer
g_spi_cmdpacket := (g_spi_cmdpacket & $FF_FF_FF)
' extract cmd 8-bit, data 8-bit, status 8-bit
g_cmd
g_data
g_data2 := g_status := ((g_spi_cmdpacket >> 0)
' build 16-bit data (may not be valid though based on command)
g_data16 := (g_data2<< 8) | (g_data)
' now process command to determine what user is client is requested via spi link
case ( g_cmd )
GFX_CMD_NULL:
' GFX GPU TILE ENGINE COMMANDS /////////////////////////////////////////////////////////////////////////////////////////
:= ((g_spi_cmdpacket >> 16) & $FF)
:= ((g_spi_cmdpacket >> 8)
:= (g_spi_buffer
= 21
= 22
= 24 ' resets the mouse and initializes it
= 25 ' returns the absolute X-position of mouse
= 26 ' returns the absolute Y-position of mouse
= 27 ' returns the absolute Z-position of mouse
= 28 ' returns the delta X since the last mouse call
= 29 ' returns the delta Y since the last mouse call
= 30 ' returns the delta Z since the last mouse call
= 32 ' returns the mouse buttons encoded as a bit vector
= 33 ' starts the mouse driver, loads a COG with it, etc.
= 34 ' stops the mouse driver, unloads the COG its running on
= 35 ' determines if mouse is present and returns type of mouse
= 36
= 40 ' plays a sound on a channel with the sent frequency at 90% volume
= 41 ' stops the sound of the sent channel
= 43 ' sets the frequency of a playing sound channel
= 44 ' sets the volume of the playing sound channel
= 45 ' for sounds with infinite duration, releases the sound and it enters the "release"
= 48 ' sets the 8-bit I/O pin directions for the port 1=output, 0=input
= 49 ' reads the 8-bit port pins, outputs are don't cares
= 50 ' writes the 8-bit port pins, port pins set to input ignore data
= 56 ' performs a 32-bit write to the addressed register [0..F] from the output register
= 57 ' performs a 32-bit read from the addressed register [0..F] and stores in the input
= 58 ' write byte 0..3 of output register g_reg_out_buffer.byte[
= 59 ' read byte 0..3 of input register g_reg_in_buffer.byte[
= 64 ' resets the prop
& %0_1111_1111)
& $FF)
& $FF)
' low byte of 16-bit data
' high byte of 16-bit data
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
0..3 ]
0..3
]
129

Related parts for Chameleon-PIC