Other Parts Discussed in Thread: CC2530, Z-STACK
#include <ioCC2530.h>
//..............................................................................
void initUART(void) //sets all configurations in UART
{
CLKCONCMD = CLKCONSTA & 0xB8; //clock control
while(CLKCONSTA & 0x40);
PERCFG&=~0x01; //Alernative 1 selected for UART0 peripheral.
P0SEL |= 0x0C; //P0.2 and P0.3 peripheral mode enabled.
U0CSR |= 0xC0; //UART mode selected for USART0.
U0UCR |= 0x00; //H/w flow control disabled
U0GCR |= 0x08;
U0BAUD = 0x3b; //Baud rate set to 9600 bps
}
//..............................................................................
void send(unsigned char c)
{
UTX0IF = 0;
U0DBUF = c;
while (!UTX0IF);
UTX0IF = 0;
}
//..............................................................................
void main()
{
initUART();
while(1)
{
unsigned char uartdat = 'a';
send(uartdat);
}
}
I wrote this sample code via IAR Embedded Workbench IDE.
And Click Make -> Download and Debug -> Go.
But I Can't confirm this example via hypertrm.
I check 9600 and port number...
why i can't confirm this example... ?
also
I can get other UART0 Example code ?
plz help me ...
