[Oberon] FPGA - nRF24L01 connection

Tomas Kral thomas.kral at email.cz
Thu Apr 12 19:27:50 CEST 2018


> Don’t know whether it helps, but according datasheet chapter 6.4 you
> should wait at least 170us after RX on until you can trust RPD.

Hi,

Need to learn about `RPD' first :-)

Meanwhile I was able to send a payload to RPI.
But, but, it can transfer every 10th packet, all other dropped, why is
that?
Also, the payload is 32 bytes, of which only 16 received???
Also, RPI receives payloads, only when addresses RX/TX
are reversed to Oberon setting, see below???

I checked some parameters on Oberon, I learnt only to read first byte
of each register, they see to match RPI setting.


================ SPI Configuration ================
CSN Pin  	 = CE0 (PI Hardware Driven)
CE Pin  	 = Custom GPIO25
Clock Speed	 = 4 Mhz
================ NRF Configuration ================
STATUS		 = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7
TX_FULL=0 RX_ADDR_P0-1	 = 0xc2c2c2c2c2 0xe7e7e7e7e7
RX_ADDR_P2-5	 = 0xe6 0xc2 0xe7 0xc2
TX_ADDR		 = 0xc2c2c2c2c2
RX_PW_P0-6	 = 0x20 0x20 0x20 0x20 0x20 0x20
EN_AA		 = 0x3f
EN_RXADDR	 = 0x3e
RF_CH		 = 0x05
RF_SETUP	 = 0x07
CONFIG		 = 0x7f
DYNPD/FEATURE	 = 0x00 0x00
Data Rate	 = 1MBPS
Model		 = nRF24L01+
CRC Length	 = 16 bits
PA Power	 = PA_MAX
Output below : 
Recv: size=0 payload=0123456789012345�� pipe=0	 Send: size=0
payload= pipe:0 Recv: size=0 payload=0123456789012345�� pipe=0
Send: size=0 payload= pipe:0 Recv: size=0 payload=0123456789012345��
pipe=0	 Send: size=0 payload= pipe:0 Recv: size=0
payload=0123456789012345�� pipe=0	 Send: size=0 payload= pipe:0
Recv: size=0 payload=0123456789012345�� pipe=0	 Send: size=0
payload= pipe:0 Recv: size=0 payload=0123456789012345�� pipe=0
Send: size=0 payload= pipe:0

The ping Oberon code, borrows from SendPacket.

PROCEDURE Ping*;
    VAR plstr: ARRAY 32 OF CHAR; i: INTEGER;
      payload: ARRAY SubPacket OF BYTE; timeout: BOOLEAN;
  BEGIN    
    plstr := "0123456789012345678901234567890";
    SYSTEM.COPY(SYSTEM.ADR(plstr), SYSTEM.ADR(payload), 4);
    i := Kernel.Time() + Wait;
    REPEAT SCC.SPICtrl({netEnable, netSelect}); SCC.SPI(0FFH);
SCC.SPICtrl({netE nable}) (*NOP*)
    UNTIL Kernel.Time() >= i;
    SCC.Listen(FALSE);
    SCC.SubSnd(SYSTEM.ADR(payload), timeout); SCC.Listen(TRUE);
    IF timeout THEN Texts.WriteString(W, " timed") ELSE
Texts.WriteString(W, " done") END;
    Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf)
  END Ping;

-- 
Tomas Kral <thomas.kral at email.cz>


More information about the Oberon mailing list