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

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
// of strings **tokens. The number of tokens extracted are returned by the function
// INPUTS:
//
//
//
// OUTPUTS:
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
unsigned char c;
int cmd_buff_index = -1;
// enter infinite while until valid string is entered
while(1)
{
// process next character
if ( (UART_getchar(&c)) != 0 )
} // end while
} // end Get_String
This function is a bit overkill since its designed to read in characters until a carriage return or a line feed character has
been received. It then returns the string to the calling function. The bottom line is text parsing isn’t as easy as you would
think and when you have to write editors that run over terminal programs there are a lot of issues you need to resolve.
Summary
Hopefully, you have a good command of the serial driver now and you can use it to communicate with the PC or any other
serial based device. There are all kinds of interesting things you can do with a serial port and the Chameleon PIC, for
example you could get an external serial modem and write a simple BBS (bulletin board system) on the Chameleon PIC.
How cool would that be? For example, the "TRENDnet 56k (V.92) High Speed Voice/Fax Modem” has a standard RS-
232 DB9 connector on it, so you can connect quite easily to the Chameleon PIC and send standard HAYES AT
commands at it. Can you imagine running a BBS on your little Chameleon and then dialing in from a friend’s house?
Here’s a link to the product:
} // end if
{
// special characters
switch (c)
{
case 0x0D: // carriage return
case 0x0A: // line feed
case 0x08: // back space
default: // otherwise normal character, insert into command string and echo
} // end switch
{
cmd_buff[++cmd_buff_index] = 0;
// any command to process?
if (cmd_buff_index > 0)
// empty string
return (0);
} break;
{
UART_putchar( c );
cmd_buff[++cmd_buff_index] = c;
} break;
{
if (cmd_buff_index >=0 )
} break;
{
*buffer
**tokens = an array of pointers where the function puts the tokenized strings
returns the number of tokens.
// process command...
// upcase the string to normalize tokens
_strupr( cmd_buff );
// string has been entered and tokenized, now return number of tokens
return( cmd_buff_index );
} // end if
{
UART_putchar( c );
cmd_buff_index--;
} // end if
= pointer to string storage where the raw ASCII string from the UART is placed
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
231

Related parts for Chameleon-PIC