dmsherazi
Newbie
- Joined
- Mar 25, 2015
- Messages
- 4
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,320
hi , I am using TCP ip stack provided by microchip, I am using the pic net demo 2 board. When I send any string from the uart I receive 00 at strat of the string
Here is what i get when I send "New IP Address: " I would receive "New IP Address: [00]" on the terminal.
Here is the part where Uart is initialized.
and this is the code to put the string on uart
is there some thing that I am missing?
Here is what i get when I send "New IP Address: " I would receive "New IP Address: [00]" on the terminal.
Here is the part where Uart is initialized.
Code:
// Configure USART
TXSTA = 0x20;
RCSTA = 0x90;
// See if we can use the high baud rate setting
#if ((GetPeripheralClock()+2*BAUD_RATE)/BAUD_RATE/4 - 1) <= 255
SPBRG = (GetPeripheralClock()+2*BAUD_RATE)/BAUD_RATE/4 - 1;
TXSTAbits.BRGH = 1;
#else // Use the low baud rate setting
SPBRG = (GetPeripheralClock()+8*BAUD_RATE)/BAUD_RATE/16 - 1;
#endif
// Enable Interrupts
RCONbits.IPEN = 1; // Enable interrupt priorities
INTCONbits.GIEH = 1;
INTCONbits.GIEL = 1;
INTCONbits.PEIE = 1; // enable peripheral interrupts.
PIE1bits.RCIE = 1; // enable USART receive interrupt
IPR1bits.RCIP=0; // EUSART Receive Interrupt Priority 0 = Low priority
and this is the code to put the string on uart
Code:
void putrsUSART(const rom char *data)
{
do
{ // Transmit a byte
while(BusyUSART());
putcUART(*data);
} while( *data++ );
}
is there some thing that I am missing?