Reply by Jean-Jacques Dauchot November 14, 20072007-11-14
Hi

Thanks for that, I understand the principle.

But this could be tricky if you are writing and reading registers in the
same process.

You could get data packets out of sequence

Regards

Jean-Jacques

._,___

An Engineer's Guide to the LPC2100 Series

Reply by geeseelam November 13, 20072007-11-13
In my particular application, I have left the pin float and observed
it on a scope and logic analyzer. Any luck?

Regards,
Chris

--- In l..., "jdauchot" wrote:
>
> Hi
>
> I use the code from a NXP application note.
>
> Does this SSEL0 pin has to be pulled up to VCC or is it done
already
> done on chip?
>
> Regards
> Jean-Jacques
> --- In l..., "geeseelam"
> wrote:
> >
> > --- In l..., "jdauchot" wrote:
> > >
> > > Do I really need to loopback to monitor the signals on a
scope ?
> > >
> > >
> > > Jean-Jacques
> > >
> >
> > Hi,
> >
> > I've used the SPI port on the LPC2132 and I have verified the
> > signals using a Logic Analyzer without looping back the signals
or
> > connecting them to another SPI port.
> >
> > I noticed in your original post that you attempting to setup the
> SPI
> > as a master but have also configured the IO for SSEL (PINSEL > > 0x5500). The User's Manual for the LPC2132 (chp. 12-3) states
that
> > SSEL is only an input. I believe that I had an issue where the
SPI
> > would not send out any information if it's setup to be a master
and
> > SSEL IO is chosen.
> >
> > If you really want the SPI to be a Master, try not setting up
the
> > SSEL functionality (PINSEL |= 0x1500).
> >
> > Chris
>
Reply by Alexandre Kremer November 13, 20072007-11-13
> So if I want to read from a register I got to send
> the address of the
> register on the bus than send it again to clock its
> data in the LPC2000.
>
> Is this correct?
>
>
>
> Regards
>
>
>
> Jean-Jacques
>
>
Hi

The way you are thinking is half duplex mode, wich is
when you send the register address on one clock burts
sequence and then you must drive another clock burst
with no valid info to read the devices response.
To work in full duplex mode, you need to send the
next address and on the same clock burst youll have
the last address data response. For a raw example,
your code starts and you want ro read the register
address 0x01, so you send this address on the bus, and
dont read nothing, because the program just strated
now. So, the next address you want to read is 0x02, so
when you send 0x02 on the bus, you can read the answer
from the previous address (0x01), on the same clock
burst used to transmit the 0x02, and this goes on.

Hope this helps
Abra sua conta no Yahoo! Mail, o ico sem limite de espa para armazenamento!
http://br.mail.yahoo.com/
Reply by Jean-Jacques Dauchot November 13, 20072007-11-13
Hi Chris

Yes I got it going now, thanks.

Now, I have got to learn how to use SPI protocol

I want to use analog devices AD7708.

I understand that you can receive data while sending data at the same time.
But the master drives the clock

So if I want to read from a register I got to send the address of the
register on the bus than send it again to clock its data in the LPC2000.

Is this correct?

Regards

Jean-Jacques

>>In my particular application, I have left the pin float and observed
>>it on a scope and logic analyzer. Any luck?

>>Regards,
>>Chris

_,_._,___
Reply by jdauchot November 10, 20072007-11-10
Hi

I use the code from a NXP application note.

Does this SSEL0 pin has to be pulled up to VCC or is it done already
done on chip?

Regards
Jean-Jacques
--- In l..., "geeseelam"
wrote:
>
> --- In l..., "jdauchot" wrote:
> >
> > Do I really need to loopback to monitor the signals on a scope ?
> >
> >
> > Jean-Jacques
> > Hi,
>
> I've used the SPI port on the LPC2132 and I have verified the
> signals using a Logic Analyzer without looping back the signals or
> connecting them to another SPI port.
>
> I noticed in your original post that you attempting to setup the
SPI
> as a master but have also configured the IO for SSEL (PINSEL > 0x5500). The User's Manual for the LPC2132 (chp. 12-3) states that
> SSEL is only an input. I believe that I had an issue where the SPI
> would not send out any information if it's setup to be a master and
> SSEL IO is chosen.
>
> If you really want the SPI to be a Master, try not setting up the
> SSEL functionality (PINSEL |= 0x1500).
>
> Chris
>
Reply by geeseelam November 9, 20072007-11-09
--- In l..., "jdauchot" wrote:
>
> Do I really need to loopback to monitor the signals on a scope ?
> Jean-Jacques
>

Hi,

I've used the SPI port on the LPC2132 and I have verified the
signals using a Logic Analyzer without looping back the signals or
connecting them to another SPI port.

I noticed in your original post that you attempting to setup the SPI
as a master but have also configured the IO for SSEL (PINSEL 0x5500). The User's Manual for the LPC2132 (chp. 12-3) states that
SSEL is only an input. I believe that I had an issue where the SPI
would not send out any information if it's setup to be a master and
SSEL IO is chosen.

If you really want the SPI to be a Master, try not setting up the
SSEL functionality (PINSEL |= 0x1500).

Chris
Reply by geeseelam November 9, 20072007-11-09
Jean-Jacques,

Yes you can see the SPI outputs on the scope. I have done this.

In your original code post it appears that you are setting up the SPI
in master mode, but you've configured all of the SPI pins for SPI mode
including the SSEL pin (PINSEL0=0x5500;)

The User Manual says that SSEL is an input only pin. (Chapter 12
section 3). When I first starting working with the SPI interface it
wouldn't work if I configured it as a Master and the pin as SSEL. If
you want the SPI to be a Master, try setting PINSEL |= 0x1500.

Regards
Reply by Leon November 8, 20072007-11-08
----- Original Message -----
From: "Jean-Jacques Dauchot"
To:
Sent: Thursday, November 08, 2007 8:52 PM
Subject: RE: [lpc2000] Re: First time programming SPI on LPC2000
> Sorry, but I fail to understand this, I should be able to see the CLK
> output
> and the data going out without looping back

If you loopback you can check that the data are coming back OK, using the
debugger.

Leon
Reply by Jean-Jacques Dauchot November 8, 20072007-11-08
Sorry, but I fail to understand this, I should be able to see the CLK output
and the data going out without looping back

Bit like looking at a UART port output?

Jean-Jacques

> Do I really need to loopback to monitor the signals on a scope ?

Yes. Think of SPI as being two connected shift registers, one on the master
and one on the slave.

Leon
Reply by Leon November 8, 20072007-11-08
----- Original Message -----
From: "jdauchot"
To:
Sent: Thursday, November 08, 2007 8:01 PM
Subject: [lpc2000] Re: First time programming SPI on LPC2000
> Do I really need to loopback to monitor the signals on a scope ?

Yes. Think of SPI as being two connected shift registers, one on the master
and one on the slave.

Leon