Yahoo Groups archive

Lpc2000

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

Thread

CS8900A question

CS8900A question

2005-07-11 by Ian Wraith

Hello
      I am currently writing some low level code for interfacing the
LPC2124 to a CS8900A (it is an Olimex LPC2124 board). I am basing my
code around that on the Rowley Associates website. There are no
problems initialising the CS8900 and I can even read its EISA company
ID correctly. The problem comes when I poll the CS8900 to see if a
frame is waiting. My initial code used the RxEvent (0x0124) register ..

cs8900a_write(ADD_PORT,PP_RxEvent);
u=cs8900a_read_addr_high_first(DATA_PORT);

(where DATA_PORT is 0x0c)

this works fine. But when I tried to read the RXLength (0x402) word
I just received garbage. So to try and diagnose this I thought I
would try and read the RxStatus (0x400) word which according to the
datasheet should be the same as the RxEvent word. But when I tried the
code ..

cs8900a_write(ADD_PORT,PP_RxStatus);
u=cs8900a_read_addr_high_first(DATA_PORT);

I again get garbage and a result different to that contained in
Rx_Event.

  Can anyone tell me where I'm going wrong here ? Its very odd how I
can read data from some locations but not others.

Regards

Ian

RE: [lpc2000] CS8900A question

2005-07-11 by Paul Curtis

Ian,

Does the original port of the uIP code to the CS8900A run correctly on
your board?  You do have an LPC-E2124?

-- Paul. 
Show quoted textHide quoted text
> -----Original Message-----
> From: Ian Wraith [mailto:i.wraith@...] 
> Sent: 11 July 2005 10:42
> To: lpc2000@yahoogroups.com
> Subject: [lpc2000] CS8900A question
> 
> Hello
>       I am currently writing some low level code for interfacing the
> LPC2124 to a CS8900A (it is an Olimex LPC2124 board). I am 
> basing my code around that on the Rowley Associates website. 
> There are no problems initialising the CS8900 and I can even 
> read its EISA company ID correctly. The problem comes when I 
> poll the CS8900 to see if a frame is waiting. My initial code 
> used the RxEvent (0x0124) register ..
> 
> cs8900a_write(ADD_PORT,PP_RxEvent);
> u=cs8900a_read_addr_high_first(DATA_PORT);
> 
> (where DATA_PORT is 0x0c)
> 
> this works fine. But when I tried to read the RXLength 
> (0x402) word I just received garbage. So to try and diagnose 
> this I thought I would try and read the RxStatus (0x400) word 
> which according to the datasheet should be the same as the 
> RxEvent word. But when I tried the code ..
> 
> cs8900a_write(ADD_PORT,PP_RxStatus);
> u=cs8900a_read_addr_high_first(DATA_PORT);
> 
> I again get garbage and a result different to that contained 
> in Rx_Event.
> 
>   Can anyone tell me where I'm going wrong here ? Its very 
> odd how I can read data from some locations but not others.
> 
> Regards
> 
> Ian
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
>

re: CS8900A question

2005-07-11 by Ian Wraith

Hello
      I tried compilng the uIP code but it came up with a number of
errors. To tell you the truth I wasn't to bothered about these as
I just wanted the code to use the CS8900 low level interface code as
I want to have a go at writing my own limited interface stack.

  The cs8900a_init function was fine but the cs8900a_poll function was
indicating a frame was ready at all times even when I had no network
connected. The problem seemed to be this ..

   if ((cs8900a_read(DATA_PORT) & 0xd00) == 0)
     return 0;

as this isn't checking the status of bit 8 the RxOK bit which indicates
a valid frame is waiting. When I changed this to ..

u=cs8900a_read_addr_high_first(DATA_PORT);
// Check if the RxOK flag is set //
if ((u&RX_OK)==0) return 0;
// Now check that either the Broadcast or Individual Addr bits are set
if ((u&(RX_BROADCAST_ACCEPT+RX_IA_ACCEPT))==0) return 0;

all was well but I still can't read the value of the RxLength word.
The original code did this ..

   // Read receiver status and discard it.
   cs8900a_read_addr_high_first(RX_FRAME_PORT);

   // Read frame length
   len = cs8900a_read_addr_high_first(RX_FRAME_PORT);

but that just returns garbage in the form of an alternating pattern
of 1's and 0's.

  Oh and yes I do have an LPC-E2124.

  But I might be missing something as it is just far to hot to think
at the moment :(

Regards

Ian

Re: CS8900A question

2005-07-11 by ian_wraith

Hello

--- In lpc2000@yahoogroups.com, Ian Wraith <i.wraith@s...> wrote:
> There are no problems initialising the CS8900 and I can even read 
> its EISA company ID correctly. 

 I have just double checked this and it seems I can't read the
company ID correctly after all. When I check this my program returns
a value of 0x6355 where as the actual value should be 0x630E. So
I can read the first byte correctly but the lower one is always
0x55 (an alternating pattern of 0's and 1's). My problem therefore
is in the code that reads a word from the CS8900.

 My apologies for wasting peoples time.

Regards

Ian

RE: [lpc2000] Re: CS8900A question

2005-07-11 by Luciano Almeida

I had the same problem.

Solution: insert some delay cycles between the write and the read. (I put :
static int dummy = 1;
#define delay()	{int
delayCtr=0;for(delayCtr=0;delayCtr<10;delayCtr++){dummy+=dummy;dummy+=delay;
}}
) and didn't give a second tought about it. (yes, it's dumb, but it seems to
work. Yes, it can be improved).

What can be? I think it has something to do about the pin toggle time (lower
than the time between the read and the write of de arm) or to the timings of
the CS8900 (I think it says something like 135 ns between the write and read
times). (This is a guess, remember.)

As you can guess, I didn't investigate it...

Funny thing is that I only saw this with the GCC, when I tried the
crossworks, the code worked. (I used the uIP and FreeRTOS).

Best of lucks,

Luciano
Show quoted textHide quoted text
> -----Original Message-----
> From: lpc2000@yahoogroups.com 
> [mailto:lpc2000@yahoogroups.com] On Behalf Of ian_wraith
> Sent: Monday, July 11, 2005 4:17 PM
> To: lpc2000@yahoogroups.com
> Subject: [lpc2000] Re: CS8900A question
> 
> Hello
> 
> --- In lpc2000@yahoogroups.com, Ian Wraith <i.wraith@s...> wrote:
> > There are no problems initialising the CS8900 and I can 
> even read its 
> > EISA company ID correctly.
> 
>  I have just double checked this and it seems I can't read 
> the company ID correctly after all. When I check this my 
> program returns a value of 0x6355 where as the actual value 
> should be 0x630E. So I can read the first byte correctly but 
> the lower one is always
> 0x55 (an alternating pattern of 0's and 1's). My problem 
> therefore is in the code that reads a word from the CS8900.
> 
>  My apologies for wasting peoples time.
> 
> Regards
> 
> Ian
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
>

Re: CS8900A question

2005-07-12 by ian_wraith

Hello Luciano
             Many thanks for your mail. I added a delay where you
suggested and everything worked fine. Later I suppose I will
have to fine tune the program to make the delay as short as
possible but right now I am just happy to be able to read data
from the CS8900A.

Thanks Again.

Ian

Re: [lpc2000] Re: CS8900A question

2005-11-02 by rseku

I think I have the same problem with CS8900A.
I use MAM=full, and cclk=60MHz
Could You please explain where this delay loop should be added:
1. between bits toggling I0SET=IOW, and I0CLR=IOW
2. between cs8900_read() and cs8900_write() functions

robert

Luciano Almeida wrote:
Show quoted textHide quoted text
> I had the same problem.
> 
> Solution: insert some delay cycles between the write and the read. (I put :
> static int dummy = 1;
> #define delay()	{int
> delayCtr=0;for(delayCtr=0;delayCtr<10;delayCtr++){dummy+=dummy;dummy+=delay;
> }}
> ) and didn't give a second tought about it. (yes, it's dumb, but it seems to
> work. Yes, it can be improved).
> 
> What can be? I think it has something to do about the pin toggle time (lower
> than the time between the read and the write of de arm) or to the timings of
> the CS8900 (I think it says something like 135 ns between the write and read
> times). (This is a guess, remember.)
> 
> As you can guess, I didn't investigate it...
> 
> Funny thing is that I only saw this with the GCC, when I tried the
> crossworks, the code worked. (I used the uIP and FreeRTOS).
> 
> Best of lucks,
> 
> Luciano
> 
> 
>>-----Original Message-----
>>From: lpc2000@yahoogroups.com 
>>[mailto:lpc2000@yahoogroups.com] On Behalf Of ian_wraith
>>Sent: Monday, July 11, 2005 4:17 PM
>>To: lpc2000@yahoogroups.com
>>Subject: [lpc2000] Re: CS8900A question
>>
>>Hello
>>
>>--- In lpc2000@yahoogroups.com, Ian Wraith <i.wraith@s...> wrote:
>>
>>>There are no problems initialising the CS8900 and I can 
>>
>>even read its 
>>
>>>EISA company ID correctly.
>>
>> I have just double checked this and it seems I can't read 
>>the company ID correctly after all. When I check this my 
>>program returns a value of 0x6355 where as the actual value 
>>should be 0x630E. So I can read the first byte correctly but 
>>the lower one is always
>>0x55 (an alternating pattern of 0's and 1's). My problem 
>>therefore is in the code that reads a word from the CS8900.
>>
>> My apologies for wasting peoples time.
>>
>>Regards
>>
>>Ian
>>
>>
>>
>>
>> 
>>Yahoo! Groups Links
>>
>>
>>
>> 
>>
>>
>>
>>
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
>

Re: [lpc2000] Re: CS8900A question

2005-11-03 by Michael Anburaj

Robert,

I wrote the CS8900A driver myself & using it with
LPC2106. LPC2106 p0.16 has issues, other than that at
-O2 optimisation level & GCC I had to add 4 nops after
bring the RD low.

like this,

rd_low
nop
nop
nop
nop
read_data
rd_high

Other than this pretty much everything is toggled at
high speeds & it works great.

Cheers,
-Mike.

--- rseku <rseku@...> wrote:

> I think I have the same problem with CS8900A.
> I use MAM=full, and cclk=60MHz
> Could You please explain where this delay loop
> should be added:
> 1. between bits toggling I0SET=IOW, and I0CLR=IOW
> 2. between cs8900_read() and cs8900_write()
> functions
> 
> robert
> 
> Luciano Almeida wrote:
> 
> > I had the same problem.
> > 
> > Solution: insert some delay cycles between the
> write and the read. (I put :
> > static int dummy = 1;
> > #define delay()	{int
> >
>
delayCtr=0;for(delayCtr=0;delayCtr<10;delayCtr++){dummy+=dummy;dummy+=delay;
> > }}
> > ) and didn't give a second tought about it. (yes,
> it's dumb, but it seems to
> > work. Yes, it can be improved).
> > 
> > What can be? I think it has something to do about
> the pin toggle time (lower
> > than the time between the read and the write of de
> arm) or to the timings of
> > the CS8900 (I think it says something like 135 ns
> between the write and read
> > times). (This is a guess, remember.)
> > 
> > As you can guess, I didn't investigate it...
> > 
> > Funny thing is that I only saw this with the GCC,
> when I tried the
> > crossworks, the code worked. (I used the uIP and
> FreeRTOS).
> > 
> > Best of lucks,
> > 
> > Luciano
> > 
> > 
> >>-----Original Message-----
> >>From: lpc2000@yahoogroups.com 
> >>[mailto:lpc2000@yahoogroups.com] On Behalf Of
> ian_wraith
> >>Sent: Monday, July 11, 2005 4:17 PM
> >>To: lpc2000@yahoogroups.com
> >>Subject: [lpc2000] Re: CS8900A question
> >>
> >>Hello
> >>
> >>--- In lpc2000@yahoogroups.com, Ian Wraith
> <i.wraith@s...> wrote:
> >>
> >>>There are no problems initialising the CS8900 and
> I can 
> >>
> >>even read its 
> >>
> >>>EISA company ID correctly.
> >>
> >> I have just double checked this and it seems I
> can't read 
> >>the company ID correctly after all. When I check
> this my 
> >>program returns a value of 0x6355 where as the
> actual value 
> >>should be 0x630E. So I can read the first byte
> correctly but 
> >>the lower one is always
> >>0x55 (an alternating pattern of 0's and 1's). My
> problem 
> >>therefore is in the code that reads a word from
> the CS8900.
> >>
> >> My apologies for wasting peoples time.
> >>
> >>Regards
> >>
> >>Ian
> >>
> >>
> >>
> >>
> >> 
> >>Yahoo! Groups Links
> >>
> >>
> >>
> >> 
> >>
> >>
> >>
> >>
> > 
> > 
> > 
> > 
> >  
> > Yahoo! Groups Links
> > 
> > 
> > 
> >  
> > 
> > 
> > 
> 
> 
> 



	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

Re: [lpc2000] Re: CS8900A question

2005-11-03 by rseku

What about TD?
when writing You put
TD_low
TD_high
Do You put nop between?
When I initialize CS8900 with code like this:
   cs8900a_write(ADD_PORT, PP_SelfCTL);
   cs8900a_write(DATA_PORT, POWER_ON_RESET);

   // Wait until chip-reset is done
   cs8900a_write(ADD_PORT, PP_SelfST);
   do{
   debug = cs8900a_read(DATA_PORT);
   }while((debug & INIT_DONE) == 0) ;
I'm expecting to get debug value of 11(010110)
where (010110) identifies PP_selfST register I'm querring.
Instead I get (011001) which is Test register ?!



robert
Michael Anburaj wrote:
Show quoted textHide quoted text
> Robert,
> 
> I wrote the CS8900A driver myself & using it with
> LPC2106. LPC2106 p0.16 has issues, other than that at
> -O2 optimisation level & GCC I had to add 4 nops after
> bring the RD low.
> 
> like this,
> 
> rd_low
> nop
> nop
> nop
> nop
> read_data
> rd_high
> 
> Other than this pretty much everything is toggled at
> high speeds & it works great.
> 
> Cheers,
> -Mike.
> 
> --- rseku <rseku@...> wrote:
> 
> 
>>I think I have the same problem with CS8900A.
>>I use MAM=full, and cclk=60MHz
>>Could You please explain where this delay loop
>>should be added:
>>1. between bits toggling I0SET=IOW, and I0CLR=IOW
>>2. between cs8900_read() and cs8900_write()
>>functions
>>
>>robert
>>
>>Luciano Almeida wrote:
>>
>>
>>>I had the same problem.
>>>
>>>Solution: insert some delay cycles between the
>>
>>write and the read. (I put :
>>
>>>static int dummy = 1;
>>>#define delay()	{int
>>>
>>
> delayCtr=0;for(delayCtr=0;delayCtr<10;delayCtr++){dummy+=dummy;dummy+=delay;
> 
>>>}}
>>>) and didn't give a second tought about it. (yes,
>>
>>it's dumb, but it seems to
>>
>>>work. Yes, it can be improved).
>>>
>>>What can be? I think it has something to do about
>>
>>the pin toggle time (lower
>>
>>>than the time between the read and the write of de
>>
>>arm) or to the timings of
>>
>>>the CS8900 (I think it says something like 135 ns
>>
>>between the write and read
>>
>>>times). (This is a guess, remember.)
>>>
>>>As you can guess, I didn't investigate it...
>>>
>>>Funny thing is that I only saw this with the GCC,
>>
>>when I tried the
>>
>>>crossworks, the code worked. (I used the uIP and
>>
>>FreeRTOS).
>>
>>>Best of lucks,
>>>
>>>Luciano
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>From: lpc2000@yahoogroups.com 
>>>>[mailto:lpc2000@yahoogroups.com] On Behalf Of
>>
>>ian_wraith
>>
>>>>Sent: Monday, July 11, 2005 4:17 PM
>>>>To: lpc2000@yahoogroups.com
>>>>Subject: [lpc2000] Re: CS8900A question
>>>>
>>>>Hello
>>>>
>>>>--- In lpc2000@yahoogroups.com, Ian Wraith
>>
>><i.wraith@s...> wrote:
>>
>>>>>There are no problems initialising the CS8900 and
>>
>>I can 
>>
>>>>even read its 
>>>>
>>>>
>>>>>EISA company ID correctly.
>>>>
>>>>I have just double checked this and it seems I
>>
>>can't read 
>>
>>>>the company ID correctly after all. When I check
>>
>>this my 
>>
>>>>program returns a value of 0x6355 where as the
>>
>>actual value 
>>
>>>>should be 0x630E. So I can read the first byte
>>
>>correctly but 
>>
>>>>the lower one is always
>>>>0x55 (an alternating pattern of 0's and 1's). My
>>
>>problem 
>>
>>>>therefore is in the code that reads a word from
>>
>>the CS8900.
>>
>>>>My apologies for wasting peoples time.
>>>>
>>>>Regards
>>>>
>>>>Ian
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>Yahoo! Groups Links
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>> 
>>>Yahoo! Groups Links
>>>
>>>
>>>
>>> 
>>>
>>>
>>>
>>
>>
>>
> 
> 
> 
> 	
> 		
> __________________________________ 
> Yahoo! Mail - PC Magazine Editors' Choice 2005 
> http://mail.yahoo.com
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
>

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.