- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have instantiated the LAN91C111 controller provided by Altera in my system. I am trying to access the registers of LAN91C111 chip with macros provided by Altera. I am not able to read the registers. I have pasted the C code which i used to access the registers. Please let me know if my C' code has some problem. Let me know if any initialization sequence is required for LAN91C111 to come up. # include <stdio.h># include <io.h># include <string.h># include "system.h"# include "altera_avalon_lan91c111_regs.h" int main(void) { int a,b,c; // Select Bank1 IOWR_ALTERA_AVALON_LAN91C111_BSR(LAN91C111_LAN91C111_BASE,0x01); IOWR_ALTERA_AVALON_LAN91C111_CR(LAN91C111_BASE,0xA0B1 a=IORD_ALTERA_AVALON_LAN91C111_CR(LAN91C111_BASE); printf("Configuration Register = %x\n",a); // Read Control Reg b=IORD_ALTERA_AVALON_LAN91C111_CTR(LAN91C111_BASE); printf("Control Register default = %x\n",a); // Write 1214 in control register IOWR_ALTERA_AVALON_LAN91C111_CTR(LAN91C111_BASE,0x1214); b=IORD_ALTERA_AVALON_LAN91C111_CTR(LAN91C111_BASE); printf("Control Register = %x\n",a); return(0); }Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page