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

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
After Adding New Messages
.
.
.
.
.
.
I have highlighted the two new message id’s. That’s all there is to it. The selection of 100,101 are a bit random, I could
have used 65,66, or I could have used a single id and then used one of the data bytes to control on/off. But, I thought this
would be a little more illustrative.
Now that we have the message ids, we need to process the messages and do something. A bit of investigation of the
schematic and the boot code shows that I/O P25 is connected to the status LED. In fact, the boot code that blinks the LED
3 times during boot looks like this:
Therefore, this code already sets up the I/O direction of the port bit, all we need to do is add the two messages that set
the port bit LOW and HIGH. Reviewing the main message dispatcher loop, we simple find the last message processed
and add a couple more messages. Here’s that section before and after again:
Before
.
.
.
.
.
.
REG_CMD_WRITE
REG_CMD_READ
REG_CMD_WRITE_BYTE
REG_CMD_READ_BYTE
' system commands
SYS_RESET
' ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
' this range of commands for future expansion...
' ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
' added status LED commands added for example in manual "Developing Your Own Propeller Drivers".
STATUS_LED_ON
STATUS_LED_OFF
' advanced GFX commands for GFX tile engine
GPU_GFX_BASE_ID
GPU_GFX_NUM_COMMANDS
GPU_GFX_SUBFUNC_STATUS_R = (0+GPU_GFX_BASE_ID) ' Reads the status of the GPU, Writes the GPU Sub-Function register and issues
GPU_GFX_SUBFUNC_STATUS_W = (1+GPU_GFX_BASE_ID) ' Writes status of the GPU, Writes the GPU Sub-Function register and issues
' blink the status LED 3 times to show board is "alive"
DIRA[25] := 1 ' set to output
OUTA[25] := 0
repeat 6
OUTA[25] := !OUTA[25]
repeat 25_000
' set result and set dispatcher to idle
spi.finishcmd(g_spi_result)
' // end main loop
' ////////////////////////////////////////////////////////////////////////
REG_CMD_WRITE_BYTE:
' read command from byte registers of 32-bit buffer register
REG_CMD_READ_BYTE:
SYS_RESET:
' end case commands
' byte address to write 0..3 is in g_data while data to write is in g_data2
g_reg_out_buffer.byte[ g_data ] := g_data2
' byte address to read 0..3 is in g_data
g_spi_result := g_reg_in_buffer.byte[ g_data ]
reboot
= 56 ' performs a 32-bit write to the addressed register [0..F] from the output register buffer
= 57 ' performs a 32-bit read from the addressed register [0..F] and stores in the input register buffer
= 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
= 192
= 37
' resets the prop
= 100
= 101
' write byte 0..3 of output register g_reg_out_buffer.byte[
' read byte 0..3 of input register g_reg_in_buffer.byte[
' this data is then placed into spi buffer for transport back to client
' starting id for GFX commands to keep them away from normal command set
' number of GFX commands
'
' a high level command like copy, fill, etc.
a high level command like copy, fill, etc.
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
0..3 ]
0..3
]
0..3 ]
0..3
]
245

Related parts for Chameleon-PIC