--- In lpc2000@yahoogroups.com, "sebfr74" <sejacquemard@...> wrote: > > - My first problem is I don't find in the user manual what start the > SPI clock for a read. In other controler (ATMEL 89C51 for example, a > 0x00 write to the data register start the clock). I have not yet started my ARM SPI programs, but from the manual it looks like a write to the SPI data register starts the transfer. Remember that SPI is just a circular shift register with one part in the processor (usually 8 or 16 bits) and the rest in the SPI chip. So there are not separate reads and writes. All transfers do both. > - The second one is I have 8 clock bit on the SCLK line just at the > startup and before my first external interrupt (the one noramlly who > start the SPI read...). I don't understand why I have got these 8 > clock bits ? SPI transfers are controlled by the number of clocks when select is asserted, not the total number of clocks. SPI even works with a free running clock. Maybe the clock starts before the first transfer. After these clock the SPI seems to be blocked... Your code has S0SPCCR = 20; I think you want S0SPCCR = 0x20; Decimal 20 puts it in slave mode instead of master mode. -- Bob H.
Message
Re: problem on LPC2138 + SPI
2006-02-20 by bhorst
Attachments
- No local attachments were found for this message.