FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6343 Discussions

How to receive bits (through RX) using the UART core?

NNuti
Beginner
659 Views

So, I can't use the file pointer way to receive data via RX as is said in the UART core data sheet because the design wont fit in my 35 kB on chip memory (max I can designate).

 

That being said, I've found another way to receive information over RX but I only receive info as bytes and not bits. Is there a way I can recieve an 8 bit sequence and not a packaged byte that I need to decode?

 

Here's the code:

 

 

#include <stdio.h>

#include "altera_avalon_uart_regs.h"

#include "system.h"

#include <string.h>

 

int main()

{

   int incoming_character;

   int uart_status;

   char data = 0;

   IOWR(UART_0_BASE, 2, 0);

   while(1){

      while (!(uart_status = IORD(UART_0_BASE, 2) & 0x80));

      incoming_character = IORD(UART_0_BASE, 0);

 

      IOWR(UART_0_BASE, 1, incoming_character);

   }

 return 0;

}

 

 

0 Kudos
0 Replies
Reply