User Tools

Site Tools


doc:crazyradio:usb:index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
doc:crazyradio:usb:index [2012-05-14 08:08]
arnaud [Dongle configuration]
doc:crazyradio:usb:index [2013-01-05 23:35]
arnaud [Dongle configuration summary]
Line 12: Line 12:
 | EP1IN/OUT | Bulk    | Data endpoints. Used to send and receive radio packets | | EP1IN/OUT | Bulk    | Data endpoints. Used to send and receive radio packets |
  
-==== Dongle configuration ====+==== Data transfer ==== 
 + 
 +The radio dongle being configured in PTX (emmiter) mode it sends packet to the copter and waits for the acknowledge. The acknowledge can contains a Payload which is the mean to receive data. If the auto acknowledge is disable there is no IN transaction. 
 + 
 +To send a packet the following sequence must be followes: 
 +  * Send the packet to EP1_OUT. Its length should be between 1 to 32Bytes 
 +  * Read the ACK from EP1_IN. The first byte is the transfers status and the following bytes are the content of the ACK payload, if any. 
 + 
 +<ditaa> 
 +                       1..32Bytes 
 +               <------------------------> 
 +              +-------------------------+ 
 +To EP1_OUT:   | Packet to be transmited | 
 +              +-------------------------+ 
 +                 1Byte       1..32 Bytes 
 +               <------> <--------------------> 
 +              +--------+----------------------+ 
 +From EP1_IN:  | Status | Ack payload received | 
 +              +--------+----------------------+ 
 +</ditaa> 
 + 
 +The status byte contains flags indicating the quality of the link: 
 + 
 +^ Status  Bit   ^ Role                    ^ 
 +| 4..7          | Number of retransmition | 
 +| 2..3          | Reserved                | 
 +| 1             | Power detector          | 
 +| 0             | Ack received            | 
 + 
 +==== Dongle configuration and functions summary ====
  
 Crazyradio vendor requests summary: Crazyradio vendor requests summary:
Line 23: Line 52:
 |          0x40 | SET_RADIO_ARD (0x05)     | ARD      | Zero   | Zero    | None    | |          0x40 | SET_RADIO_ARD (0x05)     | ARD      | Zero   | Zero    | None    |
 |          0x40 | SET_RADIO_ARC (0x06)     | ARC      | Zero   | Zero    | None    | |          0x40 | SET_RADIO_ARC (0x06)     | ARC      | Zero   | Zero    | None    |
 +|          0x40 | ACK_ENABLE (0x10)        | Active   | Zero   | Zero    | None    |
 |          0x40 | SET_CONT_CARRIER (0x20)  | Active   | Zero   | Zero    | None    | |          0x40 | SET_CONT_CARRIER (0x20)  | Active   | Zero   | Zero    | None    |
 +|          0x40 | SCAN_CHANNELS (0x21)     | Start    | Stop   | Length  | Packet  |
 +|          0xC0 | SCAN_CHANNELS (0x21)     | Zero     | Zero   | 63      | Result  |
 |          0x40 | LAUNCH_BOOTLOADER (0xFF) | Zero     | Zero   | Zero    | None    | |          0x40 | LAUNCH_BOOTLOADER (0xFF) | Zero     | Zero   | Zero    | None    |
  
-=== Set radio channel ===+==== Set radio channel ====
  
 ^ bmRequestType ^ bRequest                 ^ wValue   ^ wIndex ^ wLength ^ data    ^ ^ bmRequestType ^ bRequest                 ^ wValue   ^ wIndex ^ wLength ^ data    ^
Line 33: Line 65:
 The nrf24L chips provides 126 Channels of 1MHz from 2400MHz to 2525MHz. The channel parameter shall be between 0 and 125 (if not the command will be ignored). The nrf24L chips provides 126 Channels of 1MHz from 2400MHz to 2525MHz. The channel parameter shall be between 0 and 125 (if not the command will be ignored).
  
-The radio channel is set as soon as the setup transaction is completed which takes about 1ms. The new frequency is going to be used for the following transfered packets. Default value for the radio channel is 2.+The radio channel is set as soon as the USB setup transaction is completed which takes about 1ms. The new frequency is going to be used for the following transfered packets. Default value for the radio channel is 2.
  
-=== Set radio address ===+==== Set radio address ====
  
 ^ bmRequestType ^ bRequest                 ^ wValue   ^ wIndex ^ wLength ^ data    ^ ^ bmRequestType ^ bRequest                 ^ wValue   ^ wIndex ^ wLength ^ data    ^
Line 52: Line 84:
 The default address is 0xE7E7E7E7E7. The default address is 0xE7E7E7E7E7.
  
-=== Set datarate ===+==== Set datarate ====
  
 ^ bmRequestType ^ bRequest                 ^ wValue   ^ wIndex ^ wLength ^ data    ^ ^ bmRequestType ^ bRequest                 ^ wValue   ^ wIndex ^ wLength ^ data    ^
Line 64: Line 96:
  
  
-=== Set radio power ===+==== Set radio power ====
  
 ^ bmRequestType ^ bRequest                 ^ wValue   ^ wIndex ^ wLength ^ data    ^ ^ bmRequestType ^ bRequest                 ^ wValue   ^ wIndex ^ wLength ^ data    ^
 |          0x40 | SET_RADIO_POWER (0x04)   | Power    | Zero   | Zero    | None    | |          0x40 | SET_RADIO_POWER (0x04)   | Power    | Zero   | Zero    | None    |
  
 +Sets the radio amplifier output power. Possible values:
  
-=== Configure auto retry (ARD/ARC) ===+^ Value ^ Power   ^ 
 +|     0 | -18dBm 
 +|     1 | -12dBm 
 +|     2 | -6dBm   | 
 +|     3 | 0dBm    | 
 + 
 +==== Configure auto retry (ARD/ARC) ====
  
 ^ bmRequestType ^ bRequest                 ^ wValue   ^ wIndex ^ wLength ^ data    ^ ^ bmRequestType ^ bRequest                 ^ wValue   ^ wIndex ^ wLength ^ data    ^
Line 82: Line 121:
 Possible values for ARD: Possible values for ARD:
  
-^ Value ^ ARD wait  time ^          ^ Value ^ Ack payload length ^ +^ Value ^ ARD wait  time ^          
-|  0x00 | 250us          |          |  0x80 | 0Byte              | +|  0x00 | 250us          |           
-|  0x01 | 500us          |           0x81 | 1Byte              | +|  0x01 | 500us          |          
-|   ... | ...            |          |   ... | ...                | +|   ... | ...            |           
-|  0x0F | 4000us                  |  0xA0 | 32Bytes            |+|  0x0F | 4000us         | 
 +^ Value ^ Ack payload length ^ 
 +|  0x80 | 0Byte              | 
 +|  0x81 | 1Byte              | 
 +|   ... | ...                | 
 +|  0xA0 | 32Bytes            |
  
 ARC configures the number of time the radio will retry a transfer if the Ack has not been received, it can be set from 0 to 15. ARC configures the number of time the radio will retry a transfer if the Ack has not been received, it can be set from 0 to 15.
Line 92: Line 136:
 By default ARD=32Bytes (0xA0) and ARC=3. By default ARD=32Bytes (0xA0) and ARC=3.
  
-=== Continuous carrier mode ===+==== Auto ACK configuration ====
  
-=== Launch bootloader ===+^ bmRequestType ^ bRequest                 ^ wValue   ^ wIndex ^ wLength ^ data    ^ 
 +|          0x40 | ACK_ENABLE (0x10)        | Active   | Zero   | Zero    | None    |
  
-==== Data transfer ====+By default Crazyradio is configured with auto ack enable. It means that after transmiting a packet the radio waits for an acknoledge from the receiver. This setting permits to deactivate waiting for the Ack packet so that the packet will be sent only one time and there are no guarantee that it has been correctly received.
  
-The radio dongle is configured in PTX mode (in the Nordic terminologywhich means that it sends packet to the copter and waits for the acknowledge. The acknowledge can contains a Payload which is the mean to get data from the copter.+^ Active values ^ Meaning                   ^ 
 +| 0             | Auto ack deactivated      | 
 +| Not 0         | Auto ack enable (default|
  
-The packet is to send is sent to the EP1 and the ack status is then received from the EP1. There are no buffering in the radio dongle, the ACK must be received by the PC before the next packet can be sent.+==== Continuous carrier mode ====
  
-<ditaa> +^ bmRequestType ^ bRequest                 ^ wValue   ^ wIndex ^ wLength ^ data    ^ 
-                       1..32Bytes +         0x40 SET_CONT_CARRIER (0x20)  Active   Zero   | Zero    | None    |
-               <------------------------> +
-              +-------------------------+ +
-To EP1_OUT:   Packet to be transmited | +
-              +-------------------------+ +
-                           1..32 Bytes +
-               1Byte <--------------------> +
-              +-----+----------------------+ +
-From EP1_IN:  Ack Ack payload received | +
-              +-----+----------------------+ +
-</ditaa>+
  
-This protocol permits to transfer about 500 packets per seconds. +The nRF24L radio chip provides a test mode in which a continous non-modulated sine wave is emited. This permits, among other things, to test the quality of the RF elements of the board. When this mode is activated the radio dongle does not transmit any packets.
-===== Radio protocol =====+
  
 +while the continuous carrier mode is active it is possible to set channel and power to change the frequency and power of the emitted wave.
  
 +^ Active values ^ Meaning                           ^
 +| 0             | Dongle working normally (default) |
 +| Not 0         | Dongle in continuous carrier mode |
  
 +==== Launch bootloader ====
 +
 +^ bmRequestType ^ bRequest                 ^ wValue   ^ wIndex ^ wLength ^ data    ^
 +|          0x40 | LAUNCH_BOOTLOADER (0xFF) | Zero     | Zero   | Zero    | None    |
 +
 +This command is used to launch the Nordic semiconductor USB bootloader. After sending this command a USB reset shall be emitted which will trigger the dongle to start the bootloader. After sending this command the Dongle is only waiting for a USB reset which means that any other commands or data will be ignored.
 +
 +The bootloader is pre-loaded by Nordic Semi. in the nRF24LU1 chip at the address 0x7800. The Crazyradio firmware will jump to it when the sequence LAUCH_BOOTLOADER following by a USB reset is executed. The bootloader will appear at VID/PID of 0x1915/0x0101. See nRF24LU1 datasheet for the bootloader documentation.
 +
 +A PC client for the bootloader is part of the Crazyflie ground station program.
 +
 +===== Radio protocol =====
doc/crazyradio/usb/index.txt · Last modified: 2020-05-12 14:12 by kimberly