Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: olimex LPC-E2294 with ethernet

2005-02-07 by Gus

Paul,

> chip is always selected using /CHIPSEL as it will only present or 
> latch data on an IOR or IOW strobe.

Yes that is correct but we have FLASH and RAM on the bus!!! when RD 
is strobed for RAM read, the ethernet chip will access the data bus. 
I could be wrong somehow!

I am trying to do it in 8-bit now, was 16!! I just want to get it to 
work for a starter. I am using the code posted on olimex website

unsigned short cs8900a_read(unsigned addr)
{
  unsigned short Data1,Data2;
  pAdd_CS = (unsigned char*)(CS8900A_BASE+addr);
  Data1 = *pAdd_CS;
  Data2 = ((*++pAdd_CS) << 8);
  return(Data1|Data2);
  // the folowing should work as well since we have 16 bit bus
 // return *((unsigned short *)(CS8900A_BASE+addr));
}
void cs8900a_write(unsigned addr, unsigned int data)
{
  pAdd_CS = (unsigned char*)(CS8900A_BASE+addr);
  *pAdd_CS = data;
  ++pAdd_CS;
  *pAdd_CS = data>>8;
}

void cs8900a_init(void)
{
int i;
// I am using this since the folowing code will not work   
BCFG2=0x00003501;
 /*
  // CS8900A 8bit; 
  BCFG2_bit.MW = 0;
  // IDCY = 1+1 ~ 33ns 
  BCFG2_bit.IDCY=1;
  // WST1 = 8+3 (read)  ~183ns
  BCFG2_bit.WST1=8;
  // WST2 = 6+1 (write) ~ 117ns
  BCFG2_bit.WST2=6;
  // RBLE = 1 - ako e 0 ne zapiswa
  BCFG2_bit.RBLE = 1;
  // WP =0, BM = 0
  BCFG2_bit.WP = BCFG2_bit.BM = 0;
//*/
// this code was not changed from the example
  // P3.25 - CS2 (CS8900A)
  // P3.0 - A0
  PINSEL2 |= 0x00804000;
//read chip id
 cs8900a_write(ADD_PORT,0);
  i = cs8900a_read(DATA_PORT);
  if (i != CRYSTAL_SEMI_ID)
    while(1);
// read revesion
  cs8900a_write(ADD_PORT,0x2);
  i = cs8900a_read(0xC);
// i will still be the "manufacture id" no matter what register I 
select



Gus

--- In lpc2000@yahoogroups.com, "Paul Curtis" <plc@r...> wrote:
> Gus,
>  
> > > > I spent all weekend trying to get the ethernet to work on 
olimex
> > LPC-
> > > > E2294 board http://www.olimex.com/dev/lpc-e2294.html with no 
luck
> > > > 
> > > > Looking at the board schematics, they have the Ethernet chip 
> > > > "selected" all the time through R57!!! This is WRONG!! I 
don't 
> > > > understand why!!! So I removed R57 and installed R56 
> > instead. Now, 
> > > > when I read the chip, I always get the "chip ID" no matter 
what 
> > > > register I select!
> 
> For register reads, I believe that is really doesn't matter that 
the
> chip is always selected using /CHIPSEL as it will only present or 
latch
> data on an IOR or IOW strobe.  However, I have not used the chip 
in its
> 16-bit mode; it looks like the registers are memory mapped to
> 0x0000'0300.
> 
> Can you post a small piece of code that reads and writes the 
registers?
> 
> --
> Paul Curtis, Rowley Associates Ltd  http://www.rowley.co.uk
> CrossWorks for MSP430, ARM, AVR and (soon) MAXQ processors

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.