// NOW is RUNNING!!! YEAAAHHH :))
// Great thanks to LEON HELLER and Mr. RICHARD
// I have help usefull help for running lpc2106-spi in master mode
// see YAHOO group : 'LPC2100'
// the runnig-key was to define SSEL and pull-up the pin
#include <LPC210x.H>
int main (void) {
unsigned char pin;
//---------------------------------------------------
// quartz 20Mhz, M=3, P=2, cclk=60Mhz
// measured consumption : about 52mA
//---------------------------------------------------
//---------------------------------------------------
// my flash and access setup preference
MAMCR = 2;
MAMTIM = 4;
//---------------------------------------------------
//---------------------------------------------------
// i want try full peripheral speed
VPBDIV = 1; // full peripheral clock rate
//---------------------------------------------------
IODIR = 0xF8; // one's -> define Outputs
IOSET = 0x80;
//PINSEL0 = 0x1500; // NO SSEL defined for spi -
> NO activity on spi-pins
PINSEL0 = 0x5500; // all spi pin defined (SSEL
pulluped at 1) -> activity on spi-pins
SPI_SPCCR = 8; // max rate spi (60Mhz/8 =
7.5Mhz -> 0.1333...nsec./bit)
SPI_SPCR = 0x20; // master mode
pin = 0;
while (1) {
if (pin) IOSET = 0x08; else IOCLR = 0x08; //
marker on p0.3
pin ^= 1;
SPI_SPDR = 0x55; // NOW I see
activity !!! uaoooo!!!
// 1
byte in about 1usec. :))
while((SPI_SPSR & 0x80)==0); // wait end of
spi-transfer
}
}Message
SPI - GREAT THANK's to LEON and RICHARD :))
2003-12-12 by arturo_tramontini
Attachments
- No local attachments were found for this message.