#avr Logs

Mar 28 2017

#avr Calendar

12:01 AM daey_ is now known as daey
12:48 AM rue_house: use tig welder electrodes
12:48 AM rue_house: you can get them locally
12:52 AM Casper: rue_house: I made some xmas stars with tig filling rod :D
12:52 AM Casper: was some good tig practice
12:53 AM Casper: rue_house: http://i.imgur.com/KWaMnF6.jpg
12:57 AM rue_house: I meant tungsten electrode for welding batteries
12:57 AM rue_house: but that ice
12:57 AM rue_house: did you follow a design or make it up?
01:22 AM Casper: saw a pic, and said: I'll try
01:22 AM Casper: but I had no dimensions at all
01:23 AM Casper: so, mostly made it up
01:23 AM Casper: made 2 of them
01:42 AM polprog: Emil: local retailer
02:04 AM polprog: Emil: why the scope question ? i assume youve seen it in one of my vids?
02:11 AM Emil: postmodern: 16mhz will handle midi just fine, too
02:15 AM Emil: postmodern: no I am wondering who is sponsoring your hobby ;)
03:19 AM Thrashbarg_ is now known as Thrashbarg
05:42 AM enhering is now known as Guest49832
06:14 AM Zzzzz: Hello, can someone help me unbrick my Atmega644a? I followed the instructions here to flash my opensprinkler, everything went OK when I set the fuses and uploaded the hex, but the unit didn't start and now I can't communicate with it using AVRDude.
06:14 AM Zzzzz: https://openthings.freshdesk.com/support/solutions/articles/5000668400-updating-opensprinkler-2-1-to-firmware-2-1-6-and-beyond-
06:17 AM Emil: Zzzzz: what fuses did you write?
06:17 AM Emil: your atmega is not bricked
06:17 AM Emil: probably just a clock issue
06:18 AM Zzzzz: The instructions said to run this command, and it will disable the boot loader so the larger firmware can be uploaded: avrdude -c usbasp -p m644p -U lfuse:w:0xff:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
06:18 AM Emil: look up what thoses fuses do
06:18 AM Emil: avr fuse calculator
06:20 AM Emil: wtf does that project requore moar than 56k of mem
06:20 AM Emil: also usb bootloaders fit into smaller space
06:20 AM Emil: I bet that project could easily be fit into smaller space
06:21 AM Lambda_Aurigae: WHAT WERE THE FUSES BEFORE?
06:21 AM Lambda_Aurigae: oops
06:21 AM Lambda_Aurigae: sorry
06:21 AM Lambda_Aurigae: not watching what I'm typing.
06:22 AM Emil: Zzzzz: and what is your setup like? Do you use a crystal?
06:22 AM Zzzzz: OK, the calculator says the following: Ext Crystal Osc, Frequency 8.0 Mhz, Startup time 16K CK + 65ms, Serial program downloading (SPI) enabled; [SPIEN=0] and SPIEN
06:22 AM Lambda_Aurigae: hehe..that was the next question.
06:23 AM Zzzzz: I'm not sure what the fuses were before, sorry.
06:23 AM Lambda_Aurigae: need to know the original fuses and the physical setup.
06:23 AM Emil: eh
06:23 AM Lambda_Aurigae: at least the physical setup.
06:23 AM Emil: only that
06:23 AM Lambda_Aurigae: would help to know the original fuses to know how it was working before.
06:24 AM Emil: Zzzzz: you need to have a crystal with those fuses
06:24 AM Emil: And wtf 8MHz :o
06:25 AM Emil: is it running at a lower <4.5V?
06:25 AM Lambda_Aurigae: Emil, the fuse calc actually sys 8.0-MHz
06:25 AM Lambda_Aurigae: which means 8MHz and higher.
06:25 AM Zzzzz: There is what looks like a crystal on the board, a rectangle with rounded ends with 25.000 written on it.
06:25 AM Emil: Lambda_Aurigae: ah
06:25 AM Lambda_Aurigae: 25MHz?
06:25 AM Lambda_Aurigae: on a 644?
06:25 AM Emil: overclocked? Cant be
06:26 AM Lambda_Aurigae: that's a bit out of spec.
06:26 AM Lambda_Aurigae: does that thing have an ethernet connection?
06:26 AM Emil: You sure that is the crystal to the board?
06:26 AM Lambda_Aurigae: Emil, I bet it is for an enc28j60 on the board.
06:26 AM Emil: There is probably another one
06:27 AM Lambda_Aurigae: that thing has ethernet.
06:27 AM Emil: Lambda_Aurigae: yeah
06:27 AM Zzzzz: Yes, it has an Ethernet port, there is what looks like another crystal but it appears to be for the real time clock.
06:27 AM Emil: It's possible there is no crystal used, though
06:28 AM Emil: in which case you either need a hv programmer or give a crystal to the device (not sure if you can just give a clock directly)
06:28 AM Lambda_Aurigae: what verion of opensprinkler?
06:29 AM Lambda_Aurigae: the ones I see don't use the 644
06:29 AM Emil: the 644 doesnt have usb eithee
06:29 AM Emil: unless through serial
06:30 AM Lambda_Aurigae: not usb...ethernet.
06:30 AM Lambda_Aurigae: through an enc chip.
06:30 AM Lambda_Aurigae: the ones I'm seeing use atmega328
06:30 AM Zzzzz: Version 2.0
06:30 AM Emil: Lambda_Aurigae: read the page
06:30 AM Zzzzz: The unit has both USB and Ethernet onboard
06:31 AM Emil: it talks about usb
06:31 AM Zzzzz: I think I found the original fuse settings, just verifying now
06:31 AM Lambda_Aurigae: usb for power.
06:31 AM Emil: Zzzzz: the usb traces go through a separate chip first, right?
06:31 AM Emil: Lambda_Aurigae: also reprogramming
06:31 AM Emil: read the link above :D
06:32 AM Lambda_Aurigae: I was looking at 2.2 version
06:33 AM Zzzzz: Emil, yes, it appears they go to a Atmel 1122
06:34 AM Lambda_Aurigae: Emil, it uses v-usb
06:34 AM Lambda_Aurigae: usb pretty much direct into the 644.
06:34 AM Emil: Lambda_Aurigae: fucking hell
06:34 AM Emil: Why the fuck
06:35 AM Lambda_Aurigae: cheap as fuck crap
06:35 AM Emil: well, no wonder the bootloader takes moar time than necessary
06:35 AM Emil: s/time/space
06:35 AM Lambda_Aurigae: it's "open"
06:36 AM Emil: ?
06:36 AM Lambda_Aurigae: main 644 should have a 12MHz crystal.
06:36 AM Lambda_Aurigae: Emil, humor, attempt at, one each.
06:36 AM Lambda_Aurigae: with v-usb...an open wound.
06:38 AM Zzzzz: Here's a schematic if you're interested. https://raw.githubusercontent.com/rayshobby/opensprinkler/cfc7eecd3c8e4b51a555128e0a2acd9188e663f6/OpenSprinkler%20Controller/hardware/v2.0/smt/os20.newenc.png
06:38 AM Lambda_Aurigae: already looking at it.
06:38 AM Lambda_Aurigae: that's how I know it is using v-usb
06:38 AM Lambda_Aurigae: no usb chip on the board.
06:40 AM Lambda_Aurigae: Zzzzz, what programmer hardware are you using?
06:41 AM Lambda_Aurigae: and what error are you getting from avrdude?
06:41 AM Zzzzz: A USBAsp from ebay.
06:42 AM Zzzzz: avrdude: error: programm enable: target doesn't answer. 1
06:42 AM Lambda_Aurigae: you might need to play with the usbasp programming speed.
06:42 AM Lambda_Aurigae: ever find the original fuses?
06:42 AM Emil: We already know whst thr problem id
06:42 AM Emil: is*
06:42 AM Lambda_Aurigae: oh?
06:42 AM Emil: he burned crystal clock fuses but it doesnt use s crystal
06:43 AM Lambda_Aurigae: yes
06:43 AM Lambda_Aurigae: it does.
06:43 AM Lambda_Aurigae: 12MHz
06:43 AM Lambda_Aurigae: if it follows the schematic anyhow.
06:43 AM Zzzzz: I've flashed the firmware on it to allow you to change speed, I've tried a few different speeds but no good.
06:43 AM Lambda_Aurigae: would have to have a crystal for v-usb to work on that chip in fact.
06:44 AM Zzzzz: It's the same fuses as last time but with Boot flash section size=1024 words as well.
06:44 AM Emil: Lambda_Aurigae: that linked schematic has no crystal
06:44 AM Emil: and vusb doesnt requore one
06:44 AM Emil: eithrt
06:44 AM Lambda_Aurigae: on some chips it doesn't
06:45 AM Lambda_Aurigae: schematic I'm looking at is different..
06:45 AM Lambda_Aurigae: which is a 2.1 version.
06:45 AM Emil: Zzzzz: can you find a crystal anywhere else but the two for rtc and ethrtnet
06:45 AM Lambda_Aurigae: that one he posted is 2.0 version
06:45 AM Emil: Lambda_Aurigae: mate
06:45 AM Emil: why must you be like this?
06:45 AM Lambda_Aurigae: too many vesions.
06:45 AM Lambda_Aurigae: sorry
06:45 AM Lambda_Aurigae: I was looking at the wrong schematic.
06:45 AM Emil: -.-
06:46 AM Emil: Zzzzz: like I said already
06:46 AM Emil: Zzzzz: you need to give it a crystal clock
06:47 AM Emil: fortunately that is just a crystal and two caps
06:47 AM Lambda_Aurigae: and use instructions for a 2.0 version if you are using a 2.0 version board.
06:47 AM Lambda_Aurigae: the instructions he posted up there were for the 2.1 version board.
06:47 AM Emil: you can easily manhattan wire them on it
06:47 AM Lambda_Aurigae: which is why I was looking at the 2.1 version schematic.
06:47 AM Emil: and remove them afterwards
06:48 AM Zzzzz: I see, comparing the schematics 2.1 has a crystal and 2.0 doesn't
06:48 AM Emil: Bad project management :/
06:48 AM Lambda_Aurigae: without proper information it is difficult to make proper decisions.
06:49 AM Lambda_Aurigae: Emil, when did v-usb start working without crystal or stable external clock other than on chips with pll?
06:49 AM Emil: Zzzzz: you can borrow a crystal from a another arduino
06:49 AM Zzzzz: Am I reading that right? I'd need a 12Mhz crystal and 2x 18 picofarad caps?
06:49 AM Lambda_Aurigae: yes
06:49 AM Emil: Zzzzz: any crystal above 8MHz
06:49 AM Emil: to "unbrick"
06:49 AM Lambda_Aurigae: for that software to work, it needs to be 12MHz
06:49 AM Emil: yeah
06:50 AM Lambda_Aurigae: just to reprogram it, as Emil said, 8MHz or higher.
06:51 AM Emil: You could probably actually just wiretap directly to another board with a crystal
06:51 AM Zzzzz: Then once I'm able to communicate with it again, I assume I set the fuse back to the internal RC oscillator ?
06:52 AM Emil: Zzzzz: if you can live without usb, yes
06:52 AM Emil: then you can use it again
06:52 AM Emil: though imho vusb should work on most avrs without crystal
06:53 AM Lambda_Aurigae: Emil, interesting..when I worked with it heavily, granted 5 or so years ago, it only worked on pll chips without crystal.
06:53 AM Emil: Lambda_Aurigae: could be the case
06:54 AM Emil: Zzzzz: just solder two wires to the crystal pins of another board (like arduino) without powering it on
06:54 AM Emil: it should work
06:54 AM Lambda_Aurigae: if he has an ardweeny then he can use that(maybe) to generate a clock signal.
06:55 AM Lambda_Aurigae: without soldering to the ardweeny board.
06:56 AM Emil: You can directly inject clock when configured for crystal?
06:56 AM Zzzzz: Trouble is, there are no traces out from the crystal pins on the 644, so I'd have to somehow connect to the pins
06:56 AM Emil: That's good to know
06:57 AM Emil: Lambda_Aurigae: which pin does the clock go? External osc (xtal1?)
06:57 AM Zzzzz: And being SMD, it's tiny, I haven't done soldering that small since I modded PS2's.
06:57 AM Zzzzz: Pins 7&8
06:57 AM Emil: hmm
06:57 AM Lambda_Aurigae: xtal1
06:58 AM Emil: did the hv programmer have anything else but reset at 12v?
06:58 AM Emil: Lambda_Aurigae: nice
06:58 AM Lambda_Aurigae: piece of wood with a pin stuck in the end...
06:58 AM Lambda_Aurigae: nice sharp point to hold against the processor pin
06:58 AM Emil: Zzzzz: you only need to inject clock into xtal1
06:59 AM Lambda_Aurigae: Emil, hvpp is a bit different from isp
06:59 AM Lambda_Aurigae: hvsp is basically just isp with the HV component.
06:59 AM Emil: Lambda_Aurigae: hmm, ah yeah true it was also parallel
06:59 AM Lambda_Aurigae: that chip is hvpp.
06:59 AM Zzzzz: So if I'm injecting clock from another source I'd use xtal1, but if I was using a crystal and caps I'd use both pins?
06:59 AM Emil: yes
06:59 AM Lambda_Aurigae: correct.
07:00 AM Lambda_Aurigae: I've built crystal units in the past using a couple of pins in a piece of balsa wood.
07:00 AM Lambda_Aurigae: solder the crystal and caps to the pins, solder other end of caps together and add a wire and clip to go to GND
07:00 AM Lambda_Aurigae: press against pins on cpu and do programming.
07:00 AM Emil: That's a good technique
07:01 AM Emil: reusable
07:01 AM Zzzzz: Sounds like a plan
07:01 AM Lambda_Aurigae: allows for repositioning a bit too.
07:01 AM Zzzzz: pre build it and press and hold, only need it long enough to change the fuse.
07:01 AM Lambda_Aurigae: just cut the heads off of two pins and stuff them head first into a piece of soft wood.
07:02 AM Lambda_Aurigae: make sure you clip to the GND
07:02 AM Lambda_Aurigae: and use a low speed crystal...8MHz
07:02 AM Lambda_Aurigae: 16 or 20 can give you some issues.
07:02 AM Lambda_Aurigae: even 8 is flakey sometimes with such long connections but not as bad as 16 or 20.
07:03 AM Zzzzz: Great, thanks for the help everyone. I'll see what I have tomorrow and might have to go buy some stuff.
07:04 AM Lambda_Aurigae: Zzzzz, buy? you don't have a bin of old broken gear to steal stuff out of?
07:04 AM Lambda_Aurigae: hehe
07:04 AM Emil: broken gear?
07:05 AM Zzzzz: Maybe, I just had a big clean out. Threw away a ton of stuff I'll never need.
07:05 AM Lambda_Aurigae: bah
07:05 AM Zzzzz: Until today
07:05 AM Lambda_Aurigae: you need it now!
07:05 AM Emil: Dont you have cupboards of components and modules just waiting?
07:05 AM Lambda_Aurigae: Emil, yeah..don't people give you stuff they don't want anymore because it doesn't work?
07:05 AM Lambda_Aurigae: I have a shed full of such stuff.
07:06 AM Lambda_Aurigae: I spend 3 or 4 weekends a year disassembling and sorting parts.
07:06 AM Emil: Lambda_Aurigae: if it is broken I take it apart and salvage the good things
07:06 AM Lambda_Aurigae: same here...I just collect and have a salvage party once every couple months.
07:06 AM Zzzzz: The stuff I usually collect are UPS's and welders, I get the SCR's and IGBT's out of them.
07:06 AM Emil: if it werks but I have no use for it I also do the same
07:07 AM Lambda_Aurigae: I currently have 5 copiers and a couple dozen printers along with a dozen or so UPSs and such to salvage.
07:07 AM Emil: I dont store it, I do it asap
07:07 AM Zzzzz: Someone gave me the inverter out of a Prius once, it wasn't very exciting.
07:07 AM Lambda_Aurigae: Prius can turn upside down? neat!
07:07 AM specing: Zzzzz: do you maybe know where one can get "hardened" copper electrodes for spot welding?
07:08 AM Lambda_Aurigae: specing, welding or hardware store maybe?
07:08 AM specing: maybe
07:08 AM xentrac: like, beryllium copper? I think regular copper would work fine most of the time
07:08 AM xentrac: if you're in the US the standard source for things like that is McMaster-Carr
07:09 AM specing: xentrac: regular copper is not too strong imo
07:09 AM specing: not in the uS
07:09 AM Lambda_Aurigae: xentrac, northern tool for me....
07:09 AM xentrac: it's not too strong, no
07:09 AM Lambda_Aurigae: but I can't afford the expensive stuff.
07:09 AM Lambda_Aurigae: I have a wife.
07:09 AM xentrac: but it usually isn't experiencing much force, is it?
07:10 AM Lambda_Aurigae: for the low end weld specing is looking to do, a piece of heavy copper wire would probably work.
07:10 AM Lambda_Aurigae: like copper mains ground wire.
07:10 AM xentrac: yeah, electrolytic copper
07:10 AM Zzzzz: I get most of my consuables from this guy on ebay. http://www.ebay.com.au/usr/6shop-river
07:11 AM Lambda_Aurigae: have to be replaced often but cheap
07:11 AM xentrac: I'd think the main concern would be resistivity rather than mechanical strength
07:11 AM specing: why? Its copper.
07:11 AM Zzzzz: Got like 100 plasma cutter tips for $50 or something
07:12 AM Lambda_Aurigae: http://www.techbriefs.com/component/content/article/1198-ntb/news/news/26575-silk-sensor-finds-composite-flaws?eid=376634575&bid=1702129 for those who like new sensor technologies.
07:12 AM xentrac: copper with alloying elements dissolved in it e.g. to make it stiffer will have substantially higher resistivity and thus heat up more
07:12 AM xentrac: and also higher thermal resistivity
07:12 AM xentrac: so heat concentrates more
07:12 AM specing: :/
07:12 AM xentrac: copper wire is made from electrolytic copper for lowest resistivity (both heat and electricity)
07:13 AM xentrac: beryllium copper is harder and stronger than any other copper alloy but the beryllium isn't dissolved in the copper after heat-treatment
07:13 AM xentrac: instead it's precipitated into little beryllium-copper-compound crystals dispersed through the copper
07:14 AM xentrac: which sounds like it would be terrible for resistivity but actually the effect is very small
07:14 AM xentrac: and the hardness and strength are up there with steels
07:16 AM xentrac: the downsides are (1) it's like five times as expensive as steel so people never use it for tools unless they have to; (2) beryllium is super toxic if inhaled as particulates, though maybe only to some people, so again people avoid it if they can
07:16 AM Lambda_Aurigae: it causes some interesting lung problems.
07:16 AM xentrac: in a small percentage of the population
07:17 AM Zzzzz: So are you spot welding or you have another project in mind
07:17 AM Lambda_Aurigae: xentrac, yeah...anything from no reaction to rash to full on cancer.
07:18 AM xentrac: right
07:18 AM Zzzzz: Like that stuff in microwave oven magnetrons
07:18 AM xentrac: all of that is only if it's in particulate form though. anyone can use beryllium copper tools with no fear
07:18 AM xentrac: yeah, that's beryllium oxide, Zzzzz
07:18 AM specing: Zzzzz: spot welding
07:18 AM specing: Zzzzz: I'm going to use a car battery to avoid electrocuting myself in the process
07:19 AM Lambda_Aurigae: and once exposed you can develop the symptoms for years or never.
07:19 AM Lambda_Aurigae: specing, scaredy cat!
07:20 AM Zzzzz: Like Asbestos, hell the Chinese are still making car gaskets out of it.
07:20 AM Lambda_Aurigae: yes, handled properly it's "safe"
07:20 AM specing: Lambda_Aurigae: ?_?
07:20 AM Lambda_Aurigae: blown into the walls of a building is NOT handling it properly.
07:20 AM Lambda_Aurigae: specing, you scared of a little electrocution?
07:21 AM specing: y
07:21 AM Lambda_Aurigae: I've been knocked on my ass many many times from high voltages.
07:21 AM specing: I'm not formally qualified to carry out electrocutions
07:21 AM Zzzzz: Turns out the eves under my house are made from white asbestos, that was great to find out after drilling into it.
07:21 AM Lambda_Aurigae: specing, who is?
07:21 AM specing: Lambda_Aurigae: EEs
07:21 AM Lambda_Aurigae: specing, there are any of those here?
07:21 AM specing: probably
07:21 AM specing: they are an elusive bunch though
07:22 AM Lambda_Aurigae: I remember my first contact with high voltage.
07:22 AM Lambda_Aurigae: I was 12
07:22 AM specing: How high was it?
07:22 AM xentrac: it's hard to forget
07:22 AM Lambda_Aurigae: 19 inch picture tube from a B&W tv
07:22 AM Zzzzz: Lol, the old flyback transformer.
07:22 AM Lambda_Aurigae: knocked me on my ass and welded the screwdriver to the TV frame
07:23 AM Lambda_Aurigae: Zzzzz, no,,the giant fucking capacitor that is a tv picture tube.
07:23 AM Lambda_Aurigae: although I've gotten bit by flybacks too.
07:23 AM Lambda_Aurigae: left a burn on my arm and my knee.
07:23 AM specing: Lambda_Aurigae: so to clarify, the electricity did not flow through you?
07:24 AM Lambda_Aurigae: my knee was touching the frame
07:24 AM xentrac: so probably about 20kV
07:24 AM Lambda_Aurigae: it arced to my arm from the screwdriver I was using to pry the high voltage wire out of the tube.
07:25 AM xentrac: what's the proper procedure for discharging those?
07:25 AM Lambda_Aurigae: xentrac, I would say considerably less...maybe 5 to 8 kV because it had been off for an hour or so.
07:25 AM Lambda_Aurigae: a discharge probe
07:25 AM xentrac: is that, like, a megohm resistor?
07:25 AM Lambda_Aurigae: connected to frame and touched under the high voltage contact
07:25 AM Lambda_Aurigae: yes.
07:26 AM Lambda_Aurigae: this I learned AFTER learning my lesson that an hour turned off is not enough to discharge the tube.
07:26 AM Lambda_Aurigae: I had a color one implode on me once too.
07:26 AM Lambda_Aurigae: 27 inch color tube...had just been shut off and I was using a pair of screwdrivers to discharge it.
07:27 AM polprog: do they really send shards around?
07:27 AM Lambda_Aurigae: not sure how it happened but the tube kinda vaporized near the hv point.
07:27 AM Lambda_Aurigae: yeah.
07:27 AM Lambda_Aurigae: tube shattered and an area about 5cm across turned into dust or so it seemed.
07:28 AM Lambda_Aurigae: went PWWTPOMF!
07:28 AM Lambda_Aurigae: sucked in the rebounded fast.
07:28 AM Lambda_Aurigae: the rebound is what shattered the tube.
07:28 AM Lambda_Aurigae: glass shards in my hair for days.
07:29 AM Lambda_Aurigae: luckily I was wearing eye protection.
07:29 AM xentrac: and in your eyes?
07:29 AM xentrac: good thing
07:29 AM Lambda_Aurigae: always do so when working with picture tubes.
07:29 AM Lambda_Aurigae: I've had several go poof on me when breaking open the neck.
07:29 AM Lambda_Aurigae: but only once when discharging.
07:29 AM xentrac: like, cracking the vacuum seal?
07:30 AM Lambda_Aurigae: yeah.
07:30 AM Lambda_Aurigae: long handled pliers, grab the nipple and snap it.
07:30 AM xentrac: I can see how that would be risky
07:30 AM Lambda_Aurigae: let it suck in air.
07:30 AM Lambda_Aurigae: I usually wrap in bubble wrap when I do that these days.
07:31 AM xentrac: this is why we need more robot arms
07:31 AM xentrac: the best eye protection is a concrete wall
07:32 AM Haohmaru: did someone say "nipple"
07:32 AM Haohmaru: NSFW that sh*t
07:32 AM Haohmaru: don't leave yer bare nipples dangling
07:37 AM Lambda_Aurigae: just rip em off with pliers!
07:37 AM Zzzzz: I should really get around to finishing off that robot arm I was printing.
07:38 AM Lambda_Aurigae: someone gives me a tv 2 or 3 times a year...I pop the tube then remove the yoke before putting it in a heavy contractor garbage bag and dropping it into the dumpster.
07:38 AM Lambda_Aurigae: I have decompressed them with rifles in the past too.
07:39 AM xentrac: that kind of sounds safer
07:39 AM Lambda_Aurigae: yeah, but leaves glass all over the field sometimes.
07:40 AM specing: put them into a bag beforehand
07:40 AM Lambda_Aurigae: what's the fun in that?
07:40 AM Lambda_Aurigae: you shoot something with a .30-06 or 10mil and you want to watch it explode!
07:41 AM specing: why not just throw it with a trebuchet then?
07:41 AM Lambda_Aurigae: don't have one big enough
07:41 AM Lambda_Aurigae: yet
07:41 AM Lambda_Aurigae: :}
07:41 AM xentrac: it occurs to me that a blob of lead glass would be an ideal projectile for breaking picture tubes with
07:42 AM Lambda_Aurigae: a blob of lead works well too.
07:42 AM Lambda_Aurigae: specially if it is brass jacketed
07:51 AM Zzzzz: Anway, gtg, thanks for your help today.
08:49 AM xentrac: lead glass is a lot harder than lead, so you could get by with much lower energy
08:56 AM xentrac: how stable is the threshold voltage at which an input pin transitions from high to low? I used that to measure light in http://canonical.org/~kragen/light_sensing but I never calibrated that to absolute illuminance or anything
09:04 AM skz81: transition from Hi to Lo is @0.3Vcc IIRC
09:04 AM skz81: and 0.7Vcc for Lo to Hi
09:05 AM skz81: look @ electrical charactertistics in the datasheet
09:05 AM skz81: xentrac, ^
09:08 AM xentrac: what I mean is, how thermally stable is that 0.700?
09:09 AM xentrac: or 0.300
09:09 AM xentrac: and those don't really tell you the transition voltages
09:10 AM xentrac: Vil is 0.3Vcc max on the ATtiny2313 I was using, for example
09:10 AM skz81: Vil ?
09:10 AM xentrac: I don't have subscript I and L
09:10 AM xentrac: but that doesn't mean that it's guaranteed to transition from high to low when you cross 0.3Vcc
09:11 AM xentrac: and no earlier
09:11 AM xentrac: it means that if you have a voltage that is less than 0.3Vcc then it is guaranteed to read as low
09:11 AM xentrac: the datasheet doesn't make any guarantees about where in the 0.6Vcc to 0.3Vcc range the high-to-low transition happens
09:14 AM skz81: <xentrac> but that doesn't mean that it's guaranteed to transition from high to low when you cross 0.3Vcc >> nope, but min and max for the transition are given in the DS
09:14 AM Emil: yeah it is entirely batch and chip specigic
09:14 AM xentrac: so I'm wondering how much it varies and what it depends on in practice: temperature? other loads on the circuit? clock speed? (variation in Vcc obviously)
09:14 AM Emil: temperature has some effect
09:14 AM Emil: clock speed shouldnt
09:14 AM Emil: have much
09:16 AM xentrac: hmm, I guess the ATtiny2313 has an an analog comparator even if it doesn't have an ADC. maybe I should just reference that against a zener and give up on abusing the digital level transition times
09:16 AM Emil: you shouls
09:16 AM Emil: should*
09:16 AM Emil: Also buy a real reference diode
09:17 AM Emil: and not just any zener
09:18 AM Emil: xentrac: you can even do a poor mans sigma delta adc
09:18 AM Emil: low pass filter pwm on the other analog comparator pin :D
09:18 AM xentrac: ain't buying shit
09:18 AM Emil: lol
09:18 AM xentrac: or PDM, amirite?
09:19 AM xentrac: I'm just working off crap in the parts bin
09:19 AM Emil: whatever floats your boat best :D
09:19 AM xentrac: clearly a bandgap voltage reference IC would be better
09:19 AM xentrac: actually I do have a TL1431 if I can get it desoldered
09:20 AM Emil: but with pwm/pdm you have adc :D
09:20 AM Emil: and not binary values
09:20 AM xentrac: so the other advantage (for my application) is that capacitor discharge time is logarithmic
09:21 AM Emil: you can empty it with a pin, too
09:21 AM xentrac: yeah
09:21 AM Emil: hehhhehe
09:21 AM xentrac: I think this is actually a pretty common situation and the reason we use linear ADCs is maybe largely that a lot of our electronic and software design is from the 1960s and 1970s
09:21 AM Emil: you could even abuse pin capacitance
09:22 AM Emil: what is a common situation?
09:22 AM Emil: What is the alternative to lineat adcs?
09:22 AM xentrac: logarithmic ones, like the μlaw ADCs the Bell system used to use
09:22 AM xentrac: I want to cover a fairly large range, like a factor of 2000 from the largest to the smallest thing I want to measure
09:23 AM xentrac: minimizing the relative error, not the absolute error
09:23 AM xentrac: if I'm willing to take a 1% quantization error at the smallest thing, that would imply that on a linear ADC I need at least 200,000 counts: an 18-bit ADC
09:24 AM xentrac: but log(2000)/log(1.01) is only 764
09:26 AM xentrac: so if I charge the capacitor up to some voltage representing the thing I want to measure, then discharge it through a resistor and measure the time to get to some threshold voltage, like 2.5 millivolts (ouch!), that time represents the logarithm of the voltage
09:27 AM xentrac: and a constant absolute error (like one clock) in the time measurement amounts to a constant relative error (like 1%) on the voltage measurement
09:27 AM xentrac: I'm not that confident in a threshold of 2.5 millivolts though
09:28 AM xentrac: I don't know, maybe I'm talking nonsense and there's a perfectly good reason people don't do this all the time that is obvious to everyone else but not to me?
10:35 AM Jan-: if I have a function in C, on an AVR, something like void foo(){bar("Baz");} is the string "Baz" copied into sram from progmem when I call the function?
10:36 AM xentrac: almost
10:37 AM Jan-: It's just that I have a wierd problem with a function that has a lot of string literals in it like that
10:37 AM Jan-: it seems like a memory issue
10:37 AM xentrac: it's copied into sram from progmem when the program starts, long before you call the function
10:37 AM Jan-: oh right.
10:37 AM Jan-: so splitting it up into sub-functions won't help, because they all sit in sram whether they've been called or not.
10:37 AM xentrac: so even if you don't call the function it takes up memory space
10:37 AM xentrac: right
10:37 AM Jan-: ...right.
10:37 AM Jan-: okay that helps
10:37 AM Jan-: AVRs don't have enough RAM :/
10:38 AM specing: yes they do
10:38 AM xentrac: because bar is entitled to hold a copy of the pointer to that string and expectit to remain valid
10:38 AM Jan-: oh hm.
10:38 AM Jan-: C has a pretty brute force approach to closures.
10:38 AM xentrac: you can say that again
10:38 AM xentrac: it's possible to keep the string from being copied into SRAM
10:39 AM xentrac: the cost is that functions expecting pointers to strings in SRAM will not be able to cope (unless you copy it into SRAM when you need it)
10:39 AM LeoNerd: You can use PSTR()
10:40 AM Jan-: PROGMEM all the things?
10:40 AM _ami_: Jan-: yeah!
10:41 AM xentrac: there is some documentation about this in http://www.atmel.com/webdoc/avrlibcreferencemanual/pgmspace_1pgmspace_strings.html
10:42 AM Jan-: it's OK
10:43 AM Jan-: it's just a GIANT DEBUG FUNCTION which PRINTS ALL THE REGISTER ENTRIES.
10:43 AM * Jan- calms down a bit
10:43 AM specing: Jan- please
10:43 AM specing: be Jan+
10:44 AM enhering: Hi.
10:45 AM Tom_L: lo
10:45 AM Jan-: print *all* the register entries?
10:45 AM enhering: Question: Is there a buffer overflow protected version of dtostrf?
10:45 AM Jan-: what's weird is that if I have it run all the code I've written it screws up. But if I have it repeat sections of the code, so it's outputting the same or more characters, it's fine.
10:45 AM enhering: This function is fatal to the code...
10:46 AM Jan-: I guess that's the compiler detecting the repetition and looping it so it doesn't have to repeat the string literals?
10:46 AM xentrac: I guess?
10:46 AM Jan-: hard to tell
10:46 AM Jan-: (well, impossible to tell)
10:46 AM Tom_L: https://github.com/arduino/Arduino/issues/3401
10:46 AM Tom_L: enhering
10:47 AM Tom_L: this is pure avr not ardweenie btw
10:47 AM Lambda_Aurigae: use a bigger avr....aavr....atmega1284
10:47 AM Jan-: I use the arduino nano board just as a cheap way to a dev board.
10:47 AM Jan-: Maybe that makes me an arduweenie. :/
10:47 AM Tom_L: naw you're just a weenie
10:47 AM Lambda_Aurigae: yup
10:48 AM enhering: Tom_L: none of those solve the problem.
10:48 AM enhering: What solves is to rewrite dtostrf in the same way as snprintf works.
10:49 AM Tom_L: http://www2.cs.uidaho.edu/~rinker/cs404/avr-libc-user-manual-1.6.1.pdf
10:49 AM xentrac: Jan-: https://forum.arduino.cc/index.php?topic=50197.0 goes into some more details than the manual
10:50 AM * Jan- jabs Tom_L in the eye with a biro
10:51 AM Jan-: *poke*
10:51 AM Jan-: how big is the range over which gcc will actually look for repeated code?
10:51 AM Jan-: presumably there is a limit to its cleverness
10:51 AM Lambda_Aurigae: typing on cellphone through teamviewer is fun...
10:51 AM xentrac: probably not if we're talking about repeated string literals
10:51 AM xentrac: Lambda_Aurigae: man, fuck teamviewer
10:52 AM Lambda_Aurigae: xentrac...ixentrac...it works.
10:52 AM Lambda_Aurigae: vnc from my phone was unusable.
10:52 AM xentrac: I mean for repeated string literals I would expect it to deduplicate at the scope of a source file if at all
10:53 AM enhering: dtostrf is based on this: https://github.com/vancegroup-mirrors/avr-libc/blob/master/avr-libc/libc/stdlib/dtoa_prf.c
10:53 AM enhering: And on this: https://github.com/vancegroup-mirrors/avr-libc/blob/master/avr-libc/libc/stdlib/dtostrf.c
10:58 AM enhering: https://android.googlesource.com/toolchain/avr-libc/+/edcf5bc1c8da8cc4c8b560865d2a54b73c1b51d3/avr-libc-1.7.1/libc/stdlib/ftoa_engine.S
11:02 AM akaWolf1 is now known as akaWolf
11:06 AM enhering: dtostrf is unpredictable. Depending on what float you give it, it can overflow the buffer. No way of avoiding it.
11:06 AM enhering: And very hard to detect
11:07 AM enhering: I have to compromise AVR memory giving this function a huge buffer just to avoid overflow.
11:07 AM enhering: Sad.
11:28 AM enhering: https://www.irccloud.com/pastebin/SGnZdAo3/
11:28 AM enhering: https://gist.github.com/enhering/eba01d56ffdee91c19615d8681f48216
11:29 AM enhering: I hope this works.
11:32 AM enhering: I just updated the code and now it is compiling. Same link.
11:42 AM skz81: <Tom_L> naw you're just a weenie >> Is not that a stupid bear ?
12:41 PM sebus: Hello. Has anyone here did anything on vintage ATF16V8B or equivalent devices with Atmel WinCUPL? I think I've a problem understanding how this stuff works https://pastebin.com/jbajPKN0
12:42 PM sebus: Well, it makes me wondering why internal latch state is not always same even if all pins are tied to ground/vcc through 2,2k resistors :/
12:49 PM Lambda_Aurigae: the 2.2K resistors are likely pullups or pulldowns and the device can override them.
01:07 PM sebus: Lambda_Aurigae but pin 1..11 are input only on this device :/
01:07 PM Lambda_Aurigae: yeah, so?
01:07 PM Lambda_Aurigae: they are default settings maybe?
01:08 PM Lambda_Aurigae: without seeing a schematic, no way for me to have a clue.
01:08 PM sebus: they cannot act as output
01:08 PM sebus: as datasheet says
01:08 PM Lambda_Aurigae: but they can act as inputs...the pullup and pulldown resistors can be default inputs.
01:09 PM Lambda_Aurigae: but external device connected to those pins can override the resistors.
01:09 PM Lambda_Aurigae: I don't know what is connected because I haven't seen a schematic.
01:10 PM sebus: ok ill draw it now
01:10 PM Lambda_Aurigae: I glanced at the schematic and it looks like a CPLD or similar.
01:11 PM Lambda_Aurigae: err
01:11 PM Lambda_Aurigae: not at the schematic...the datasheet
01:11 PM Lambda_Aurigae: it's beeing a looong day.
01:17 PM Lambda_Aurigae: ok..back to worky.
01:20 PM Lambda_Aurigae: aaand, gotta wait for someone else to get back to me, so, still here causing trouble.
03:12 PM sebus: Lambda_Aurigae if you're still here http://wstaw.org/m/2017/03/28/sch_bsw.png this is what I'm going to make
03:13 PM polprog: sebus: wow, that what i call a bus
03:14 PM polprog: that's
03:14 PM sebus: what a mess
03:14 PM sebus: D:
03:14 PM polprog: dont worry, ive seen worse
03:14 PM polprog: ;0
03:14 PM polprog: ;)
03:14 PM sebus: so far, rp2a03 starts from $fffc
03:14 PM sebus: alike... 6502 :D
03:15 PM sebus: <it is 6502 without decimal mode>
03:15 PM polprog: what is the whole thing gonna be?
03:15 PM Emil: What is that?
03:16 PM sebus: polprog http://www.kevtris.org/Projects/hardnes/index.html
03:16 PM sebus: this ^
03:16 PM sebus: so, I need ROM and RAM in same place
03:17 PM polprog: awesome
03:17 PM sebus: interrupts can be called internally
03:17 PM sebus: with some.. tricks
03:17 PM Emil: sebus: so
03:17 PM sebus: but ffs i cannot manage to get work this atf thingy
03:17 PM Emil: you want to play back music from those files
03:17 PM sebus: shall I xor clock with MEMSW and RST?
03:17 PM Emil: why not just have a single flash chip
03:18 PM polprog: do you have to use that thing? its *old as cola*
03:18 PM polprog: coal*
03:18 PM sebus: polprog I have thses chips so why not to use it
03:18 PM xentrac: mmm, cola
03:20 PM sebus: on second board there'll be small keypad, lcd and sd interface + uart, om
03:21 PM polprog: i would take out the atf and write a simple test program to exclude some obvious stuff like defective chip
03:21 PM polprog: if you can
03:23 PM polprog: and probe things around with a multimeter
03:23 PM sebus: polprog this pld starts with random value in flip-flop register, it's the only thing I have problems with
03:23 PM polprog: i may be over simplyfying now but cant you write a zero there?
03:23 PM sebus: even with soldered 470 ohm resistors to ground on all input pins
03:24 PM polprog: that's unusual
03:24 PM polprog: i'd say that this should not happen
03:25 PM sebus: wincupl simulator says it should be "0" whenever you set clock pin 0 or 1 on start
03:28 PM polprog: simulator? but does that schematic exist?
03:28 PM polprog: i mean is built
03:31 PM sebus: https://pastebin.com/jbajPKN0 this one can be compiled just fine. I tried to add variables like .oe/.r/.sp/ to flip-flop but compiler says nope with Q1 or Y1.DFB
03:32 PM polprog: is this assembly?
03:32 PM sebus: still, cpu output on MEMSW on reset is LOW, RW pin can be random
03:32 PM sebus: polprog CUPL language
03:32 PM sebus: for pld
03:33 PM polprog: this is waay to complicated for me ;)
03:33 PM polprog: im quite surprised they use a real nes cpu there
03:33 PM polprog: gtg
03:33 PM polprog: o/
03:33 PM sebus: polprog o/
06:13 PM arij is now known as arij_work
08:29 PM arij_work is now known as arij
11:30 PM JanC is now known as Guest92965
11:30 PM JanC_ is now known as JanC
11:59 PM daey_ is now known as daey