VMA322 2.
VMA322 USER MANUAL 1. Introduction To all residents of the European Union Important environmental information about this product This symbol on the device or the package indicates that disposal of the device after its lifecycle could harm the environment. Do not dispose of the unit (or batteries) as unsorted municipal waste; it should be taken to a specialized company for recycling. This device should be returned to your distributor or to a local recycling service. Respect the local environmental rules.
VMA322 5. Overview VMA322 This module based on Nordic nRF24L01, highly integrated, ultra-low power (ULP) 2 Mbps RF transceiver for the 2.4 GHz ISM (Industrial, Scientific and Medical) band. Nordic nRF24L01+ integrates a complete 2.4 GHz RF transceiver, RF synthesizer, and baseband logic including the Enhanced ShockBurst™ hardware protocol accelerator supporting a high-speed SPI interface for the application controller. power supply: 1.9 to 3.6 V IO port working voltage: 0-3.
VMA322 SPI_DIR = ( CE + SCK + CSN + MOSI); SPI_DIR &=~ ( IRQ + MISO); // attachInterrupt(1, _ISR, LOW);// interrupt enable Serial.begin(9600); init_io(); // Initialize IO port unsigned char status=SPI_Read(STATUS); Serial.print("status = "); Serial.println(status,HEX); // There is read the mode’s status register, the default value should be ‘E’ Serial.
VMA322 * from nRF24L01 during write, according to SPI protocol **************************************************/ unsigned char SPI_RW(unsigned char Byte) { unsigned char i; for(i=0;i<8;i++) // output 8-bit { if(Byte&0x80) { SPI_PORT |=MOSI; // output 'unsigned char', MSB to MOSI } else { SPI_PORT &=~MOSI; } SPI_PORT|=SCK; Byte <<= 1; // Set SCK high.. // shift next bit into MSB.. if(SPI_IN & MISO) { Byte |= 1; // capture current MISO bit } SPI_PORT&=~SCK; // ..
VMA322 unsigned char reg_val; SPI_PORT&=~CSN; SPI_RW(reg); // CSN low, initialize SPI communication... // Select register to read from.. reg_val = SPI_RW(0); // ..
VMA322 return(status); // return nRF24L01 status unsigned char } /**************************************************/ /************************************************** * Function: TX_Mode(); * * Description: * This function initializes one nRF24L01 device to * TX mode, set TX address, set RX address for auto.ack, * fill TX payload, select RF channel, datarate & TX pwr. * PWR_UP is set, CRC(2 unsigned chars) is enabled, & PRIM:TX.
VMA322 unsigned char rx_buf[TX_PLOAD_WIDTH]; unsigned char tx_buf[TX_PLOAD_WIDTH]; //*************************************************** void setup() { SPI_DIR = ( CE + SCK + CSN + MOSI); SPI_DIR &=~ ( IRQ + MISO); // attachInterrupt(1, _ISR, LOW); // interrupt enable Serial.begin(9600); init_io(); // Initialize IO port unsigned char status=SPI_Read(STATUS); Serial.print("status = "); Serial.println(status,HEX); // There is read the mode’s status register, the default value should be ‘E’ Serial.
VMA322 * * Description: * Writes one unsigned char to nRF24L01, and return the unsigned char read * from nRF24L01 during write, according to SPI protocol **************************************************/ unsigned char SPI_RW(unsigned char Byte) { unsigned char i; for(i=0;i<8;i++) // output 8-bit { if(Byte&0x80) { SPI_PORT |=MOSI; // output 'unsigned char', MSB to MOSI } else { SPI_PORT &=~MOSI; } SPI_PORT|=SCK; Byte <<= 1; // Set SCK high.. // shift next bit into MSB..
VMA322 /**************************************************/ unsigned char SPI_Read(unsigned char reg) { unsigned char reg_val; SPI_PORT&=~CSN; SPI_RW(reg); // CSN low, initialize SPI communication... // Select register to read from.. reg_val = SPI_RW(0); // ..
VMA322 SPI_RW(*pBuf++); } SPI_PORT|=CSN; return(status); // Set CSN high again // return nRF24L01 status unsigned char } /**************************************************/ /************************************************** * Function: RX_Mode(); * * Description: * This function initializes one nRF24L01 device to * RX Mode, set RX address, writes RX payload width, * select RF channel, datarate & LNA HCURR.
VMA322 7. More Information Please refer to the VMA322 product page on www.velleman.eu for more information. Also, consult http://playground.arduino.cc/InterfacingWithHardware/Nrf24L01. Use this device with original accessories only. Velleman nv cannot be held responsible in the event of damage or injury resulting from (incorrect) use of this device. For more info concerning this product and the latest version of this manual, please visit our website www.velleman.eu.
Velleman® Service and Quality Warranty Since its foundation in 1972, Velleman® acquired extensive experience in the electronics world and currently distributes its products in over 85 countries. All our products fulfil strict quality requirements and legal stipulations in the EU. In order to ensure the quality, our products regularly go through an extra quality check, both by an internal quality department and by specialized external organisations.