Hallo,
ich habe eben auf Steckbrett die Schaltung gemäß Tutorial
(http://www.mikrocontroller.net/articles/NRF24L01_Tutorial) aufgebaut.
Leider bringe ich einfach keine Übertragung zustande...
Um die Hardware zu prüfen, habe ich auf Sender und Empfänger-Seite
jeweils den Kanal ausgelesen. Funktionierte bei beiden ohne Probleme.
Nun möchte ich jedoch testweise ein Byte übertragen und mithilfe von
LEDs ausgeben. Diese bleiben jedoch immer dunkel...
Hier mal der Code für den Empfänger - bin ich nur blind?
1 | /*
|
2 | * nRF24L01_Tutorial_RX.c
|
3 | *
|
4 | * Created: 06.01.2012 22:51:57
|
5 | * Author: Ernst Buchmann
|
6 | */
|
7 | #define F_CPU 8000000UL
|
8 |
|
9 | #include <avr/io.h>
|
10 | #include <avr/interrupt.h>
|
11 | #include <util/delay.h>
|
12 | #include <stdlib.h>
|
13 | #include <string.h>
|
14 | #include "spi.h"
|
15 | #include "wl_module.h"
|
16 | #include "nRF24L01.h"
|
17 |
|
18 | //Variablen
|
19 | volatile uint8_t PTX; //Global Variable
|
20 | char itoabuffer[20];
|
21 |
|
22 | int main(void)
|
23 | {
|
24 | uint8_t payload[wl_module_PAYLOAD]; //holds the payload
|
25 | uint8_t nRF_status; //STATUS information of nRF24L01+
|
26 | uint8_t zaehler = 0;
|
27 |
|
28 | wl_module_init(); //Init nRF Module
|
29 | _delay_ms(50); //wait for Module
|
30 | sei(); //activate Interrupts
|
31 | wl_module_config(); //config nRF as RX Module, simple Version
|
32 |
|
33 | DDRC = 0xff;
|
34 |
|
35 | while(1)
|
36 | {
|
37 | while (!wl_module_data_ready()); //waits for RX_DR Flag in STATUS
|
38 | nRF_status = wl_module_get_data(payload); //reads the incomming Data to Array payload
|
39 | PORTC = payload[0];
|
40 | }
|
41 | }
|
Da ich weder einen sicher funktionierenden Empfänger noch Sender habe,
tue ich mir mit der Fehlersuche sehr schwer. Wo kann ich noch ansetzen?
Danke & Gruß
Michael