#avr Logs

Aug 22 2022

#avr Calendar

03:54 AM exp: LeoNerd: nothing in errata?
04:03 AM exp: that's not an uncommon failing, RP2040 has the same issue lol
04:03 AM exp: early AVRs had an intermediary phase when you set GPIOs where it would accidentally turn a drive-low into drive-high if you fucked it up
04:06 AM nuxil: RP2040 ewwww. Blasphemy 32bit arm..
04:08 AM twnqx: biggest fail of rp2040: no embedded flash
04:15 AM exp: it does have embedded flash
04:15 AM exp: but it's ROM :)
04:15 AM exp: also honestly i have no problem with it
04:16 AM twnqx: i'll admit i bought two pi picos to play with them
04:16 AM twnqx: and look at the chip
04:16 AM exp: i have a few thousand rp2040s lol
04:16 AM twnqx: stm32s are a bit hard to get atm :P
04:16 AM exp: for exactly that reason twnqx
04:16 AM exp: they're also extremely price competitive
04:16 AM exp: like, 5x cheaper than anything else
04:16 AM twnqx: nah
04:16 AM twnqx: that is not true
04:16 AM exp: i paid less than 70p/ea
04:17 AM exp: what competes for < £3.50?
04:17 AM exp: can even add the 20p for the flash chip if you like :p
04:17 AM twnqx: i need to find a microchip eval board to tell you :P
04:18 AM exp: even in normal market stms were a couple quid in volume iirc
04:18 AM twnqx: i bought the arduino nano every... not for the atmega
04:19 AM twnqx: but for the ATSAMD11D14A
04:20 AM exp: i don't know much about the SAM series at all
04:20 AM twnqx: apparently slower
04:20 AM twnqx: but also smaller
04:20 AM twnqx: https://www.microchip.com/en-us/product/ATSAMD11D14
04:20 AM exp: yeah reading
04:20 AM exp: twice the price and 1/4 the mips ;)
04:20 AM exp: but much closer than your typical stm/avr for sure
04:26 AM twnqx: and a single chip solution
04:27 AM exp: yup, it's actually interesting cause i didn't realise these SAMs were quite as powerful
04:27 AM exp: can you buy them though?
04:27 AM twnqx: i have no current usecase :P
04:28 AM exp: can one buy them though? :)
04:28 AM twnqx: yeah
04:28 AM exp: only in SOIC it seems
04:28 AM exp: which is irritating
04:29 AM twnqx: if you want reels, cytech is ok :P
04:29 AM exp: ideally now i need something fast and tiny
04:29 AM exp: i have a few hundred tinyavr2s i think, whatever the new series is
04:29 AM exp: 212? 214? something like that
04:30 AM exp: but i need a couple thousand for good stock levels at least
04:30 AM twnqx: hm
04:30 AM twnqx: i wanted to get some for an experiment
04:30 AM twnqx: just dip switch -> clock generator via SPI/I2C adaptation
04:31 AM exp: next big project for me is a bunch of tiny analog front-ends with automatic attenuation control
04:31 AM exp: need something decent to write the loop in
04:31 AM exp: a few hundred khz frequency is probably fine
04:31 AM exp: i do not want to learn CPLDs or some such :)
04:32 AM twnqx: reminds me i need a way to program GALs
04:32 AM twnqx: not the physical side of it
04:32 AM twnqx: but writing the "programs"
04:33 AM exp: better get writing an LLVM IR translator then!
04:33 AM twnqx: nah
04:33 AM twnqx: it's not software
04:33 AM twnqx: it's just terms, no feedback, no clock
04:33 AM exp: it kinda was a joke, you could express the same logic relations in it though
04:34 AM twnqx: i'd rather use verilog for that
04:34 AM twnqx: but eh.
04:34 AM exp: my experience with verilog is extremely limited
04:34 AM exp: should add that to my list
04:34 AM exp: anyway i gotta go get some work done, brb
04:35 AM twnqx: hf gl :P
05:39 AM exp: here's a question related to my bug
05:39 AM exp: i'm jumping to application code in an xmega
05:39 AM exp: so i can jmp 0 that's fine
05:39 AM exp: what registers should i be clearing up?
05:39 AM exp: i'm having issues with weird jmps in my application code and i notice both RAMPZ and EIND are set before i jmp
05:39 AM exp: which almost certainly shouldn't be, and i suspect app code does not clean it up
05:41 AM LeoNerd: ATtiny at 20MHz. 8bit SPI ADC. I feel certain I should be able to find a way to get 1MS/sec out of this
05:41 AM LeoNerd: Problem is I can't find any 8bit SPI ADCs that output a single sample as one byte. They all seem to spread it over two 8bit bytes... which is therefore too slow :/
05:41 AM twnqx: i doubt that
05:42 AM LeoNerd: If I could get one that reads in a single 8bit value, then that's 16 clocks to get it out, plus 2 for the SS transition, gives me 2 clocks spare at 20MHz.
05:44 AM twnqx: if you discard the data,y es
05:44 AM LeoNerd: Hm? I have plenty of time in the middle while the SPI unit is transferring a word, to save the previous one in a buffer somewhere
05:44 AM exp: hmm after the init and do copy loop, rampz and eind are both reset, and i can see things are jmping to the correct point
05:45 AM exp: but if i let this code run and come back to it, it's running in the middle of erased flash lol
05:45 AM exp: and triggering an interrupt somehow corrupts ram
05:45 AM exp: so i've clearly got problems!
06:26 AM exp: aha, so here's a nice unique one
06:27 AM exp: to save a tiny amount of space i enabled -mcall-prologues
06:27 AM exp: but what i didn't realise is that the mechanism this uses to return is an eicall or whatever
06:27 AM exp: this does not function correctly in my case, when i'm jumping back and forth between app code and apptable code
06:28 AM exp: luckily i've since saved a couple hundred bytes with fiddling, so i think i can abandon that approach
07:04 AM LeoNerd: Well.. boo. :( I think I have a bad flash cell in an ATtiny chip
07:05 AM LeoNerd: Try to write the 6th byte (well within the interrupt vector table) as 0x77, it reads back as 0x71. Repeatbly. Just on this one chip. Others are fine
07:05 AM LeoNerd: I can't imagine I've rewritten it more than maybe 200 times ever
07:05 AM LeoNerd: I know these things don't last forever, but that feels a little short
07:10 AM exp: bad luck that, i've done this thing hundreds of times for sure
07:10 AM exp: xmega flash is rated to 10,000 overwrites i think
07:10 AM exp: so 200 is weaksauce
07:10 AM exp: LeoNerd: haven't been doing it at 105°C have you? :p
07:12 AM LeoNerd: Just room temp ;)
09:42 AM exp: i wonder how long sram persists on these xmegas
09:42 AM exp: i powered it off for a fair few seconds and powered it on with the debugger set paused
09:42 AM exp: and it appears to have stopped it way before i'd set up sram
09:42 AM exp: but my structures are still there
01:53 PM specing_ is now known as specing