#avr | Logs for 2016-10-20

Back
[03:56:59] <skz81> Hello, if one has an old spare PC power supply, and wants to power a 24V circuit, taking advantage if +12V and -12V... With +12V rated 18A and -12V rated 0.8A... Is he stuck to a global 24V/0.8A ?
[03:57:36] <skz81> Or can he achieve the wanted 24V / 10A without frying the PSU ?
[04:00:26] <skz81> (not really AVR related, I must admit... But this channel is used to /slightly/ off-topic chats ;°)
[04:03:41] <jacekowski> skz81: stuck to 0.8A
[04:04:32] <skz81> jacekowski, ok thanks. But... Crap !!!
[04:09:38] <specing> skz81: you could modify the secondary side for 24V
[04:10:02] <specing> probably cheaper to just buy a 24V supply tho
[04:12:01] <skz81> specing, what do you mean exactly "modify the secondary side" ? Bridging +12V1 and +12V2 to get a global +24V or something ?
[04:12:56] <specing> no
[04:13:03] <specing> modifying the 12V to be 24V
[05:09:53] <Snert> http://www.rchelination.com/setting-hp-dps-1200fb-power-supply/ <-- 2 12v supplies hooked up to provide 24v.
[05:10:13] <Snert> you have to float the ground on the second 12v psu.
[05:12:15] <Snert> I don't recommend this unless you're comfortable with the mod.
[05:17:40] <skz81> Snert, thanks. I would rather avoid to use a second PSU for my project... More looking about 12V to 24V converters, but I'm affraid to lose stability with them
[05:19:26] <skz81> specing, unsure to see what modification you're talking about... Anyway, I don't feel skilled enough to modify directly the PSU. I opened it to look inside, but I would rather rather avoid to tinker inside... Really not handful futhermore, there's little room....
[05:19:26] <specing> "second"?
[05:19:38] <specing> how many voltages do you need and at what currents?
[05:20:34] <skz81> specing, http://www.rchelination.com/wp-content/uploads/2013/10/image7-373x500.jpg << the link Snert posted describe this
[05:21:20] <skz81> specing, 24V @ ~10A, but I'll probably never reach it (is for powering an audio 2.1 amp)
[05:21:32] <specing> skz81: I wasn't talking about connecting two psus in series
[05:22:54] <skz81> specing, understood that's not your point :) But I did not get yours, sadly.
[05:23:06] <Snert> there's a ton of web pages about floating a ground. That's the important concept.
[05:24:16] <Snert> or bottom line - lose 5bucks to Ali and get a couple stepup regulators.
[05:24:49] <Snert> the flurry of consternation is not worth it. Get one, and see if a problem exists.
[05:26:38] <specing> > < skz81> Snert, thanks. I would rather avoid to use a second PSU for my project
[05:26:44] <specing> < skz81> specing, 24V @ ~10A, but I'll probably never reach it (is for powering an audio 2.1 amp)
[05:26:53] <specing> --------- > < specing> how many voltages do you need and at what currents?
[05:29:20] <skz81> specing, 24V 10A
[05:29:36] <skz81> i don't know what to answer else
[05:30:11] <skz81> (what you're asking actually -- sorry, not native english speaker here, maybe I misunderstood something)
[05:30:26] <specing> so get a 24V psu and be done with it
[05:30:37] <Snert> 3bucks on ali.
[05:31:41] * specing would not trust a 24V 10A psu for $3 even if such existed
[05:33:55] <theBear> hmmm.. i was excited, finally someone saved me the effort and played with how floatable yer average mains switcher/atx style supply is when you wanna abuse the hell outta it (design vs purpose) ... but it's all pictures with a drill that show you where to drill, and connect pin 23 to point C :-( is a simple fragment of schematic, maybe a half paragraph discussing common actual implementations and this specific unit re: relationship/floatiness between
[05:33:56] <theBear> output side and mains
[05:39:29] <skz81> specing : I could buy directly a new audio amp off the shelf, I would solve the problem too ! :p I'm trying to do it as cheap as possible.
[05:39:31] <skz81> > The PSU was free, the amp board is 15€ (amazon pime shipping included :p but I guess they messed up, found it slighty expensiver (0.5€ or so) from Shenzhen with 3 week delay !)
[05:40:32] <skz81> And i'm affraid of stability of 24V/10A PSU that are design to power LED strips
[05:41:26] <specing> audio amps usually need really good PSUs, no?
[05:42:15] <skz81> And ATX are powerful and stable
[05:42:59] <skz81> Are said to be stable,, at least :)
[05:43:42] <specing> if you have a quality PSU, yes
[05:43:46] <specing> i.e. not LCPOWER
[05:47:14] <Jartza> generally, you wouldn't want switching power supply near your audio amp :P
[05:47:21] <Jartza> if you care about the audio quality, that is
[05:47:26] <Jartza> if you don't, then whatever
[05:51:04] <skz81> Jartza, for the price, audio quality want be best ever, but I read some tests and it seems correct. Can I plan something to prevent problems ?
[05:52:36] <skz81> The PSU I get is from delta electronics... The guy from the store still has a bunch of 350/400W he happy to get rid off for free :)
[05:52:40] <twnqx> lots an lots of capactors
[05:53:11] <Jartza> yea. every possible value of cap in parallel :D
[05:53:35] <twnqx> personally, i'd go as far as going above voltage, add capacitors, and then a large LDO behind it to reduce noise
[06:03:47] <skz81> What is the problem here exactly ? Current peaks on power line ?
[06:04:11] <twnqx> switching noise
[06:08:29] <specing> http://www.ebay.com/itm/20-Pcs-4-Different-Size-Double-Side-Prototype-PCB-Panel-Universal-Circuit-Board-/272028653829?hash=item3f562bd905:g:pYUAAOSwT5tWL4RL
[06:08:39] <specing> How come these are $5.47?
[06:08:59] <specing> i.e. shouldn't breadboards be cheaper?
[06:09:14] <twnqx> 20 pieces?
[06:09:27] <twnqx> hell, in my regular shops i pay more than that for oen
[06:10:23] <specing> :)
[06:10:40] <specing> idk, I'd just expect unpopulated boards to be cheaper than that
[06:15:15] <Snert> they're not in it for their health. Must make $.
[06:15:23] <specing> Anyway does anyone see anything fundametally wrong with those boards?
[06:15:48] <specing> Snert: this is the cheapest kit with a lot of sales
[06:16:05] <Snert> I got 20 of each size. they're fine.
[06:19:32] <Snert> ebay is nice because paypal produced a clear paper trail on the order when you dealing with those across the waters.
[06:19:50] <Snert> but I got mine from ali.
[06:21:11] <Snert> "paper trail" in the figurative sense, of course.
[06:21:27] <specing> Snert: for how much $$?
[06:21:42] <specing> Do you use alipay or what was it?
[06:22:13] <Snert> I manually enter the info each time - I don't let them glom onto my cc #.
[06:22:34] <Snert> but I think it was alipay.
[06:22:54] <specing> you think they aren't storing it for their own purposes?
[06:22:55] <specing> :D
[06:24:04] <Snert> them and the CIA I figure. Best I can hope for is to minimize.
[06:24:53] <Snert> at least it's not out there in the open should someone hack my web account.
[06:28:40] <specing> I like how browsing aliexpress is https:// only
[07:19:20] <_ami_> is it good time to unlink credit card from aliexpress?
[07:19:41] <_ami_> don't find unlink credit card tab though
[07:19:52] <_ami_> is it in alipay? probably need to register first.
[07:20:07] <_ami_> wonder why they store my credit card info to third website.
[07:22:23] <_ami_> https://discuss.techmesto.com/topic/45/how-do-i-remove-a-saved-card-from-aliexpress
[07:23:58] <_ami_> http://thenextweb.com/in/2016/10/20/3-2-million-debit-card-details-stolen-as-india-faces-one-of-its-largest-data-breaches-ever/
[07:28:20] <specing> wow alipay supports Maestro cards as well
[07:50:14] <specing> Can anyone recommend a ~2kW vfd? I want something I could control by MCU, not it having a human interface
[07:50:31] <specing> (220VAC)
[08:50:40] <jacekowski> specing: powerflex 525
[08:50:45] <jacekowski> specing: or 523
[08:52:45] <specing> I want something with just uart/spi/i2c/lin/can/whatever without the fancy bells and whistles that just drive the cost up
[08:59:28] <rue_bed> heh, I never did go for saving my card details, even when they offered $8 usd
[09:02:10] <rue_bed> specing, hu? whats left?
[09:08:34] <specing> rue_bed: ?
[09:08:39] <specing> rue_bed: "left"?
[09:13:35] <specing> rue_bed: https://lut.im/hXaZH9iJqz/nCUJsxABtlE3Xl4M.jpg
[09:13:45] <specing> such vfds certainly do exist^
[09:14:37] <specing> see the connector in the upper left? That is the mcu interface (possibly LIN)
[09:21:38] <rue_house> good one,
[09:21:54] <rue_house> always hard to work thru the perspective
[09:22:05] <rue_house> did it require much contrast/scaling?
[09:25:04] <jacekowski> specing: powerflex 4 will have uart(modbus to be precise)
[09:27:10] <specing> rue_bed: ? Its gimp overlay with opacity=42
[09:28:56] <rue_house> yea, flipped with scale correction
[09:29:17] <bss36504> specing: you should just build your own
[09:29:18] <rue_house> and sometimes parallelagram correction
[09:30:13] <specing> jacekowski: still has redundant features that increase the price
[09:30:28] <specing> bss36504: I'm missing about 5 years of EE uni courses in order to do so
[09:30:43] * specing <- CS + Math
[09:30:57] <specing> rue_bed: indeed, I had to scale and rotate a bit
[09:31:09] <bss36504> Nah, just buy a 2KW AC-DC supply, get some power FETs or IGBTs. How hard could it be? /s
[09:31:19] <rue_house> what do you want to control on the vfd?
[09:31:23] <specing> yes, /s
[09:31:25] <rue_house> speed... direction...
[09:31:32] <specing> rue_bed: washing machine asynch motor
[09:31:40] <rue_house> oooh
[09:31:47] <rue_house> your washing mchine died
[09:31:50] <specing> bingo
[09:32:01] <rue_house> and they want an obsurd amount for a replacement baord
[09:32:15] <specing> not really
[09:32:21] <specing> the problem is that I don't know what failed
[09:32:35] <rue_house> motor isn't hard to test
[09:32:37] <specing> since noone makes publicly available service manuals
[09:32:40] <rue_house> have a multimeter?
[09:32:45] <specing> rue_bed: I do
[09:32:49] <specing> (of course)
[09:32:57] <specing> (who doesen't have a multimeter....)
[09:32:58] <rue_house> 3 wire motor or like 10+
[09:33:13] <rue_house> I'm sure there are a lot of CS that dont :)
[09:33:29] <specing> well yes, but no CS that is in #avr
[09:33:42] <rue_house> oh look this is #avr... hah
[09:34:12] <specing> I'm also looking to buy a new washer+drier comboo... so I asked on ##electronics for companies that make service manuals public
[09:34:36] <specing> since otherwise I'm going to be a naked developer pretty soon
[09:34:40] <rue_house> it might be better to make an animated gif of the transparency going back and forth between about 25% and 75%
[09:35:13] <rue_house> what the part number of the little chip on the board
[09:35:34] <rue_house> one thing you get to see is that most people use the circuit in the app note verbatum
[09:35:39] <specing> and part numbers spelled out by Morgan Freeman, right?
[09:35:57] <specing> rue_bed: what little chip? The tqpf mcu?
[09:36:13] <rue_house> the soic
[09:36:16] <specing> the igbt driver ic?
[09:36:29] <rue_house> yea
[09:36:44] <rue_house> the datasheet for that will be most of the schematic most likley
[09:37:07] <rue_house> what is the dryer brand / model?
[09:37:11] <rue_house> er washer
[09:37:14] <rue_house> whatever
[09:37:49] <rue_house> does it fill up and then not run the motor?
[09:38:11] <specing> ir2136 some variant of it
[09:38:34] <rue_house> ? youcant make out the part number?
[09:38:52] <specing> I can, but the board is at some unofficial repairman now
[09:39:04] <specing> I'm sure I've written it down somewhere
[09:39:09] <specing> hold on
[09:39:19] <rue_house> does it fill up and then not run the motor?
[09:43:31] <rue_house> late for work...
[09:43:47] <specing> ir2136S
[09:43:59] <specing> rue_bed: none. It waits 5 mins then prints "error 5"
[09:44:09] <specing> user manual says it is a problem with motor controller
[09:44:26] <specing> I guess it first checks whether all components are ok
[09:47:07] <rue_house> pin 8
[09:47:09] <rue_house> low?
[09:47:30] <rue_house> ;)
[09:49:44] <specing> I can't check right now as "< specing> I can, but the board is at some unofficial repairman now"
[09:51:17] <specing> I've measured the rectifier bridge and other diodes tho and they all seem fine. all seven igbts also visually look ok
[09:53:49] <specing> yes, there are seven IGBTs...
[09:57:45] <theBear> often little things like that have a dead on-board or same-physical-module mains transformer
[09:58:25] <theBear> mmm, just read further back, that board probly a bit deep for its own mains supply
[09:58:55] <theBear> i was thinking it was more on/off for everything, not multi motor phases
[09:59:48] <specing> there is a transformer attached to the board via 60cm wires, connector x4
[09:59:54] <specing> probably an isolation transformer
[10:07:53] <specing> I'm still looking for a vfd
[10:20:59] <twnqx> are these guys kidding me
[10:21:14] <twnqx> a standard like DIN41612 / IEC60603-2 should exist for standardization
[10:21:15] <theBear> i dunno, are they ? are they funny ?
[10:21:24] <twnqx> now i have two conenctors here
[10:21:28] <twnqx> one from ERNI
[10:21:30] <twnqx> one from EPT
[10:21:30] <theBear> good god, not 2
[10:21:44] <twnqx> they agree on a/b (rows)
[10:21:48] <twnqx> but not on numbering
[10:21:53] <LeoNerd> Lets guess - they both conform to the same spec, just not each other?
[10:21:59] <twnqx> 1<->10, 2<->9, 3<->8, ...
[10:22:20] <theBear> you mean the dot is at the wrong end ?
[10:22:28] <LeoNerd> Mmm.. mirrored. Sure it isn't just male vs. female?
[10:22:35] <twnqx> the dor? no, they have the numbers actually molded in
[10:22:44] <twnqx> yes, they are both male
[10:22:51] <twnqx> s/dor/dot/
[10:22:51] <LeoNerd> Ah.. boo then :/
[10:24:16] <twnqx> and ofc i don't have a copy of the spec
[10:24:24] <twnqx> so i can check if that part is standardized
[10:24:51] <twnqx> but i can confirm that erni female match with erni male
[10:25:06] <twnqx> but definitely not with EPT
[10:25:08] <LeoNerd> You'd hope that people would at least standardise the enumeration order of pins
[10:25:36] <LeoNerd> So even if the exact part wasn't named in the standard, the general idea of what you do to count, where you find pin 1, etc... is
[10:25:51] <twnqx> yeah, you'd hope...
[10:25:59] * twnqx is still dumbfounded
[10:26:34] <twnqx> guess i'll grab more datasheets and compare them
[12:13:46] <guesst456> How do I store an array in flash?
[12:15:02] <Tom_L> flash or eeprom?
[12:18:15] <guesst456> flash
[12:18:55] <guesst456> Now it's stored in ram
[12:18:57] <specing> look into the datasheet for flash programming instructions
[12:20:08] <guesst456> I mean to store the array as part of the code in flash
[12:20:56] <Tom_L> just write it like normal i suppose
[12:21:32] <antto> declare it in the global scope, const uint8_t ...
[12:21:43] <antto> or, hm..
[12:21:58] <antto> there was a macro i think
[12:22:13] <antto> PROGMEM?
[12:22:34] <specing> guesst456: how do you think it ends up in RAM?
[12:24:05] <guesst456> Because I can see the mem usage after build
[12:24:25] <guesst456> It uses data memory
[12:24:37] <guesst456> But I want the array to be stored in program memory
[12:25:00] <antto> is it "const" at least?!
[12:25:20] <guesst456> My array has strings to display on a small text LCD
[12:25:21] <antto> because if it ain't - then it certainly would end up in RAM
[12:25:55] <Tom_L> http://tom-itx.no-ip.biz:81/~webpage/abcminiuser/articles/progmem_basics_index.php
[12:26:00] <Tom_L> guesst456, read that
[12:26:14] <guesst456> Ok. thanks
[13:02:31] <specing> Does anyone know of any ~2kW 220VAC variable frequency motor drives that are available just in board form(with simple enclosure) for mcu control, without stupid user interface boxes?
[17:40:47] <joebobjoe> Can I change the clock speed using the prescaler select or divide amount at any time? The spec sheet says I can't change the calibration more than x amount, but it doesn't say anything about changing the clock source
[17:43:48] <joebobjoe> Oh it looks like CKSEL is only read on start up or wake
[17:44:03] <joebobjoe> But you can change the prescaler at runtime, right?
[17:45:32] <joebobjoe> Ok looks like you can change the prescaler at run time
[17:45:42] <joebobjoe> Just can't change the calibration of the internal RC
[17:53:38] <Lambda_Aurigae> joebobjoe, correct.
[19:23:01] <joebobjoe> Does anyone understand why PCIF stays high in the timing diagram on page 50 in http://www.atmel.com/Images/Atmel-2586-AVR-8-bit-Microcontroller-ATtiny25-ATtiny45-ATtiny85_Datasheet.pdf ?
[19:23:12] <joebobjoe> Just trying to understand interrupt handling on my AVR...
[19:24:13] <joebobjoe> And why do they need so many flip-flops toward the end of the chain?
[19:27:40] <joebobjoe> er latches
[19:28:12] <Lambda_Aurigae> you need to ask the developers
[19:28:39] <joebobjoe> Lambda_Aurigae: but why would they put in a timing diagram with all the signal names if it wasn't meant to be understood
[19:28:49] <Lambda_Aurigae> no clue
[19:29:29] <Lambda_Aurigae> I'm betting there are more bits here and there that aren't shown here
[19:33:43] <joebobjoe> Lambda_Aurigae: I get that the circuitry at the beginning is used to generate a true signal only when there is a change in the pin level
[19:33:47] <joebobjoe> That is kind of neat
[19:36:33] <cehteh> i wont wonder if the actual implementation is vastly different and the drawing only depcits the semantics
[19:37:31] <cehteh> mhm and that multiple flipflops on the same clock line, isnt that just a delay?
[19:38:03] <Lambda_Aurigae> probably
[19:38:04] <Lambda_Aurigae> and
[19:38:06] <Lambda_Aurigae> pretty much
[19:38:44] <joebobjoe> cehteh: can I atleast infer the actual delay from when the pin change occurs to when PCIF is set from the timing diagram?
[19:38:44] <cehteh> as you see in the timing diagram
[19:38:54] <joebobjoe> cehteh: as in can I now say that it takes at least 2 clock cycles?
[19:39:09] <cehteh> what takes 2 clock cycles?
[19:40:15] <cehteh> from PCINT to PCIF its 3 cycles
[19:40:55] <joebobjoe> cehteh: It is like 2 and a half in the diagrm
[19:40:57] <joebobjoe> diagram*
[19:41:15] <cehteh> there are no half cycles .. thats for what the latches are
[19:41:28] <cehteh> interrupts take 6 cycle btw
[19:41:36] <cehteh> (from software side)
[19:42:05] <joebobjoe> cehteh: ok I was looking at the distance
[19:42:14] <joebobjoe> cehteh: I guess when you say "clock cycles" you should say edges
[19:42:36] <cehteh> rising edges
[19:43:00] <joebobjoe> cehteh: right...
[19:43:07] <cehteh> what do you try to fivure out?
[19:43:21] <joebobjoe> cehteh: just reading the manual to learn
[19:43:23] <cehteh> i hardly need such detailed information usually
[19:43:45] <joebobjoe> cehteh: I feel like I should understand the diagram since I took digital logic class haha
[19:43:55] <cehteh> lol
[19:44:06] <Lambda_Aurigae> class?
[19:44:15] <joebobjoe> a course*
[19:44:18] <Lambda_Aurigae> I read the ttl cookbook
[19:44:28] <Lambda_Aurigae> that's how I learned digital logic.
[19:45:01] <joebobjoe> Lambda_Aurigae: I wish I understood how transistors work
[19:45:11] <joebobjoe> Somehow I got through the course without every really understanding
[19:45:13] <Lambda_Aurigae> they are switches...or valves
[19:45:29] <joebobjoe> And I got punished when we got to the open collector/drain etc
[19:45:30] <Lambda_Aurigae> some are voltage controlled, some are current controlled
[19:45:48] <Lambda_Aurigae> oh, that's easy
[19:45:59] <Lambda_Aurigae> most digital logic will pull a signal either high or low...
[19:46:13] <Lambda_Aurigae> open drain only pulls it low or floats.
[19:46:29] <Lambda_Aurigae> normal logic is push/pull...open drain is only pull.
[19:47:03] <joebobjoe> Lambda_Aurigae: wow. that makes perfect sense
[19:47:12] <Lambda_Aurigae> there are 3 states
[19:47:19] <Lambda_Aurigae> high, low, not connected
[19:47:59] <joebobjoe> Lambda_Aurigae: you make an open drain with a tri-state buffer right?
[19:48:04] <Lambda_Aurigae> no
[19:48:14] <Lambda_Aurigae> tri state covers all 3 states...
[19:48:20] <Lambda_Aurigae> open drain covers 2 of the 3
[19:48:28] <joebobjoe> Lambda_Aurigae: but you can feed a tri-state Vcc
[19:48:28] <Lambda_Aurigae> regular logic covers 2 of the 3.
[19:48:57] <Lambda_Aurigae> if I had the gumption I could draw you some simple diagrams.
[19:49:13] <joebobjoe> Lambda_Aurigae: I can wiki it
[19:49:22] <cehteh> there are some tricks with avr's
[19:51:07] <joebobjoe> I wonder why that timing diagram uses a low-enable on the first latch? Is it implying that it only detects a pin change on the falling edge of the clk?
[19:51:37] <cehteh> as output you can normally pull up or pull down while 'input' means the no-connected (or rather almost nothing connected) state .. and you can use the internal pullup to drive the pin very weakly up even if configured as input
[19:52:19] <Lambda_Aurigae> http://www.allaboutcircuits.com/worksheets/digital-logic-signals/
[19:52:23] <Lambda_Aurigae> look at question 4
[19:53:33] <Lambda_Aurigae> in fact,
[19:53:36] <Lambda_Aurigae> read the whole page.
[20:02:12] <joebobjoe> Lambda_Aurigae: how do you know what size resistor to choose? A big resistor might not pull the voltage fast enough, but a small resistor might waste energy... right?
[20:02:59] <Lambda_Aurigae> pick what works.
[20:03:04] <Lambda_Aurigae> or, do the math.
[20:03:09] <Lambda_Aurigae> whatever works for you.
[20:03:20] <Lambda_Aurigae> I generally use a 10Kohm resistor for pullup.
[20:03:33] <Lambda_Aurigae> sometimes 2.2K to get a faster pullup but that will draw more current.
[20:23:35] <joebobjoe> Is it true according to the same datasheet I linked earlier that there is no way to tell which pin generated a PCINT (pin change interrupt)?
[20:23:52] <joebobjoe> There seems to be only one entry in the interrupt vector, and that is PCINT0
[20:24:11] <joebobjoe> And the external interrupt flag is cleared before the interrupt routine executes
[20:25:25] <aczid> you should have a PCMSK register to tell you which pins changed
[20:25:39] <aczid> err, no wait
[20:25:47] <aczid> in the PCMSK you define which pins to trigger on
[20:25:57] <aczid> and then you read out the PIN* register for that pin
[20:26:04] <cehteh> port & PCMSK ...
[20:26:05] <aczid> to see if it got changed
[20:26:26] <cehteh> yes
[20:26:51] <cehteh> so you have to write some check and dispatch when you want interrupts on multiple pins
[20:26:56] <joebobjoe> cehteh: yea but if you have multiple pins set you cannot determine which one caused the interrupt...
[20:27:05] <aczid> gotta check 'em all
[20:27:32] <joebobjoe> aczid cehteh: but multiple interrupt flags could be set at the same time
[20:27:33] <cehteh> maybe you have to preserve the state and figure out which pins you already handled
[20:27:48] <cehteh> there is only one PCIF
[20:27:51] <aczid> yeah that sounds like a good idea
[20:28:07] <cehteh> if 2 pins change at the same time you have to handles that
[20:28:45] <aczid> hold a copy of the in port, then check the difference to see which interrupt changed (if you require on/off on multiple IOs)
[20:28:49] <cehteh> if you can, try to use the input capture unit or INT0 INT1 instead PCINT
[20:28:55] <aczid> which pin changed*
[20:29:13] <joebobjoe> cehteh: there is only one INT0
[20:29:24] <cehteh> depends on the AVR some have INT1
[20:29:34] <cehteh> tinys dont
[20:29:38] <joebobjoe> cehteh: what do you mean there is only one PCIF... there are many
[20:29:44] <cehteh> mhm maybe the more-pins tinys dunno
[20:30:13] <cehteh> there is only one interrupt handler for PCINT
[20:30:41] <cehteh> (maybe per port on bigger AVR's, dunno exactly)
[20:30:53] <aczid> only one PCINT_vect afaik yes
[20:30:56] <joebobjoe> cehteh: oh wait! you're right! there IS only one PCIF
[20:31:19] <cehteh> when you get an PCINT then one or more pins changed
[20:31:39] <cehteh> you are responsible to handle that
[20:33:11] * cehteh actually wonders if there is a racy window ... PCIF is cleared on interruopt enter or on return?
[20:33:26] <joebobjoe> cehteh: enter
[20:33:56] <cehteh> then you can have a race
[20:34:11] <joebobjoe> cehteh: how?
[20:35:23] <cehteh> your ISR gets called, PCIF gets cleared, yoiur ISR code executeds, reading the PORT state compares it/interated through the pins
[20:35:45] <cehteh> or also if a pin is only momentarly high and falls back in the moment you read the port
[20:35:54] <cehteh> before you read the port
[20:36:08] <joebobjoe> cehteh: I guess any of the pins could change if they are inputs at any time
[20:36:09] <cehteh> then it would look like some spurious interrupt
[20:36:16] <cehteh> yes
[20:36:33] <cehteh> pinchange interrupts are not very pretty
[20:36:34] <joebobjoe> cehteh: if one pin quickly changed back, but another pin changed in the meantime, you could attribute it to the wrong pin
[20:36:41] <cehteh> yes
[20:37:56] <cehteh> if you want something more robust you better use some other facility, or add the proper electronics on these pins to keep the signal for some time until the ISR handles it or you make some other software precautions to handle such cases
[20:38:16] <cehteh> PCINT has quite high priority .. but not the highest
[20:38:28] <cehteh> it may get blocked by other ISR's
[20:39:24] <joebobjoe> cehteh: that sounds almost impossible to deal with
[20:39:34] <joebobjoe> you have to guarantee reset isn't called
[20:39:38] <joebobjoe> I guess it's not that hard
[20:39:51] <cehteh> depends on the problem
[20:40:00] <cehteh> sometimes its ok to loose an event
[20:42:34] <cehteh> ah the small tinys dont have a input capture unit, that sux
[20:43:32] <cehteh> tiny84 has input capture and 2 pcint
[20:44:52] <joebobjoe> cehteh: what is input capture?
[20:45:02] <joebobjoe> Just recording which PCINT caused the interrupt routine?
[20:45:27] <cehteh> no
[20:45:40] <cehteh> its like the lap-button on a stopwatch
[20:45:41] <joebobjoe> Another question: the "AVR CPU Core" overview section says that there are "basically two types of interrupts". But I'm having trouble understanding what the second kind is...
[20:46:00] <joebobjoe> cehteh: so records a value at a certain time?
[20:46:20] <joebobjoe> The manual says "The second type of interrupts will trigger as long as the interrupt condition is present. These interrupts do not nec- essarily have Interrupt Flags. If the interrupt condition disappears before the interrupt is enabled, the interrupt will not be triggered." -- what?
[20:46:21] <cehteh> when a signal on a pin is detected it copies a timers value into a special register
[20:46:27] <cehteh> 'capture'
[20:46:31] <joebobjoe> cehteh: oh that's cool
[20:46:35] <cehteh> and sets a interrupt flag
[20:46:49] <cehteh> that interrupts has lower priority then
[20:46:57] <cehteh> but you have the exact time when it happened
[20:47:37] <joebobjoe> I see
[20:48:58] <cehteh> about yout quote, dunno .. maybe it clears PCIF when no pins are changed back? news to me, but i never used that in that detail
[20:57:27] <theBear> that quote, sounds like the 2nd type are not only low priority, but not capture-approach/reset automatically when the trigger cond. stops existing, thus you could possibly "miss" seeing them trigger, and having them come up the line of interrupt priorities to the top, while something else delays them from happening
[20:59:09] <joebobjoe> theBear: I can't see anything mentioned about them in the "Interrupts" chapter
[21:00:43] <theBear> where is that quote from ?
[21:03:09] <cehteh> when you need something reliable you should think about if PCINT will do, often it wont
[21:03:12] <joebobjoe> theBear: section 4.8 of the ATtiny25/45/85 manual
[21:03:39] <cehteh> but maybe some external signal massaging will help. flipflop, latch ..
[21:04:48] <aczid> I use PCINT for to wake up from deep sleep mode, then check for button presses in the in port... seems to be reliable enough to me
[21:05:12] <cehteh> huh .. PCINT cant wake from deep sleep iirc
[21:05:32] <aczid> mine certainly can
[21:05:39] <aczid> regardless
[21:05:42] <cehteh> ah yes it can
[21:05:52] <theBear> aczid, pending what cehteh just said after you, that'd be cos you never got other interrupts/higher priority things going on while you sleeping
[21:06:03] <theBear> heh, pending finished
[21:06:11] <cehteh> lots people use it for bitbanging some protocolls
[21:06:14] <aczid> I also don't configure any other interrupts at that time
[21:06:34] <cehteh> usually it works, but you need to be aware that there may be corner cases where it fails, and how to approach that
[21:06:50] <theBear> like a lot of that interrupt stuff, so long as you plan ahead and know what is going on when, you can make them "perfect" by avoiding things that will make them unperfect
[21:06:53] <aczid> I use ATOMIC/NONATOMIC blocks from avr-libc
[21:07:37] <aczid> so an atomic around the loop that checks to see if any buttons were pressed, then a non-atomic one inside that with the sleep which can raise interrupts
[21:08:20] <aczid> so basically just sleeping & polling
[23:51:59] <joebobjoe> Lambda_Aurigae: how is it possible to have an open collector that outputs hi-Z L or low-Z H (in the second bullet point) https://en.wikipedia.org/wiki/Open_collector#Function
[23:53:38] <joebobjoe> I guess what is confusing me is all the picture show using a pull-up resistor... but I guess you can use a pull-down resistor and tie the other end of the open collector to Vcc instead of GND?
[23:54:04] <joebobjoe> I just thought it was called an "open collector" because it collected current, and current flows from positive to negative
[23:54:37] <joebobjoe> as is standard practice