Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem with uartlite in microblaze

15 views
Skip to first unread message

bhb

unread,
Mar 28, 2008, 11:27:53 AM3/28/08
to
Hi,

I 'm learning to use microblaze (microblaze, EDK 9.1 sp2).
I try to use the Send function of uartlite.
Please, find below my c code.
the result of this code (with hyperterminal) is :

-- Entering main() --
nXUartLite_Send
-- status true--
-- status true--
-- XUartLite_SendByte --
e
-- Exiting main() --

I never received the 'D' char (byte_buf = 0x44), and val.
Is someone could hep me.
thanks in advance
bhb.

----------------------------------------------------------------------------
-----------------------------------
#include "xparameters.h"
#include "stdio.h"
#include "xuartlite_l.h"
#include "xuartlite.h"
#include "xstatus.h"

//====================================================
void STATUS_CHECK(Status) \
{ \
if (Status != XST_SUCCESS) \
{
print("\r\n -- status bad--\r\n");
return Status; \
}
else
{
print("\r\n -- status true--\r\n");
return Status; \
}
}

//====================================================

int main (void) {
Xuint8 byte_buf = 0x44;
XUartLite UartLite;
XStatus Status;
unsigned int val;
print("\r\n -- Entering main() --\r\n");

print("\r\nXUartLite_Send \r\n");
Status = XUartLite_Initialize(&UartLite, XPAR_RS232_UART_1_BASEADDR);
STATUS_CHECK(Status);
Status = XUartLite_SelfTest(&UartLite);
STATUS_CHECK(Status);
XUartLite_ResetFifos(&UartLite);
val = XUartLite_Send(&UartLite, &byte_buf, 1);
print(val);

print("\r\n -- XUartLite_SendByte --\r\n");
XUartLite_SendByte(XPAR_RS232_UART_1_BASEADDR, 'e');

print("\r\n -- Exiting main() --\r\n");
return 0;
}


0 new messages