7.1. Afro ESC

  1. Download AVRA.

    $ git clone https://github.com/Ro5bert/avra.git
    
  2. Build and install AVRA

    $ cd avra && sudo make install
    
  3. Download the firmware

    $ git clone https://github.com/hippocampusrobotics/tgy.git
    
  4. Build the firmware. This depends on the interface used. The classic way to go is PWM. But if you want to control the ESCs directly from the Raspberry Pi, you might want to use I2C.

    Modify at least the following lines in tgy.asm

    RC_PULS_REVERSE = 1 ; This enables forward/reverse throttle
    RC_CALIBRATION = 0 ;
    STOP_RC_PULS = 1000 ; minimum pwm value
    FULL_RC_PULS = 2000 ; maximum pwm value
    

    Optionally fiddle with the deadband

    RCP_DEADBAND = 50 ; default value
    

    Build the firmware

    $ make all
    
  5. Connect the Afro Programmer with your computer and connect the data wires with the ESC. Supply the ESC with an appropriate voltage (probably ~10-12V).

  6. Install or download avrdude.

    Attention

    Newer versions of avrdude do not seem to work with the AFRO programmer. So you may want to stick with the older version in the download.

  7. Flash the afro_nfet.hex firmware you have built before.

    $ avrdude -b 9600 -p m8 -P /dev/ttyUSB0 -c stk500v2 -e -U flash:w:afro_nfet.hex.0:i
    

    Important

    Make sure avrdude verifies the flashed data successfully. Otherwise rebuilt the firmware with make clean && make all and try again.