#avr Logs

Nov 26 2020

#avr Calendar

04:11 PM Rab: The ATmega164A has a JTAG port that comes enabled by default. PORTC output is garbled unless JTAG is disabled in MCUCR. I found out about that the hard way.
06:33 PM fstd: what bitrates are y'all getting when in-system programming megas or tinys using SPI?
06:34 PM cehteh_: havent meaured it but depends pretty much on the programmer you use
06:34 PM fstd: i can't seem to get much higher than 300 byte/sec and i'm wondering whether that's a realistic limit or whether my programmer could in theory do better
06:34 PM fstd: i built my own programmer years ago
06:35 PM fstd: the low speed never really bothered me until now that i'm programming somewhat bigger blobs (4-8 KB)
06:35 PM cehteh_: i get approx 32kb in 4 sec with the polulu programmer
06:35 PM cehteh_: 300b/sec is waaay to slow
06:35 PM fstd: and that's using SPI, i.e. the mosi/miso/sck interface?
06:35 PM cehteh_: yes
06:36 PM fstd: great, thanks for the info then
06:36 PM fstd: i guess time to give this programmer a 2nd look after all :)
06:36 PM cehteh_: possibly :D
06:37 PM fstd: https://kiwi.pr0.tips/serprg.jpg isn't it cute :P
06:38 PM cehteh_: why the fat caps? so many?
06:38 PM fstd: (i bootstrapped that by bit banging over a parallel port once, that sucked)
06:38 PM fstd: idk i kind of winged it
06:38 PM fstd: oh wait, no
06:38 PM fstd: the caps are actually to spec for the max232
06:38 PM fstd: maybe too high of a voltage rating though
06:39 PM cehteh_: :D
06:40 PM fstd: oh about your 32kb in 4 secs, is that kilobit or kilobyte? and what clock freq does the uc use?
06:41 PM fstd: the target, i mean
06:41 PM cehteh_: byte
06:41 PM cehteh_: means full programming a 328pb in 4 sec
06:42 PM cehteh_: maybe its even faster with verify its less then 8 sec, but i only dimply remember the times excpet that it was 'fast enough'
06:42 PM cehteh_: wasnt exactly 32kb only 31.5 or so
06:42 PM cehteh_: but close enough
06:43 PM fstd: yeah i'd be happy even with half that :)
06:43 PM fstd: now for the fun part; looking at an SPI data stream with an analog scope :D
06:44 PM cehteh_: well thats only with the polulu programmer, usbasps are slower
06:44 PM fstd: well the polulu proves that the interface can handle it
06:45 PM cehteh_: yes
06:45 PM cehteh_: at 18.43Mhz btw ... but even for 16mhz it should be fast enough
06:45 PM cehteh_: for default clkdiv/8 and 1Mhz things might be different
06:46 PM fstd: thanks
06:46 PM fstd: fortunately i've got a 16 MHz crystal on that programmer
07:50 PM fstd: looks like write speed was never even a problem
07:50 PM Rab: fstd, I built one of those too: http://reboots.g-cipher.net/micropov/image/programming.jpg
07:50 PM fstd: instead i get some data corruption while verifying at higher speeds
07:51 PM fstd: Rab: wow the similarity is astonishing
07:52 PM fstd: though you were wise enough to make the header a 3x2.. i didn't know about that convention yet when i built mine
07:52 PM fstd: and now i can't go back because all my boards have that 1x6 header ^^
07:53 PM fstd: Rab: what's that 4 pin thingy for?
07:54 PM fstd: nvm
07:54 PM fstd: i guess it's power
07:54 PM Rab: fstd, USB power.
07:54 PM fstd: i have somehow established the convention that the target powers the programmer
07:54 PM Rab: The data pins aren't used, but they help keep the connector on.
07:54 PM fstd: not sure if that was a good idea
08:01 PM Rab: If the programmer is an ATtiny2313 at 16MHz, it could get a little weird if you power it from a 3.3V target.
08:02 PM fstd: true
08:02 PM fstd: fortunately i also kind of grew the convention that 3V3 can go eat a dick, i'm doing 5V :P
08:03 PM fstd: it only gets slightly annoying when i have to interface a 3V3 uart, like from a raspi
08:37 PM fstd: hmmmmm it's not the verification after all
08:37 PM fstd: i get this by writing a 512B of 0xaa at high speed http://paste.pr0.tips/WQ/B0oojC1ojsT2x32d
08:38 PM fstd: looks like i missed some required wait time upon starting a new page
08:39 PM fstd: 120 KB/s speed though \o/
08:39 PM fstd: cehteh_: ^ check it out
08:42 PM cehteh_: nice
08:43 PM fstd: might actually be not as accurate, i've only read 4 pages there
08:43 PM cehteh_: try some big block 8 or 16kb
08:43 PM fstd: but it's definitely a huge ton faster than before already
08:43 PM cehteh_: 120 seems a bit too fast actually, but i have no idea whats possible
08:44 PM cehteh_: i just wanted sprt turnaround while testing and less than 10sec is pretty ok
08:45 PM fstd: ok i'm actually doing about 4 KB/s now, but there's still room for optimization
08:46 PM fstd: i guess if i read the next page while the current page is writing...
09:23 PM cehteh_: add a 24mhz oscillator, driving programmer and to-be-programmed chip synchronously
09:24 PM cehteh_: overclock flashing :D
09:25 PM cehteh_: 24mhz with OSC instead crystal should still work well and having both chips in sync may improve speed since it wont glitch
09:56 PM fstd: :>