Hi everyone,
I´m student and everything about embedded systems & my LPC is completle new for me.(I am using an LPC 2194 with ECO-arm / WIN-arm compiler.) I´ve got some programming experience but it seems: not enough. (VBA rather good; C= total beginner). So I would also appreciate every hint t good tutorials and other help.
Besides these probs the most urgent is: Getting the SPI to work (i general) and with a ADIS16350 (Gyro)Sensor. I´ve worked my my through th common examples (and most of them worked) but I´m not getting the rea thing to work. This is how far I´ve come. I know it´s not much but eve a "throw it all away" helps ;-). Thanks!
static void spi_init(void) { Intern_pinsel0 |= 0x1500; // enable SPI pins Intern_spcr = 0x20; // set master mode Intern_spccr = 8; // SCK =pclk/10 }
int main(void) { while (1) { spi_init(); dtareg = S0SPDR; printf("%i\n", dtareg); delay(250); } putchar('\n'); if (errno&0x08) puts("--ERROR: Slave abort"); if (errno&0x10) puts("--ERROR: Mode fault"); if (errno&0x20) puts("--ERROR: Read overrun"); if (errno&0x40) puts("--ERROR: Write collision"); abort(); }