#avr Logs

Nov 03 2021

#avr Calendar

12:37 AM MarchHare: Hey, dumb question. I ordered some chinese attiny2313's and they apparently came with their fuse bits set so whacked out that I can't even talk to them without building a HVPP.
12:46 AM MarchHare: So I breadboarded a basic mightyohm resetter. It seems to work fine on my known-good chip. On my problem chips, apparently the fuses are 0x1FFF with the lock bits set to 0x1F. I haven't checked the extended fuse bits yet, but those aren't going to cause trouble anyway.
12:46 AM MarchHare: So I tried to program the L+Hfuses to defaults of 0xDF62, but for the problem chips, it's like they're not doing anything.
12:46 AM Phantom: maybe they are fake?
12:46 AM MarchHare: Do the lock bits prevent fuses from being written?
12:46 AM MarchHare: I'm trying to decide if I need to implement a chip erase or something. I know the resetter works and it gives consistent results.
12:48 AM Phantom: sound like it is some extra chip out of a factory pre-programmed batch...
12:48 AM MarchHare: I've checked with Dr Google. All of the results are for either how to fix the fuses with a regular non hvpp or resetters for attiny85/etc
12:48 AM MarchHare: Phantom: I'm not going to disagree with you on that one. The fuses seem consistent between the "bad" chips
12:49 AM MarchHare: Phantom: Do you happen to know if lock bits also lock the fuses?
12:49 AM Phantom: yes
12:50 AM Phantom: you need to issue a chip erase for the lock bit to be settable
12:50 AM MarchHare: Phantom: It looks like my lock bits are programmed with 0x1f. According to the datasheet, that's either undefined or not going to do anything
12:50 AM Phantom: ignore the undefined bits, only look at the actual defined ones
12:50 AM MarchHare: Phantom: I mean does having the lock bits locked cause me to not be able to tweak the other fuses? I know you have to do a chip clear to reset the lock bits
12:53 AM Phantom: fuses lock all programmation, because it can cause malfunction or allow to read the code, which defeat the locking
12:54 AM Phantom: once you lock the chip, no write can be done on it, and some reads (like flash and eeprom) is disabled
12:55 AM MarchHare: Okay, that jives. From what I can tell, only the lowest two bits of the lock byte matter, and they're both 1 (unprogrammed)
12:56 AM Phantom: undefined bits can read 1 or 0, or in some time even random
12:58 AM MarchHare: In my case, they seem to be 1.
12:58 AM MarchHare: On the known good ones, they read as FF, on the wonky ones, they're showing 1F
12:59 AM MarchHare: But both of those should have the same effect, I would think, unless I'm misunderstanding something
01:01 AM Phantom: unless those undefined bits do something else
01:10 AM MarchHare: Phantom: Sort of like the "undefined opcodes" that processors wind up with? Or used to?
01:10 AM MarchHare: Perhaps I should implement the chip erase.
01:16 AM Phantom: yes like that
01:16 AM Phantom: and they still have undefined opcodes
01:21 AM MarchHare: Alright...let's see if I break anything worse.
01:24 AM MarchHare: Well, it did something. Now I'm getting lock fuses as 0xFE
01:34 AM MarchHare: Let's see what happens if I stick it on my tinyusb.
02:26 AM WormFood: MarchHare, there is only one bit that could possibly be set that would require you to use an HVPP. If the other bits are whacked out, then I've found I can still program them, by setting the timing really high (very slow) in avrdude.
02:41 AM MarchHare: WormFood: In my case, it looks like the fuse bits were 0x1FFF before I executed a chip clear.
02:42 AM MarchHare: WormFood: Lock bits were 0x1F, which is strange since those bits are undefined at the top end.
02:42 AM WormFood: did you get it fixed now?
02:42 AM MarchHare: WormFood: After I did the chip erase, I wound up with 0xFEFF, and the lock bit was 0xFE. Very odd.
02:43 AM WormFood: hhhhmmmmm.....
02:43 AM MarchHare: WormFood: No, I didn't get it fixed, though the programmer seems to work fine on a less borked chip
02:43 AM WormFood: an HVPP should be able to recover from anything (short of hardware failures)
02:44 AM MarchHare: WormFood: I'm wondering if someone just sold their lot of QA-failed chips at a discount and whoever bought them was selling them
02:44 AM MarchHare: WormFood: Sholdn't chip erase set the lock bits all to default 0xFF?
02:44 AM MarchHare: WormFood: And leave the other fuse bits alone?
02:45 AM WormFood: ALL the times I bought AVRs from China, I got stuff that worked without problems...but I should add. I bought them IN China, so if I had problems, they know I'd have been back, so they knew better than to try to trick me with garbage. However, I feel most of the vendors are honest at huaqiangbei
02:45 AM MarchHare: WormFood: At least that was my understanding from the datasheet. I couldn't find anything about how fast a chip erase is supposed to take, but it sure did happen quickly (I had it programmed to wait for RDY to go high)
02:46 AM MarchHare: WormFood: Oh I already got refunded on the blasted things. I should never have to put in hours building a HVPP to unbrick chips.
02:47 AM WormFood: I've never programmed anything with high voltage. I actually own a programmer that will do HV now, but I haven't had the need to use that feature (also, I don't have the programmer right now, it's back in China, at my GF's house)
02:47 AM WormFood: MarchHare, but you did it, more as a challenge, I suspect. You gotta be smarter than the AVR :P
02:48 AM MarchHare: WormFood: I suppose it was a good experience. It was my 2nd xstr project. The first was actuating a LED with 12v using a 5v pushbutton (the other day, in prep for this one)
02:48 AM MarchHare: WormFood: Only took me 20 years of electronics to finally sack up enough to try a transistor.
02:48 AM WormFood: I just spent hours tracking down one of the most bizarre bugs I've ever seen, but I enjoyed it to a degree, because it's a challenge...a puzzle per se to solve.
02:49 AM WormFood: transistor?
02:50 AM WormFood: I've replaced bucket fulls of transistors over the years.
02:50 AM MarchHare: 晶体管
02:50 AM WormFood: no
02:50 AM WormFood: I can't type chinese on my computer yet
02:50 AM WormFood: hua qiang bei
02:50 AM MarchHare: Oh, I wasn't replacing a transistor, I was implementing a level changer for 12 volts.
02:51 AM WormFood: hua = prosperous
02:51 AM MarchHare: I guess google translate doesn't get it right, huh?
02:51 AM WormFood: hold on a sec, I'll get google to do it for me.
02:51 AM MarchHare: I can't type chinese, either. I can do Japanese, but I'm not very fluent at it.
02:51 AM WormFood: I can massage it into giving me what I want, because I know the characters
02:51 AM WormFood: bei = north
02:52 AM WormFood: 华强北
02:52 AM MarchHare: I assume Huagiangbei is somewhere in the northern parts of China?
02:52 AM WormFood: it translated it right for me.
02:52 AM WormFood: q not g
02:52 AM WormFood: hua qiang bei
02:52 AM WormFood: it's the world's largest electronics market
02:52 AM WormFood: I used to live a 15 minute walk from there.
02:53 AM MarchHare: Whoops. My typing is terrible lately. I almost lost the tip of my finger a few weeks ago, so it's wrapped up right now.
02:53 AM MarchHare: It slows me down a bit
02:53 AM WormFood: shit! that sounds rough. You're gonna be able to make a full recovery, I hope.
02:54 AM WormFood: I was a little slow to type...in fact, still am....I didn't touch a keyboard for 4 1/2 years.
02:54 AM MarchHare: I'm sure I'll be fine in a few months. It isn't hurting quite as bad as it was last week. I'm going to lose my nail soon enough. That's what happens when you get really stupid with a saw and hit a nail.
02:55 AM WormFood: I've lost my big toe nail, on both feet many times (probably 7-8 times)
02:55 AM WormFood: It started when I was a kid, and the last time it happened was about 5 years ago.
02:56 AM WormFood: Most people can go through life without ever losing a toe nail...how the fuck do I manage to do it so many times?!?!
02:56 AM MarchHare: Sounds like a condition? You weren't losing it because you banged it, were you?
02:57 AM MarchHare: I've dropped a few things on my toes and got a dark spot that takes a year to go away, but nothing bad enough to lose it. I've lost part of a fingernail before, that really hurts.
02:57 AM WormFood: every time, except once, where I just kicked something (unintentionally) the right way, and it just ripped the toe nail 1/2 off...and the fucked up thing about it, is I didn't notice it for probably 10-20 minutes.
02:57 AM WormFood: I'm wondering why my toe is hurting.
02:58 AM MarchHare: The latest one was pretty traumatic, it actually got ripped off the nail bed, while still being attached to the tip.
02:58 AM MarchHare: Of course, I also shattered the very tip of my fingerbone, too
02:59 AM WormFood: This last time it happened, it was unique. I kicked something hard, and it didn't seem to do anything, but it was broken at the base, and a new toe nail grew in, under the old toe nail...I notied when I cut my toe nails, I got 2 pieces of mail, but it didn't hit me right away...later I was able to pull off the top piece.
03:01 AM WormFood: My toe nail that grew in after that, was not uniform, and now it's still not right. Now that toenail is smaller, and a little misshapen
03:01 AM MarchHare: That definitely isn't normal, I don't think.
03:02 AM WormFood: I lost that nail, but not in the usual way. It just blows my mind, that this odd injury has happened to me so many times.
03:02 AM WormFood: And once, I ripped off someone else's toe nail. :|
03:02 AM MarchHare: Oof! Not a good way to keep friends.
03:02 AM WormFood: by accident, of course. In high school, to one of my teachers.
03:03 AM WormFood: I was going through a door, and they were coming the opposite direction, and they were wearing open shoes, and the bottom of the door is higher than most doors, and the door hit her toe just right, to rip the nail off. I felt terrible about it.
03:05 AM MarchHare: Yes, I can imagine. Probably worse than your teacher
04:02 AM MarchHare: Oof, rescued one, for the rest, the chip reset set the lockbits to 0xFE
05:32 AM exp: how bizarre
05:32 AM exp: presumably a similarly specced knock-off part
04:33 PM specing_ is now known as specing
07:30 PM evidlo: why can't I find a description of register UCSR1A in this datasheet? https://www.mouser.com/datasheet/2/268/doc2467-1315330.pdf
07:30 PM evidlo: I just see it listed in a table, but there's no mention of it anywhere else
07:31 PM evidlo: oh, its because it appears as UCSRnA elsewhere in the datasheet
07:42 PM josuah: evidlo: the datasheet access is restricted I think
07:43 PM josuah: evidlo: also, if you searched "UCSR1A", you might miss descriptsion like "UCSRnx" with 'n' and 'x' placeholders for letters
07:44 PM josuah: I can find UCSRnA in the ATmega328p datasheet I have at hand for instance
07:51 PM Phantom: josuah: why would it be restricted?
11:47 PM jmiehe1 is now known as jmiehe