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

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):
unsigned char ReadBuf[256];
UART_puts(“Please enter your name:\r\n”);
UART_gets(ReadBuf);
UART_printf(“Your name is %s, that’s a funny name.\r\n”,ReadBuf);
_____________________________________________________________________________________________
Function Prototype:
Parameters:
Return:
Description:
Example(s):
// headers and globals go here…
int main (void)
{
}
unsigned char ReadValue;
// Always call SYS_ConfigureClock first after main() begins
SYS_ConfigureClock(MAX_FCY_RATE);
// initialization code goes here…
UART_Init(115200);
While(1)
{
}
// Echo back any characters received
if(UART_getchar(&ReadValue))
int UART_gets(unsigned char *Data);
int UART_getchar(unsigned char *ch);
UART_putchar(ReadValue);
Data
UART_gets(…) is a copy of the C stdio gets() function. The purpose is to read in a string up until the
carriage return from the UART. Since a user may type in an extremely long string there is no way to know
how big to make the Data buffer so this could become problematic.
This example shows a simple usage scenario.
ch
UART_getchar(…) fills a single character into the passed in destination. If the assignment takes place
the function returns 1, otherwise it returns 0 meaning no data available.
This example shows a simple usage scenario.
A buffer to store data in that includes the carriage return. It must be as large enough to hold the
string. (Potential buffer overrun)
Returns the actual amount of data read including the carriage return.
A pointer to receive a single byte/character.
Returns 1 if there was data assigned to ch, otherwise 0.
// Echo it back
// Configure clock for max
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
150

Related parts for Chameleon-PIC