- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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;
}
- Tags:
- Include
Link Copied
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page