#avr Logs

May 10 2020

#avr Calendar

02:00 AM rue_shop3: --
03:46 AM matrixstorm: hi
04:27 AM rue_mohr: hi
05:34 AM nohit: low
05:42 AM matrixstorm: low
11:10 AM matrixstorm: hi
11:11 AM matrixstorm: nothing happening here...
11:17 AM rue_mohr: low
01:35 PM Smidge204: :D
01:37 PM polprog: undefined
01:37 PM * polprog ties rue_mohr to Vcc
01:42 PM matrixstorm: ?
01:43 PM Smidge204: ;D
01:51 PM rue_mohr: I'm high!
01:53 PM Smidge204: Hello High, I'm Smidge.
01:54 PM rue_mohr: high!
01:54 PM rue_mohr: ok, so I need some kind arduino (avr carrier) and some software (C is the only proper language in the world)
01:54 PM Smidge204: I wrote my own bitbang SPI so I could do a cheat and combine MOSI and MISO into a single pin; https://i.imgur.com/CoKpWm4.png
01:55 PM rue_mohr: good show
01:55 PM rue_mohr: oh I was going to use a m8
01:55 PM Smidge204: The decoder doesn't like the timescale so it's wrong, but it goes right if I zoom in so it's fine
02:01 PM rue_mohr: device or master?
02:02 PM Smidge204: uC is the master
02:05 PM rue_mohr: ok mic5841 vs 74hc595
02:05 PM rue_mohr: 595 clocks data on rising edge
02:06 PM rue_mohr: mics5841 clock data on rising edge
02:06 PM rue_mohr: 595 strobe is rising edge
02:07 PM rue_mohr: 5841 strobe is rising edge
02:07 PM rue_mohr: 595 shifts bit H in first
02:08 PM rue_mohr: 5841 shifts bit 8 in first
02:08 PM rue_mohr: ok, good, I can use my 595 code to the 5841
02:08 PM rue_mohr: ok, rue, lets write hello world then
02:09 PM rue_mohr: oh look, I already did that
02:09 PM rue_mohr: ok, add 595 code
02:11 PM rue_mohr: maybe I better allocate pins before I get too deep
02:12 PM rue_mohr: 328 and 8 compatible? hmmm
02:15 PM Smidge204: ?
02:15 PM rue_mohr: moving code around
02:23 PM Smidge204: "328 and 8" is ambiguous
02:23 PM Smidge204: Atmega vs. attiny?
02:24 PM rue_mohr: no
02:24 PM rue_mohr: atmega328 vs atmega8
02:25 PM rue_mohr: is there a tiny8?
02:26 PM rue_mohr: ok, what has to be on my controller board
02:26 PM Smidge204: 8 series anyway
02:26 PM rue_mohr: the atmega8
02:26 PM rue_mohr: a header for the serial comms
02:26 PM rue_mohr: 3 headers for the relays
02:26 PM rue_mohr: a header for the encoder switch
02:26 PM rue_mohr: a header for the keybaord
02:27 PM rue_mohr: a header for the display
02:27 PM rue_mohr: ...
02:27 PM Smidge204: What's the display interface?
02:27 PM rue_mohr: maybe I should put more on board
02:27 PM Smidge204: I2C?
02:27 PM rue_mohr: it'll be shifted, like the relays, I'm probably going to spend a month making a custom vfd
02:27 PM Smidge204: wew
02:28 PM rue_mohr: same chip 5841
02:28 PM rue_mohr: I'v done it before, I just dont like the display I used
02:28 PM rue_mohr: I have another display so I can do it all over again...
02:28 PM rue_mohr: but the new display has a memory symbol, which is good
02:29 PM rue_mohr: maybe if I put the debounce for the enocder switch on the controller board...
02:29 PM rue_mohr: hmm, what am I doing for keyboard...
02:29 PM rue_mohr: 9 buttons? hmm
02:29 PM rue_mohr: I could do that with a 74hc164
02:29 PM Smidge204: The newer AVRs have capacitive touch drivers built in
02:29 PM rue_mohr: tho the scanless thing is nice
02:29 PM LeoNerd: I've still yet to find a decent SPI-compatible input shift register
02:30 PM LeoNerd: They just don't seem to exist. :/
02:30 PM rue_mohr: dunno if there is a rule about not using VFD and capacitive touch on the same project
02:30 PM LeoNerd: For buttons, I²C-attached PCA8574 is much nicer. pinchange interrupt pin and simple one-byte read protocol
02:30 PM rue_mohr: LeoNerd, 74hc164?
02:31 PM LeoNerd: 164 looks like "serial in parallel out" - so, driving LEDs not reading buttons
02:31 PM rue_mohr: oh sorry
02:31 PM rue_mohr: uh...
02:31 PM rue_mohr: 164?
02:31 PM LeoNerd: 165 is close
02:31 PM rue_mohr: no rue
02:31 PM rue_mohr: 165
02:31 PM rue_mohr: why is it wrong?
02:31 PM LeoNerd: No chipselect line, so the output is always driven, never hiZ
02:32 PM LeoNerd: Additionally, it doesn't sample on falling edge of the LOAD line, it is continually latched while low
02:32 PM rue_mohr: oh they didn't put on OE on that
02:32 PM LeoNerd: So you need to tickle it by a H->L->H pulse just to get it to latch the input, then separately enable its output with some sort of CS-ish gate so you can clock the bits out again
02:33 PM rue_mohr: hmm
02:33 PM Smidge204: Do you have a bunch of shift registers sitting around and that's why you're using them?
02:33 PM rue_mohr: the mic5841 is a uln2803 with a built in 595
02:33 PM rue_mohr: who could ask for more
02:34 PM rue_mohr: their crazy expensive, but I just happen to have like 40 of them from a teardown
02:34 PM LeoNerd: Yah; for output SPI-attached SRs are quite nice. I just don't know any input ones
02:34 PM Smidge204: Fair enough
02:34 PM rue_mohr: there is a 59x
02:34 PM rue_mohr: 592?
02:34 PM LeoNerd: Besides, for button-reading you really want an interrupt on change so you don't have to poll
02:34 PM LeoNerd: PCA8574 gives you that :)
02:35 PM rue_mohr: aha
02:35 PM rue_mohr: 74HC597
02:36 PM LeoNerd: Ooh, edge-clocked on both load and shift clocks.. sounds promising
02:36 PM rue_mohr: but honestly, I'm not sure what you get over the 165
02:36 PM rue_mohr: ah ok
02:37 PM rue_mohr: as I see it, it doens't matter if you edge or level if you have your timing set up in a particular way
02:37 PM LeoNerd: OK closer, but still lacking the hiZ output state, so you'd have to gate that e.g. with a 1G127
02:37 PM rue_mohr: I suppose if your trying to use 1 line with timers it would be an issue
02:37 PM LeoNerd: 1G125
02:37 PM rue_mohr: hah
02:37 PM LeoNerd: Did I mention PCA8574 yet? ;)
02:37 PM rue_mohr: and so the compromises start?
02:38 PM LeoNerd: Because really.. pinchange interrupt
02:38 PM Smidge204: If you didn't have chips in hand I'd suggest just some basic IO expanders
02:38 PM rue_mohr: I done like the i2c myself
02:38 PM rue_mohr: void LS595Send8 (uint8_t bits, uint8_t strobe) {
02:38 PM rue_mohr: uint8_t temp;
02:38 PM rue_mohr: for( temp = (0x80); temp != 0; temp >>= 1) {
02:38 PM rue_mohr: if ( (bits & temp) != 0 ) { SendOne();
02:38 PM rue_mohr: } else { SendZero();
02:38 PM rue_mohr: }
02:38 PM rue_mohr: }
02:38 PM rue_mohr: if (strobe) pulseSTB();
02:38 PM rue_mohr: }
02:38 PM rue_mohr: and, done. eh?
02:38 PM Smidge204: Preference is preference but it works a treat IMHO
02:39 PM rue_mohr: oops bug
02:39 PM rue_mohr: that pulseSTB macro is multi-line
02:39 PM rue_mohr: teehee
02:39 PM rue_mohr: if (strobe) { pulseSTB(); }
02:40 PM rue_mohr: ok, I gotta go test that code thenn
02:41 PM rue_mohr: hmm, wonder if I should just breadboard it for now
02:41 PM rue_mohr: ok, I'll put the scanless keyboard decoder on the controller baord too then
02:41 PM rue_mohr: run it 3x3
02:42 PM Smidge204: https://www.mouser.com/datasheet/2/268/20001952C-1129816.pdf Apparently they DO make SPI versions. TIL.
02:43 PM rue_mohr: will they be around in a year? (that chip)
02:43 PM rue_mohr: ouch $2ea from china!
02:44 PM Smidge204: Microchip says they're still in production
02:44 PM rue_mohr: for the trouble, 74hc165 is 10pcs/$2.50
02:45 PM rue_mohr: heh $5/50pcs smt
02:45 PM Smidge204: You'll need four chips to do the job, though
02:46 PM rue_mohr: nope
02:46 PM rue_mohr: not for my design
02:46 PM Smidge204: Two parallel-in, two parallel out for 16-bit bidirectional, no?
02:46 PM rue_mohr: oh
02:46 PM rue_mohr: I'm not using that many bits
02:46 PM Smidge204: Aha
02:47 PM rue_mohr: http://ruemohr.org/~ircjunk/tempimage/p1160064.jpg
02:47 PM rue_mohr: well, per board
02:47 PM rue_mohr: I'm building a digital resistor decade box
02:47 PM rue_mohr: 100R -> 15MR
02:48 PM Smidge204: Neat
02:48 PM rue_mohr: dunno, gonna have to finish it to find out! :)
02:48 PM Smidge204: High power or just got shitloads of relays kicking around?
02:48 PM rue_mohr: I'm not sure if the inductance or capacitance will kill the practicallity
02:48 PM rue_mohr: I needed isolated resistor switching
02:49 PM rue_mohr: bonus tho, I can have it be 2 channel
02:49 PM rue_mohr: so I get two resistances the same value
02:49 PM rue_mohr: and I can nonally walk it thru "any" value, but I could have it walk E12 or E24 values etc
02:50 PM rue_mohr: its a crazy idea
02:50 PM rue_mohr: terribly overcomplicated
02:50 PM rue_mohr: 4 memory locations and usb interface
02:50 PM rue_mohr: (front panel too)
02:54 PM Smidge204: Nothing wrong with a bit of ambition
02:55 PM rue_mohr: its a distraction project
02:55 PM rue_mohr: I have a 4'x8' cnc I'm supposed to be working on
03:11 PM rue_shop1: ah yea, looka that, I already planned out the scanless keyboard decoder, only need 2 transistors, 4 resistors, and 2 diodes, uses 4 input lines
03:12 PM rue_shop1: I can probably just stitch that into the pcb
11:25 PM day_ is now known as day