#avr Logs

Apr 29 2017

#avr Calendar

12:15 AM Casper: Chillum: very easy to do actually
12:18 AM Casper: and if you do your own, do yourself a favor, and go in 4 bits mode
12:18 AM Casper: slightly harder to code, but you save so many pins...
12:18 AM Casper: just respect the 4 bits initialisation sequence
12:20 AM grafi is now known as Guest91035
12:30 AM daey_ is now known as daey
12:33 AM Chillum: Casper: I have just been using those I2C adapter boards
01:44 AM rue_house: I just use a 74ls165
04:35 AM LeoNerd: Ugh... 74'165 is annoying. It's not really useable over SPI for two reasons
04:35 AM LeoNerd: Lack of hiZ on serial output, and needs a separate latch signal
06:40 AM polprog: heh, i have a ~300 pcs reel of 74hct573, similar ones to 74'165
06:41 AM polprog: i buoght it on the market, probably from some bankrupt factory, maybe polcolor TV factory
06:42 AM LeoNerd: ... octal D-latch? That's nothing like a 165
06:42 AM LeoNerd: There's no shift to it
06:43 AM polprog: maybe, i havent read the datasheet of 165. i just read paralell load
06:43 AM LeoNerd: 165 is *sortof* the input complement to a 595
06:43 AM LeoNerd: But whereas a 595 really will sit on SPI just fine, a 165 won't
06:43 AM polprog: cool, but missing HiZ
06:44 AM LeoNerd: Missing hiZ, and also the LOAD pin doesn't quite work right
06:44 AM polprog: what's it supposed to do?
06:44 AM LeoNerd: For proper SPI use, the chip would sample its 8bit input at the moment of hi->low transition on its "select" pin
06:50 AM LeoNerd: I suppose you can sortof do it if you treat LOAD as an active-high SS
07:03 AM LeoNerd: 74'1G126 on the output line driven by that, it might sortof work
07:03 AM LeoNerd: But it's still a hack around the fact it's not a *true* SPI-capable shift register
07:04 AM polprog: aren't creative hacks what true electronics is about?
07:04 AM LeoNerd: Hah
07:04 AM LeoNerd: Well maybe
07:44 AM Lambda_Aurigae: I thought we were just replacing everything with ardweeny boards..
07:45 AM Lambda_Aurigae: that's what they do on hackaday!
07:45 AM polprog: ardweeny and wrong resistors!
07:45 AM Lambda_Aurigae: it's only wrong if the LED burns out in under 2 minutes.
07:45 AM Lambda_Aurigae: because that's how long it takes to make the video.
07:45 AM polprog: kek
11:29 AM JanC_ is now known as JanC
01:12 PM xentrac: I've been thinking I could maybe use some random JTAG-equipped chip with boundary scan in place of a 74595; anybody tried that?
01:12 PM xentrac: am I misunderstanding how boundary scan works?
01:15 PM sebus: I did some experiments @ work with LPC1114 & jtag. Yep, you can set/clear pins via this thing.
01:15 PM sebus: at least I did it under keil
01:16 PM xentrac: was the LPC1114 the JTAG target, or was it controlling something else via JTAG?
01:18 PM sebus: lpc1114 was the target
01:19 PM xentrac: and so basically while it was being boundary-scanned it was sort of like a 74595 shift register, only with more pins?
01:19 PM xentrac: like, you would load a bunch of data in bit-serially, then send it a command to latch it onto all its output pins?
01:19 PM xentrac: (and I guess other data to control pin direction and pullups?)
01:20 PM xentrac: I'm asking because that's what it sounds like from what I've read, but I have never actually used JTAG
01:20 PM sebus: yes, within a software you could do anything with internal chip registers
01:21 PM xentrac: hmm, but that's a different kind of thing than the bounday scan feature, isn't it?
01:23 PM sebus: as wiki says... it's purpose for testing interconnects on pcb or some blocks inside chip...
01:24 PM sebus: maybe I misunderstood what you were trying to achieve :<
01:25 PM xentrac: well, so, here in Argentina importing electronics from overseas is a little tricky (expensive, slow, unreliable due to customs problems)
01:25 PM xentrac: but there's lots of e-waste
01:26 PM xentrac: of course everybody's constant problem with microcontrollers, especially AVRs, is that they don't have enough pins, which is why we care about things like HiZ on bit-serial outputs (as polprog was talking about)
01:28 PM xentrac: there are a couple of different ways to solve that problem — a 74595, for example, lets you shift out a bunch of bits serially that you want to put on a bunch of lines you're driving
01:28 PM sebus: 595 is serial in -> parallel out
01:28 PM xentrac: exactly
01:28 PM xentrac: but 74595s are not a very common part to find in junk
01:28 PM xentrac: you pretty much have to buy them new
01:28 PM sebus: there's also... 165 series which ... reads input bits and then sends to SPI ;]
01:29 PM xentrac: exactly, that's what we were talking about earlier
01:29 PM sebus: read*
01:29 PM xentrac: so I was thinking that maybe if I salvage some random chip that supports JTAG boundary scan, I can use it as a replacement 74595/74165
01:30 PM xentrac: disregarding completely its original designed purpose
01:30 PM xentrac: maybe it's an Epson microcontroller with some undocumented instruction set. Doesn't matter! As long as it responds to JTAG boundary scan commands, I can manipulate it like a marionette
01:31 PM xentrac: that's the idea. will it work?
01:32 PM sebus: Hummm... Might work, but to be honest, I've never played this way :D
01:33 PM xentrac: (sometimes people also use a CD4051 instead of a shift register for this kind of thing, especially for input)
01:33 PM sebus: CD4051 is mux iirc
01:33 PM xentrac: yeah
01:33 PM sebus: slooooooow
01:33 PM xentrac: yeah
01:34 PM xentrac: but the idea is you spend 4 pins and you get 8 slow (but analog-capable! and bidirectional!) pins
01:34 PM xentrac: with the 4051
01:35 PM sebus: I remember... I've used once CD4067 or something like that with ADC0804 on pure old 6502 just to read some voltage inputs, heh
01:35 PM sebus: but that was over 15 years ago or so
01:35 PM xentrac: that's before I even started with micros
01:36 PM xentrac: the only circuits I'd done before that were either pure analog or discrete (SSI) logic
01:39 PM julius: hi guys
01:40 PM sebus: and still... 4051 is just a mux, so... this is like playing with 74hc138 or something like that; so far you need to be able read external pin, set it's value and keep it in this state as long as you need. This won't work :P better to use 74hc640
01:40 PM sebus: julius: o/
01:41 PM xentrac: the 74138 pulls its nonselected outputs low; the 4051 tristates them
01:44 PM xentrac: so if you have enough capacitance on the output line for whatever load you're driving, and it's a voltage-mode rather than current-mode signal, the 4051 will totally give you eight slow outputs if you want them
01:45 PM xentrac: if what you're driving is a MOSFET (whether discrete or in a CMOS IC input pin) it may have enough capacitance by itself even without adding a discrete capacitor
01:46 PM sebus: but only one at a time is in active mode. It might be good if you ran out of adc inputs or so.
01:52 PM xentrac: right, but do you understand what happens to the voltage at a tristeated output?
01:53 PM xentrac: let's say your load is purely capacitive and 5pF, and the channel leakage of the 4051's tristated output is 100pA
01:53 PM sebus: yep, current leak may drive mosfet
01:54 PM xentrac: that means that the voltage at the output pin is going to drift (toward whatever voltage is at the other end of the channel) from what it was when you had the output selected at 20 volts per second
01:54 PM xentrac: or, somewhat more vividly, 20 millivolts per millisecond
01:55 PM sebus: if it's connected to this tristated out, and yep, tri-stated = floating pin
01:56 PM xentrac: so if you are muxing at 100 hertz and you put 2.9 volts on one output and 0 volts on the others, then during the 8.75 milliseconds that your 2.9-volt pin isn't being driven, it's going to drift down toward ground
01:57 PM xentrac: but only by 175 millivolts. so by the time you come around to it again, it's drifted down to 2.725 volts
01:57 PM xentrac: does that make sense?
01:59 PM xentrac: the 0-volt outputs in this example are drifting up toward the average voltage on the other pins, which is 0.4 volts
02:00 PM xentrac: (I don't actually know how FET channel leakage varies with voltage, but I assume it's ohmic and not like exponential or something bizarre like that)
04:32 PM xentrac: sebus: does what I was saying make sense?
04:33 PM polprog: xentrac: so how does that look in practice>
04:33 PM polprog: ?
04:33 PM xentrac: which thing?
04:34 PM polprog: ive seen some polish blogger who made a guide on AVRs, using a board with an attiny and a led display pulled from a satellite set-top box :v
04:34 PM polprog: the scavenging thing
04:34 PM sebus: if you have no load or drive a mosfet, then it may be okay... still I would not recommend leaving mosfet gates floating even in multiplexed mode
04:35 PM polprog: mosfet gates should be pulled down with a >100k resistor
04:35 PM sebus: polprog ++;
04:35 PM polprog: actually floating mosfet gates is useful when you test them with a meter
04:36 PM polprog: you put it into continuity, touc the gate-source, charge the gate that way, touch the drain-source, beep if mosfet's working
04:36 PM polprog: i hope it's clear :P
04:38 PM xentrac: heh, that idea never occurred to me!
04:38 PM xentrac: I think I've seen my meter successfully measure LEDs at over 3 volts, so that ought to work
04:38 PM polprog: i think i got it from some youtube video
04:39 PM polprog: hackaday at it again
04:39 PM polprog: "can anybody recommend me a good avr simulator for windows?"
04:39 PM xentrac: and I'm pretty sure it won't go over the Vgs max of 10 or 20 volts unless it's, like, a GaN transistor
04:39 PM xentrac: heh
04:39 PM polprog: "vmware + linux"
04:39 PM polprog: heh
04:40 PM sebus: polprog: hummm.. I use some stuff from oshonsoft sometimes, but.. meh, some internal stuff doesn't work eg timer1/2 and it is only for 8bit.
04:41 PM xentrac: driving a gate through a 4051 isn't really leaving it floating
04:41 PM xentrac: it's more like pulling it (somewhere) with a 200 gigohm resistor
04:41 PM xentrac: I think the 4051's pins may even have clamping diodes on them
04:46 PM xentrac: hmm, no, they don't. if they did you couldn't use them with unbiased ac signals
04:49 PM sebus: think about cd4051 like 3-to-8 decoder with 8 JFET transistors... whoa.. JFET... anyone make them today?
04:52 PM sebus: how about diodes? TI says nothing... in current datasheet for this IC
04:54 PM xentrac: yeah, no diodes
04:55 PM xentrac: there are a lot of JFETs on the market. they're more specialized than MOSFETs but they are dramatically better for some purposes
05:10 PM polprog: i had read a chapter on jfets in the art of electronics but i dont remeber at all what exactly they are
05:12 PM xentrac: they're just like MOSFETs except they leave out the MOS layer
05:12 PM xentrac: so there's a junction there instead
05:12 PM polprog: so they have leakage current?
05:12 PM xentrac: yeah
05:12 PM xentrac: worse, you can't forward-bias the junction (or you get a gate current)
05:13 PM polprog: so in practice, whats the difference from a bjt?
05:13 PM xentrac: well, you don't normally forward-bias the junction; you operate them in depletion mode
05:13 PM xentrac: so you don't have a gate current
05:13 PM polprog: vg < vs ?
05:14 PM xentrac: my IRC client's Unicode is broken
05:14 PM Lambda_Aurigae: that's good.
05:14 PM polprog: i used no unicode there,
05:14 PM xentrac: oh, then I don' understand what "vg < vs ?" means
05:14 PM Lambda_Aurigae: vg is less than vs
05:14 PM xentrac: oh, yes :)
05:15 PM polprog: cool
05:15 PM xentrac: or equal to
05:15 PM xentrac: also they have much lower on-resistance than a BJT
05:15 PM polprog: thanks for clearing that out,
05:16 PM xentrac: and they can switch ac signals like a MOSFET
05:16 PM xentrac: maybe more importantly, their on-resistance is actually a resistance up to saturation
05:17 PM xentrac: I mean it's ohmic, the current is proportional to the voltage
05:17 PM xentrac: while in a BJT it's nearly constant, like a current source
05:20 PM xentrac: JFETs have a lot lower noise than MOSFETs, when that matters (and when it doesn't, like for digital signals, you use a MOSFET). BJTs have lower noise than even JFETs but they slurp input current in the milliamps or microamps instead of the picoamps
05:29 PM polprog: wow
05:29 PM polprog: nice, tyvm
05:30 PM polprog: g'night
05:30 PM polprog: !
05:40 PM xentrac: sure!