Show Posts
Pages: [1] 2 3 ... 9
1  Using Arduino / Networking, Protocols, and Devices / Nrf24L01 - Mirf Library - use of Carrier Detect (CD) on: August 19, 2014, 10:19:44 am
Hi there,

I have got 2 x ATTiny85's talking to each other with Nrf24L01 on the Mirf libraries (very chuffed with myself !)

I have written a bit of code for the RX board to search for the channel that is being transmitted by the TX board (that is the easy bit)

But on the TX board, I have written a spec for a 'best channel search' - the only problem is, I dont really know how to implement the Carrier Detect function. What I would like to do is listen on each channel for xx times, log all the results and choose the best channel to transmit on. The Address-Pipe would contain the value of the channel, so it would be easy to find !! - There is a 'scanner' sketch for 328's and the RF24 library, but I cant work out how to convert it to the Mirf and Tiny85

Can anyone give me some help on implement the CD in the MIRF library please

Thanks in Advance !!!

PS, here is the code I am going to use in the RX boards to 'find' the transmitter

Code:
void channelSearch(void) {
  uint8_t rfChan;
  boolean chnFound;
  while (!chnFound) {
    for (rfChan=0; rfChan<MAX_RF_CHANNELS; rfChan++) {
      Address[0] = Address[1] = Address[2] = Address[3] = Address[4] = rfChan;
      Mirf.channel = rfChan;
      Mirf.setRADDR(Address); 
      Mirf.config();
      delayMicroseconds(50);
      for (uint8_t x=0; x<200; x++) {
            if ( Mirf.dataReady() ) { // found data, so set channel and write to eeprom
              EEPROM.write(0,rfChan);
              chnFound=true;
              return;
            } // if
            delay(5); // 5ms x 200 = 1s // 83 channels would take 84 seconds to scan
      } // for x
    } // for rfChan
  } // while
}
2  Using Arduino / Networking, Protocols, and Devices / Re: Transmitting & Receiving DMX using nRF24L01 radio transceivers on: August 19, 2014, 02:15:50 am
Hi, sometimes it takes a while to get a working/stable code with these jiggers. I have used them on several chips now (atmega328/8/tiny85) and eventually get them to work after a lot of messing around, its also good to have a serial output so you can read whats going on on Monitor.

I have used these in a oneTX/manyRX situation, they must be on the same channel, use the same bps buad rate, be set up for similar crc/retry and have the same address-pipe. If you have all these things set then you will get a reception data-match and recover your payload correctly.
3  Using Arduino / Networking, Protocols, and Devices / Re: Transmitting & Receiving DMX using nRF24L01 radio transceivers on: August 17, 2014, 02:13:45 pm
I think you can get rid of the 4us delay since you aren't recompiling the DMX for re-transmission,and there is probably some other superfluous code in there too, but essentially yes you have it right there. I only use sn75176 devices but I do believe you can use a max485 as a substitute if you like smiley
4  Using Arduino / Networking, Protocols, and Devices / Re: Transmitting & Receiving DMX using nRF24L01 radio transceivers on: August 17, 2014, 09:41:07 am
Actually, it wasnt as simple as I first suggested - the DMX channels are broken into packets of 30 channels each - you would need to recompile the received radio data into the correct channels slot.. like this...

Code:
void loop(void)
{
    if ( radio.available() ) {
      radio.read( payload, sizeof(payload) ); // get data packet from radio if available
      for (i = 0; i <30; i++) {
        DMXData[(30*payload[0])+i] = payload[i+2]; // recompile DMX data from RF data
        /// your channels are now in the correct place to send to the servos...
        myservo.write(DMXData[1]); // set servo to the value of DMX channel 1
    }
}
5  Using Arduino / Networking, Protocols, and Devices / Re: Transmitting & Receiving DMX using nRF24L01 radio transceivers on: August 17, 2014, 08:27:13 am
If you use the code similar to what I posted, you could make the receive like this...

Code:
    if ( radio.available() ) {
      radio.read( payload, sizeof(payload) ); // get data packet from radio if available
      myservo.write(payload[1]);                  // sets the servo position according to the received value

    }

obviously you would have to set up your servo code and initialise as per your library
6  Using Arduino / Networking, Protocols, and Devices / Re: Transmitting & Receiving DMX using nRF24L01 radio transceivers on: August 14, 2014, 03:48:33 pm
I will be posting a ATTiny85 (210 channel) version of this software soon... its an incredibly cheap option !!
7  Using Arduino / Microcontrollers / Re: ATTiny85 / nRF24L01 / WS2811 / DMX on: August 14, 2014, 03:47:17 pm
so far so good !!
Although I cant get 2 pins free to drive DMX differentially, so I am having to use a driver chip !!!
I only have enough ram at present to output 210 channels of DMX,
Not tested the solar/reachargable side yet
Ready to test WS2812's !!

I have found that the non-antenna version of nrf24l01 makes a good TX board, and the board with the antenna is great for a receiver, so far I have the TX placed 3 floors and several brick walls away from RX and the throughput is extremely good smiley
8  Using Arduino / Networking, Protocols, and Devices / Re: RF24 Library: Driver for nRF24L01(+) 2.4GHz Wireless Transceiver on: August 11, 2014, 02:53:37 pm
Hi All, here is a question :

I have a project where I set a receive channel the same as the transmit channel, and set the pipe addresses the same too, set all the doo's and the daah's, the datarate, payload size the same etc etc...

The transmitter is a 328 with a nrf24l01 using RF24
The receiver is a 85 with a nrf24l01 using a modified SPI85 and RF24

I know I am getting a carrier signal on that channel...       if ( radio.testCarrier() ) { thumbsUp; }
If I get a carrier should that also mean I would get the data if I have matched everything ?

The only thing I can think of is the 328-RF24 and the 85-RF24 deal with the pipe-address differently
Both TX and RX use 0xF0F0F0F0E1LL as the pipe address

Any ideas anyone, before I pull the last of my greying hair out ?? smiley

Thanks in advance

EDIT : Incidentally, the ONLY library that I could get anything to work with on 85 is this https://github.com/WSUEECSEE5851213Team12/haf/tree/master/ATtiny/libraries
I also used a hardware mod/hack to free up pins http://nerdralph.blogspot.co.uk/2014/01/nrf24l01-control-with-3-attiny85-pins.html
I have modified both so that the 85 controls CE, and the CSN comes from the hack, this works for me and leaves me with one pin on the 85 (rather than use the reset/1) which is all I need
9  Using Arduino / Microcontrollers / ATTiny85 / nRF24L01 / WS2811 / DMX on: August 03, 2014, 02:02:12 am
I am starting a very interesting project...

50x32 PCB
ATTiny85 with ISP programming interface
nRF24L01 radio board interface
2 x 3.6V rechargeable cells with charging circuit from a solar panel
Software to drive differential DMX512 and WS2811 LEDs directly

This board will have many uses (standalone programmer etc)

I shall also be using this to test out my self-searching radio channel software !!
10  Using Arduino / Displays / Re: TVout and RGB Video on: August 01, 2014, 02:11:24 am
I shall, please note that I have removed the sound driver as it conflicted with something else
I'm sure its a tiny bit faster without the clutter !!

Also I have only tested this on PAL, not NTSC yet
11  Using Arduino / Displays / Re: TVout and RGB Video on: August 01, 2014, 01:20:47 am
Bump, just wondered if anyone is interested in this, or has tried it yet ?
Mine is very stable at 32mhz
12  Using Arduino / Sensors / Re: Electret Microphone with LM358 gives weird analog reads combined with WS2812 on: July 30, 2014, 11:25:55 am
Just a guess, but I reckon you should be reading the microphone as an ac signal, biased to half Voltage, then when you read it the values will be probably equal either side of half your reading resolution

for example if your resolution is 1024, then the half way point would be 512, so you would get ac/sinwave values above and below this number.

to ensure you would get a good ac coupled signal, use a 1uf cap (to block the DC path) then bias the output of the cap with two equal value resistors, one going to +ve, the other to 0v
13  Using Arduino / Microcontrollers / Re: DMX Out on ATTINY85-20... on: July 30, 2014, 09:13:25 am
Here is a video of the project so far...

http://youtu.be/SBjkxvv0yRw

I have improved this further stil so that the ATTiny outputs differntial DMX rather than having to use a RS485 driver chip

Regards

14  Using Arduino / Displays / Re: TVOut library and DMX... on: July 30, 2014, 09:10:54 am
A video of my project so far.....

http://youtu.be/RV49tQ6Lilc
15  Community / Products and Services / Re: New product proposal: Arduino constant current DMX driver on: July 30, 2014, 01:31:05 am
Hi There, just to add a little into this, we have been looking at wireless DMX...

http://forum.arduino.cc/index.php?topic=208648.0
Pages: [1] 2 3 ... 9