SPI on LPC2106 and 9bits transfer

Started by "Ezequiel L. Aceto" March 15, 2007
Hello,

I'm connection my 2106 with a device that uses a 9bit interface. How
can I use the hardware SPI with this device? I can do a software
Master SPI, but will be slow.

Also, I thought about turning SPI off, send one bit, the turn on and
send the rest, but this is not correct two.

How is the maximun speed I can get toogling a Pin at using 10Mhz
Crystal, and all the busses clock to 60Mhz? May be I can get a few MHz
(at least one) and use the software SPI version.

Thanks
Ezequiel

An Engineer's Guide to the LPC2100 Series

Ezequiel L. Aceto Wrote
>I'm connection my 2106 with a device that uses a 9bit interface. How
>can I use the hardware SPI with this device? I can do a software
>Master SPI, but will be slow.

The usual way is to send 16bits. Check the data sheet for your device,
they will usually accept data in multiples of 8 bits. The usual case for a
9 bit device would be to accept between 9 and 16 bits and take either the
last 9 or the first 9 when the chip is deselected. It's a rare chip indeed
that insists on 9 and only 9 bits in per select.

Robert
--------------------------------
mail2web.com - Microsoft Exchange solutions from a leading provider -
http://link.mail2web.com/Business/Exchange
--- In l..., "Ezequiel L. Aceto" wrote:
>
> Hello,
>
> I'm connection my 2106 with a device that uses a 9bit interface. How
> can I use the hardware SPI with this device? I can do a software
> Master SPI, but will be slow.
>
> Also, I thought about turning SPI off, send one bit, the turn on and
> send the rest, but this is not correct two.
>
> How is the maximun speed I can get toogling a Pin at using 10Mhz
> Crystal, and all the busses clock to 60Mhz? May be I can get a few MHz
> (at least one) and use the software SPI version.
>
> Thanks
> Ezequiel
>
Ezequiel,
if I remember correctly, the LPC2106 was a fixed 8-bit SPI only. This
would indicate that you need to use a newer device to have the 9-bit
option. E.g. the LPC213x would support this option.
Bob
Yes Ezequiel.
Youre right!!!
Just to indicate the part of the datasheet that has this informations:

[http://www.nxp.com/acrobat_download/usermanuals/UM_LPC2106_2105_2104_
1.pdf]

PAGE 123:
Maximum data bit rate of one eighth of the input clock rate.

Page 129:
SPI Data Register (SPDR - 0xE0020008) 7:0 Data

As you said, LPC2106 only supports 8-bit data transfer on SPI.
Work with 2138 or 2129
;)

Cheers

--- In l..., "lpc2100_fan" wrote:
>
> --- In l..., "Ezequiel L. Aceto"
wrote:
> >
> > Hello,
> >
> > I'm connection my 2106 with a device that uses a 9bit interface.
How
> > can I use the hardware SPI with this device? I can do a software
> > Master SPI, but will be slow.
> >
> > Also, I thought about turning SPI off, send one bit, the turn on
and
> > send the rest, but this is not correct two.
> >
> > How is the maximun speed I can get toogling a Pin at using 10Mhz
> > Crystal, and all the busses clock to 60Mhz? May be I can get a
few MHz
> > (at least one) and use the software SPI version.
> >
> > Thanks
> > Ezequiel
> >
> Ezequiel,
> if I remember correctly, the LPC2106 was a fixed 8-bit SPI only.
This
> would indicate that you need to use a newer device to have the 9-bit
> option. E.g. the LPC213x would support this option.
> Bob
>
tpfslima Wrote
>Page 129:
>SPI Data Register (SPDR - 0xE0020008) 7:0 Data
>
>As you said, LPC2106 only supports 8-bit data transfer on SPI.

While that's true. It's not really a limitation. I don't think I've seen
a chip in quite some time that insists on non-8bit multiples. For instance
I've worked recently with TI A/Ds which wanted 11 bits as I recall and a
switch input chip from one of motorola's descendants that wanted 21 bits.
Both were quite happy to accept 16 and 24 bits respectively (and yes, I've
uses both on a 2106). I would be a little surprised if the OPs chip
wouldn't work with 16bits, it would just require figuring out which 9 bits
to use.

Robert
--------------------------------
mail2web LIVE Free email based on Microsoft Exchange technology -
http://link.mail2web.com/LIVE