Hallo,
Versuche an meinem ATTiny85 nen Max2771 via SPI zum anzusteuern. Aber
irgendwie kann den Compiler die SPI Register nicht auflösen.
1 | #include <avr/io.h>
|
2 | #include <avr/interrupt.h>
|
3 | #include <stdio.h>
|
4 | #include <stdlib.h>
|
5 | #include <stddef.h>
|
6 | #define F_CPU 1000000
|
7 | #include <util/delay.h>
|
8 |
|
9 | void SPI_MasterInit(void)
|
10 | {
|
11 | /* Set MOSI and SCK and SS output, all others input */
|
12 | DDRB = (1 << DDB0) | (1 << DDB2) | (1 << DDB3);
|
13 |
|
14 | /* Enable SPI, Master, */
|
15 | SPCR = (1 << SPE) | (1 << MSTR);
|
16 | }
|
Bekomme dann:
1 | Error 1 'SPCR' undeclared (first use in this function)
|
Werde wohl nur irgendwas dummes übersehen haben oder?
Vielen Dank