Re: [avrdude-dev] [patch] FT245R correct reset (was Re: ftdi_syncbb (FT232R): won't erase the (m88p) chip)

2013-09-22 Thread Ing. Daniel Rozsnyó
Actually, the SCK has to be set before powerup, so the new line goes 
before power setting :)


Sorry,

D.

On 09/22/2013 08:13 PM, Ing. Daniel Rozsnyó wrote:

I was quite impatient so I started debugging with adding printf() to the
ft245 code... and found out that the reset is done wrong.

So I fixed it:

  - main issue: after some instruction (presumably chip erase) the SCK
is H, so in that case, the consequent enter programming mode was of no
success

  - the timing does not reflect the datasheet of the cpu (20ms!)

Patch attached. I'll also try to solve the last annoying bit - lockup
after the command is done.

Daniel


On 09/22/2013 05:47 PM, Ing. Daniel Rozsnyó wrote:

Hello,
  is the fuse reading and programming too different from a chip erase ?
I am having trouble flashing a ATmega88PA chip - lowering the bitrate
does not help (anyway at 250400 it behaves realtime, at 9600 reading
the fuses takes 10-15sec! And it still wont exit correctly):


*$ avrdude -c arduino-ft232r -P usb -p atmega88p -b 250400 -e*

avrdude: AVR device initialized and ready to accept instructions

Reading | ## | 100% 0.01s

avrdude: Device signature = 0x1e930f
avrdude: erasing chip
avrdude: Device is not responding to program enable. Check connection.
^C



*$ avrdude -c arduino-ft232r -P usb -p atmega88p -b 9600 -e*

avrdude: AVR device initialized and ready to accept instructions

Reading | ## | 100% 9.51s

avrdude: Device signature = 0x1e930f
avrdude: erasing chip
avrdude: Device is not responding to program enable. Check connection.
^C




This works:

*$ avrdude -c arduino-ft232r -P usb -p atmega88p -b 250400 -U
efuse:w:0x00:m**
*
avrdude: AVR device initialized and ready to accept instructions

Reading | ## | 100% 0.01s

avrdude: Device signature = 0x1e930f
avrdude: reading input file 0x00
avrdude: writing efuse (1 bytes):

Writing | ## | 100% 0.01s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0x00:
avrdude: load data efuse data from input file 0x00:
avrdude: input file 0x00 contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified

avrdude: safemode: Fuses OK (E:00, H:DC, L:E7)
^C


*$ avrdude -c arduino-ft232r -P usb -p atmega88p -b 250400 -U
efuse:w:0x01:m*

avrdude: AVR device initialized and ready to accept instructions

Reading | ## | 100% 0.01s

avrdude: Device signature = 0x1e930f
avrdude: reading input file 0x01
avrdude: writing efuse (1 bytes):

Writing | ## | 100% 0.01s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0x01:
avrdude: load data efuse data from input file 0x01:
avrdude: input file 0x01 contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified

avrdude: safemode: Fuses OK (E:01, H:DC, L:E7)
^C




FULL VERBOSE REPORT:

*$ avrdude -c arduino-ft232r -P usb -p atmega88p -b 250400 -e -vvv*

avrdude: Version 6.1-svn-20130917, compiled on Sep 22 2013 at 17:32:10
  Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
  Copyright (c) 2007-2009 Joerg Wunsch

  System wide configuration file is /usr/local/etc/avrdude.conf
  User configuration file is /home/daniel/.avrduderc

  Using Port: usb
  Using Programmer  : arduino-ft232r
  Overriding Baud Rate  : 250400
avrdude: unknown: Pin is ok.
avrdude: VCC: Pin is ok.
avrdude: BUFF: Pin is ok.
avrdude: RESET: Pin is ok.
avrdude: SCK: Pin is ok.
avrdude: MOSI: Pin is ok.
avrdude: MISO: Pin is ok.
avrdude: ERRLED: Pin is ok.
avrdude: RDYLED: Pin is ok.
avrdude: PGMLED: Pin is ok.
avrdude: VFYLED: Pin is ok.
  ft245r:  spi bitclk 250400 - ft baudrate 500800
  AVR Part  : ATmega88P
  Chip Erase delay  : 9000 us
  PAGEL : PD7
  BS2   : PC2
  RESET disposition : dedicated
  RETRY pulse   : SCK
  serial program mode   : yes
  parallel program mode : yes
  Timeout   : 200
  StabDelay : 100
  CmdexeDelay   : 25
  SyncLoops : 32
  ByteDelay : 0
  PollIndex : 3
  PollValue : 0x53
  Memory Detail :

   Block Poll Page Polled
Memory Type 

Re: [avrdude-dev] [patch] FT245R correct reset (was Re: ftdi_syncbb (FT232R): won't erase the (m88p) chip)

2013-09-22 Thread Joerg Wunsch
As Ing. Daniel Rozsnyó wrote:

 I was quite impatient so I started debugging with adding printf() to the 
 ft245 code... and found out that the reset is done wrong.
 
 So I fixed it:

Please don't forget to submit this to the patch tracker.

I've spent much time during the last weeks for AVRDUDE, I won't be
able to spend an equal amount of time in the near future.  So unless
some other active developer picks it up immediately, and cross-checks
everything (I'm not very knowledgable about the ftdi_syncbb programmer
myself, so I can't judge whether the patch is OK, or might have bad
side effects for other hardware), it's very important someone will
remember this in time before the next release.
-- 
cheers, Joerg   .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)

___
avrdude-dev mailing list
avrdude-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avrdude-dev