View previous topic :: View next topic |
Author |
Message |
tranz
Joined: 10 Feb 2007 Posts: 78
|
Checking Internal Registers |
Posted: Fri Dec 07, 2007 2:57 pm |
|
|
Hi,
I am using RTL8019as in one of my projects, I was hoping to see some internal register values of my RTL after some tests on my LCD. But it only shows the value I had defined it with. Can anyone tell me the way I can check the internal registers of the RTL8019as
Previously I used to try seeing the values of registers like this..as shown in the example code below.
Code: |
#define RCR 0x0C /* rx configuration reg for wr */
#define TCR 0x0D /* tx configuration reg for wr */
#define DCR 0x0E /* data configuration reg for wr */
#define IMR 0x0F /* interrupt mask reg for wr */
.....couple of other definitions
void mactest(void)
{lcd_init();
//This is a test function, which checks the integrity of the RTL8019AS
//Implement loop back test...
NICPut(RCR, 0x00);//recieve configuration register RCR, PAR0-5 accept packet
NICPut(DCR, 0x40);
// Place NIC in LOOPBACK mode 1
NICPut(TCR, 0x02);
////Other parameters for checking
NICPut(ISR, 0x00);
MACPut(11);
printf(lcd_putc,"ISR=%d",ISR);
printf(lcd_putc,"\nFIFO=%d",FIFO);
}
The problem is when I try to see the values of the registers, it just shows me the values which I had defined the registers with . NOT the internal values of the register. Which what I need.
Can anyone help?
Appreciate any response I can get.
Thank You
|
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Dec 07, 2007 4:49 pm |
|
|
You are only calling the NICput() function. It writes to registers.
You probably got that code from here:
http://svn.bemix.org/elcn/checkout/ethernet/Source/RTL8019AS.c?rev=1
It shows a function to read the registers:
Quote: |
static void NICReset(void);
static void NICPut(BYTE reg, BYTE val);
static BYTE NICGet(BYTE reg);
static void NICSetAddr(WORD addr);
|
|
|
|
tranz
Joined: 10 Feb 2007 Posts: 78
|
|
Posted: Fri Dec 07, 2007 8:12 pm |
|
|
Hi,
Thanks for the response. I did use NICget(), but then I am not getting the value I had put in RX buffer, after the loop back test. The board I am working on works. But still I dont get the proper output. Any solutions to that? |
|
|
Ostello Guest
|
|
Posted: Sat Dec 08, 2007 11:50 am |
|
|
Hi,
Can anyone tell me who to make the PAR0-5 to accept data packet and reject packet using the CCS compiler. |
|
|
tranz
Joined: 10 Feb 2007 Posts: 78
|
|
Posted: Sat Dec 08, 2007 3:30 pm |
|
|
Even after using NICGet function and displaying the values on the LCD, the LCD shows "FF" instead of the actual value put in the register.
So is there any other way of displaying the value, or have I done something wrong. |
|
|
|