avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avrdude-dev] [PATCH] ft245r: make ft245r_out be always in sync with rea


From: Andrey Skvortsov
Subject: [avrdude-dev] [PATCH] ft245r: make ft245r_out be always in sync with real state of the pins
Date: Mon, 26 Jan 2015 18:34:05 +0300
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

just tried avrdude with new ft232rl-based programmer. I have couple of
fixes for ft245r. Here is the first one. The second patch I send in a
separate e-mail, because fixes are not related to each other.

This patch fixes a small error. After ft245r_cmd call ft245r_out is not anymore
in sync with real state of SCK and maybe MOSI (depends on the latest
sent data bit). set_data updates ft245r_out to be in sync. After
set_data SCK is always ON and MOSI's state is the latest data bit.
But after that ft245r_cmd adds 0 byte to reset all signals after the
command, but it does not update internal ft245r_out variable and state
of SCK and MOSI is not cleared.

Because of that functions set_pin/set_reset/set_buff/.../ can trigger
occasionally SCK and MOSI from low to high. Trigger of SCK looks to uC as a new 
bit and
can mess-up all bit-bang operations.

This is a minor bug, because it should never happen in normal case.
The only case then it happened was ft245r_initialize where
set_reset(pgm, OFF) triggered SCK on and broke flash process.  But
this was fixed another way by commit 
http://svn.savannah.nongnu.org/viewvc/trunk/avrdude/ft245r.c?root=avrdude&r1=1324&r2=1331

But I think that it's useful to apply the patch anyway to avoid spending time
on debugging such strange behavior in the future.

-- 
Best regards,
Andrey Skvortsov

Secure eMail with gnupg: See http://www.gnupg.org/
PGP Key ID: 0x57A3AEAD

Attachment: 0001.ft245r-syncronize-pins-state-and-their-memory-image-after-ft245r_cmd-call.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]