OpenCores
URL https://opencores.org/ocsvn/oms8051mini/oms8051mini/trunk

Subversion Repositories oms8051mini

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /oms8051mini/trunk/verif
    from Rev 5 to Rev 6
    Reverse comparison

Rev 5 → Rev 6

/sw/C/uart_lb.c
0,0 → 1,40
/*
* UART Software Loop Back.
* Software continously check the Uart Rx Buffer, If the RX Buffer is not zero,
* Then it read the Rx data and copy the information back to tx fifo
*/
 
/*---------------------------------------------------------------------------*/
 
#include <8051.h>
 
char cErrCnt;
/*---------------------------------------------------------------------------*/
 
__xdata __at (0x3000) unsigned char uart_reg0;
__xdata __at (0x3008) unsigned char uart_reg2;
__xdata __at (0x300C) unsigned char uart_reg3;
__xdata __at (0x3010) unsigned char uart_tdata;
__xdata __at (0x3014) unsigned char uart_rdata;
__xdata unsigned long *rx_des_base;
__xdata unsigned long *tx_des_base;
 
void main() {
unsigned int cFrameCnt = 0;
/***
[4:3] = 0 -> No Parity
[2] = 1 - 2 Stop
[1] = 1 - Rx Enable
[0] = 1 - Tx Enable
**/
uart_reg0 = 0x7;
uart_reg2 = 0x0; // Baud Clock
while(1) {
if((uart_reg3 & 0x2) == 0) { // Check the Rx Fifo Counter
// Read the Receive FIFO
uart_tdata = uart_rdata;
cFrameCnt = cFrameCnt+1;
}
}
}
sw/C/uart_lb.c Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.