Altera_Forum
Honored Contributor
15 years agohow to send/recieve 32bit int via UART
Hi,
i have a question what would be the best way to transfer 32-bit integers using UART in nios? I've allready made a simple nios design with uart connected to on-chip memory. I wrote a base echo uart application, which works great:
alt_u8 data;
while(1)
{
if( IORD_ALTERA_AVALON_UART_STATUS( UART_BASE ) & 0x80 )
{
data = IORD_ALTERA_AVALON_UART_RXDATA( UART_BASE );
IOWR_ALTERA_AVALON_UART_TXDATA( UART_BASE, data );
printf("%c",data);
}
}
But mainly I'd like to send 32bit integer data from PC to fpga board. How should I organise it? Should I use 32bit - DMA connected to uart and read 5bits of data every time? or maybe there is a simpler way? Thanks in advance