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

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
}
_________________________________________________________________________________________________
Function Prototype:
Parameters:
Return:
Description:
Example(s):
// Include main system header
#include "CHAM_PIC_SYSTEM_V010.h"
// Include CHAM I2C/SPI driver
#include "CHAM_PIC_I2C_SPI_DRV_V010.h"
int main (void)
{
// Initialize the SPI interface
SPI_Init();
// continue program below…
// Always call SYS_ConfigureClock first after main() begins
SYS_ConfigureClock(MAX_FCY_RATE);
// Initialize the SPI interface
SPI_Init();
// Select device on CS1
SPI_SET_CS(SPI_CS_1)
// Send some data
SPI_Write(0xDE);
SPI_Write(0xAD);
SPI_Write(0xBE);
SPI_Write(0xEF);
Programming
void SPI_Write(unsigned char Data8);
Sidebar
Data8
SPI_Write(…) sends a single byte out of the initialized SPI port.
This example shows a simple usage scenario.
None.
A single byte to be written out
It is important to remember that the SPI’s built in CS line is not used to select anything.
Instead a pair of digital I/O lines are used as SPI “select” selection bits and are
multiplexed to select 1 of 4 devices named 0…3. The signals in the Chameleon design
are on Port B
#define SPI_CS0
#define SPI_CS1
To select device 0…3 you simply place 00
the FLASH, 10
are exported off the I/O headers to support other SPI devices you might connect. For
example, to select the Propeller chip you would use the following code which uses our
macro:
// set CS to SPI select, select Prop SPI channel = 2
SPI_SET_CS(SPI_CS_PROPELLER)
And to de-select the Propeller and select device 0 (null device), you would use :
// set CS to SPI select channel 0 (null)
SPI_SET_CS(SPI_CS_0)
b
(2) selects the Propeller as destination. The other two unused selectors
PB14
PB15
// Configure clock
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
b
, 01
b
, 10
b
, 11
b
on these pins. 11
b
(3) selects
166

Related parts for Chameleon-PIC