Ticket #47816: patch-ft245r.diff

File patch-ft245r.diff, 1.0 KB (added by beck.dac@…, 9 years ago)

Source code patch that corrects the out of spec delay

  • ft245r.c

    old new  
    296296    return 0;
    297297}
    298298
     299static int set_sck(PROGRAMMER * pgm, int value) {
     300    return set_pin(pgm, PIN_AVR_SCK, value);
     301}
     302
    299303static int set_reset(PROGRAMMER * pgm, int value) {
    300304    return set_pin(pgm, PIN_AVR_RESET, value);
    301305}
     
    420424
    421425    ft245r_powerup(pgm);
    422426
     427    /* Apply power between VCC and GND while RESET and SCK are set to “0”. In some systems,
     428     * the programmer can not guarantee that SCK is held low during power-up. In this
     429     * case, RESET must be given a
     430     */
     431    set_sck(pgm, OFF);
     432
    423433    set_reset(pgm, OFF);
    424434    usleep(5000); // 5ms
    425435    set_reset(pgm, ON);
    426436    usleep(5000); // 5ms
    427437    set_reset(pgm, OFF);
    428     usleep(5000); // 5ms
     438
     439    /* Wait for at least 20 ms and enable serial programming by sending the Programming
     440     * Enable serial instruction to pin MOSI.
     441     */
     442    usleep(20000); // 20ms
    429443
    430444    return ft245r_program_enable(pgm, p);
    431445}