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

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
20.1 Sending Messages to the Propeller Directly
Before we cover the API itself, let’s take a look at how we would manually send a message to the Propeller chip and what
these “wrapper” functions do. This is the first time we are discussing this since the UART and SPI drivers run on the PIC
side of things only, so they are local libraries. On the other hand, the NTSC, VGA, Keyboard, Mouse, Sound, and
Propeller I/O Port libraries all make calls over the SPI channel to the Propeller chip. This subtle difference is very
important; you do NOT need these libraries, anything you can do with the libraries, you can do directly with the
SPI_Prop_Send_Cmd(…), but to make life a little easier, I wrapped many of the commands in function calls for
convenience. For example, to print a character to the NTSC screen you can do it directly without the NTSC API like this:
SPI_Prop_Send_Cmd( GFX_CMD_NTSC_PRINTCHAR, ch, 0x00);
Or you can call the NTSC API function to do it:
NTSC_Term_Char(ch);
But, let’s dive into NTSC_Term_Char(…) and take a look:
int NTSC_Term_Char(char ch)
{
// this prints a single character to the NTSC terminal (all drivers Default1,2, etc.)
// also supports translation commands supported by the NTSC terminals
//
//
//
//
//
//
//
//
// other characters are not translated, but simply printed to the terminal
SPI_Prop_Send_Cmd( GFX_CMD_NTSC_PRINTCHAR, ch, 0x00);
// wait a bit, driver takes time to respond...
//DEALAY_US(SPI_PROP_DELAY_SHORT_US);
// return success
return(1);
} // end NTSC_Term_Char
As you can see, other than comments, the functionality of the two methods is identical! So, the point is, these API
functions are very “thin” wrapper functions that more or less give function names to the commands and make them pretty.
Use them if you wish. However, once you have a really nice Propeller driver written you will definitely want to create more
advanced API layers on the PIC side, so you can write high level code. But, in this case, most of the functions are 1:1 with
the equivalent SPI_Prop_Send_Cmd(…) code. However, in some cases, the API functions are nice if you want to do a
set of operations with a single function call, and that’s what APIs are all about.
20.2 Header File Contents Overview
The NTSC API module header CHAM_PIC_NTSC_DRV_V010.h has no globals or defines as of yet, nothing more than
the function prototypes.
20.3 API Listing Reference
The API listing for the “NTSC” module CHAM_PIC_NTSC_DRV_V010.c is listed in Table 20.1 categorized by
functionality.
$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
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
170

Related parts for Chameleon-PIC