#avr | Logs for 2014-05-29

Back
[00:07:06] * just_corey pokes Tom_itx
[00:07:27] <just_corey> Tom: are you here
[00:07:29] <just_corey> ?
[00:13:58] <just_corey> i bought a madell 850ad rework station, its been pretty cool sofar
[01:48:28] <just_corey> sure is quiet around here
[02:59:37] <FoxGT> Casper, you're a genius! Thank you so much!
[02:59:42] <FoxGT> Working now.
[03:46:18] <Tom_itx> well it's 3am
[03:46:30] <Tom_itx> just_corey?
[05:52:48] <superware> hwo can I get the sign of an int32_t? (something like zero for positive, one for negative)
[05:56:16] <Thrashbarg> s = int32 < 0;
[05:56:20] <Thrashbarg> or something to that effect
[05:56:29] <superware> yeah
[05:56:33] <superware> thanks
[06:19:44] <guanche> what would be the fastest way of feeding (switching) vcc to INT0?
[06:20:58] <Kev> of what ?
[06:21:17] <Roklobsta> wut?
[06:21:44] <guanche> I want to signal high int0, so it would normally be low
[06:22:07] <Roklobsta> use the internal pullup
[06:22:15] <guanche> I'm between using an npn with a pullup or, ah
[06:22:33] <Roklobsta> you wanyt to triger it from software?
[06:22:47] <Roklobsta> oh i see.
[06:22:59] <guanche> no it will be triggered from 12V, and I want int0 to tell me when that happened
[06:23:33] <Roklobsta> oh, ok, just use a resistor network.
[06:23:40] <Roklobsta> resistor divider
[06:23:53] <guanche> so I thougth on using a npn with the base at the 12V side and then the collector-emitter side will go to the mcu
[06:24:00] <guanche> through a pullup or something
[06:24:27] <Roklobsta> 12V ----/\/\/\/\-----Int0
[06:24:42] <guanche> directly?
[06:25:11] <Kev> 12v-----[RES]----"int0"----[RES]-----GND
[06:25:29] <Roklobsta> yes directly or what kev said too. nice one kev
[06:25:33] <guanche> yes, that's a resistor divider, but wouldn't it be slower than using a transistor?
[06:25:51] <guanche> it wouldn't be noticieable slower I guess
[06:25:57] <Roklobsta> no? depends on the resistor and the pin capacitance
[06:26:07] <Thrashbarg> you 'could' get away with on resistor but it'd strain the protection diodes
[06:26:11] <Roklobsta> but the transistor has to overcome the capacitance too
[06:26:20] <Thrashbarg> *with one
[06:26:35] <guanche> ok, I'll go with the resistor divider then, thanks
[06:27:21] <Roklobsta> there will be internal resistance on the pin - if you know what it is you can use one external, but to be safe use an external divider
[06:27:52] <Roklobsta> you need sweet F.A. current.
[06:28:07] <guanche> F.A.?
[06:28:08] <Roklobsta> so they can be fairly largish values
[06:28:13] <Roklobsta> fanny adam
[06:28:28] <Roklobsta> kev, tell guanche what FA really means please.
[06:28:32] <guanche> well, it's a pc power supply
[06:29:03] <guanche> I'll show you my schematics in a while, so you can see what I'm doing
[06:31:52] <Roklobsta> well, your power supply will have a low source resistance but it won't make a difference.
[06:32:19] <megal0maniac> guanche: I'd recommend an optocoupler
[06:32:29] <Roklobsta> no need
[06:32:38] <megal0maniac> Why? Isolation is king
[06:32:42] <Roklobsta> the grounds can be the same
[06:32:58] <Roklobsta> only when you need to isolate systems completely
[06:33:38] <Roklobsta> i have made ADC circuits reading 240V using the right divider values scaling into a 5V ADC
[06:33:49] <megal0maniac> I suppose
[06:34:08] <Roklobsta> just make sure your resistors can handle 240V without breaking down
[06:34:26] <megal0maniac> I guess it's more pertinent to electromechanical stuff, like relays where you get back emf
[06:34:32] <Roklobsta> yes
[06:34:47] * megal0maniac learns all of the things in #avr
[06:40:26] <guanche> http://87.217.239.245/capacitor-test.pdf
[06:40:41] <guanche> that's it, forget the low side, just imagine it works properly
[06:41:01] <guanche> I'm trying to test, physically, how the capictor charges and discharges
[06:41:42] <guanche> I also thougth about the optocoupler, but being a pc power supply with commond ground, and just for this test, I think the resistor network might prove effective
[06:44:05] <guanche> so what I will do, is to test through firmware how long it takes for the capacitor to charge and discharge, while using int0 as feedback
[06:44:35] <guanche> then check my numbers are correct
[06:46:16] <Kev> R9=R10 => 6V on int0
[06:46:43] <guanche> yes, I haven't actually calculated them, just copied and pasted them
[06:47:33] <guanche> I still have to call the shop to see if they have uf4007, and check the 470 ohms resistor is ok
[06:49:22] <Kev> i don't understand what you're trying to achieve with all this tho
[06:50:07] <guanche> that is a half-bridge, my goal is to drive a 3 phase brushless motor with three of these
[06:50:54] <guanche> but before, I want to check the capacitor I'll use will be suitable for a range between, say 5% (or lower if I can), up to 95% duty cycle
[06:51:35] <guanche> and well, shape the firmware so I won't either burn the motor or a mosfet
[06:53:09] <guanche> or mosfets, if I happen to turn on both, both will crack
[06:53:58] <megal0maniac> What you need is a dead time generator
[06:54:22] <guanche> I'll be using software pwm, got it more or less written
[06:54:54] <guanche> even though in a future I'll probably use proper gate drivers, but just want to test doing it with discretes first
[06:57:59] <guanche> http://www.google.co.uk/search?hl=en-GB&q=dr-6236-015&gbv=1&um=1&ie=UTF-8&tbm=isch&source=og&sa=N&tab=wi
[06:58:16] <guanche> the first to pictures (at least here) shows the motor I'm trying to drive
[06:58:34] <guanche> it's a 24V/2A motor from a photocopier, I took the control board out
[06:58:51] <guanche> a brushless outrunner
[06:59:33] <guanche> and this is the datasheet of a similar one: http://www.eupac.se/_filebank/DR-6236-152.pdf
[07:02:40] * RattusRattus assumes then that you are just lifting the motor and not using the circuit on the board its attached to....
[07:03:33] <guanche> no, I'm not using it's control-board, just took it off
[07:03:46] <guanche> no fun on giving it pulses to see it spinning
[07:04:00] <RattusRattus> <grinn>
[07:05:59] <guanche> plus that I want to try things like this: https://www.youtube.com/watch?v=Vd8PsyIAHO0
[07:06:36] <guanche> though for that I'll probably put the board back in and use the hall efect sensors it comes with
[07:25:50] <Kev> guanche, fairly sure it isn't a regular rc brushless motor
[07:26:13] <guanche> no, it's bigger and slower
[07:26:16] <Kev> it's one of those modified brushless used in gimbals and stuff
[07:26:37] <guanche> no, well, it's a brushless from a photocopier
[07:26:52] <guanche> regulat 12 poles, ferrite-like magnets
[07:27:25] <Kev> i meant the one in the youtube vid
[07:27:43] <guanche> a ok, I think the trick is the board has some, how is it called
[07:27:54] <guanche> gyroscope, or accelerometer
[07:28:06] <guanche> it looks like a regular rc brushless to me, an outrunner also
[07:28:32] <guanche> that guy has also other videos with the same motor, I can't see anything strange on it
[07:28:42] <Kev> nah the motor is rewound (rewinded ?)
[07:28:55] <guanche> I don't know, could be
[07:29:14] <Kev> the guy actually said it (in russian)
[07:29:47] <guanche> ah ok, in either case I could do the same (or close to that) without having to rewind mine's
[07:30:01] <Lambda_Aurigae> one thing to remember about motors from copiers....they are almost always 24V
[07:30:24] <guanche> yes I know, but I don't have any beefy 24V power supply
[07:30:46] <Lambda_Aurigae> I work on them things daily.
[07:30:53] <Lambda_Aurigae> it's what I do, doncha know.
[07:31:03] <Lambda_Aurigae> I use copier power supplies as bench supplies actually.
[07:31:17] <guanche> all I have at hand is a pc power supply, so I'm gonna have to live with it and it's 5V rail for the mcu
[07:31:22] <guanche> ah
[07:31:48] <Lambda_Aurigae> find a copier repair shop, ask if they have a junk pile or bone pile and see if you can scavenge some bits..
[07:32:12] <guanche> yes, I'm being give some, but from time to time
[07:32:32] <Lambda_Aurigae> well,,off to break copiers,,err...time for work.
[08:14:59] <megal0maniac> Tom_itx: Just ordered K&R :)
[08:15:26] <megal0maniac> It's one of those books that's just better to physically have
[10:36:36] <dxtr> I have it. Never opened it.
[10:41:09] <myself> Heh. You meaning just putting it on your bookshelf doesn't magically imbue you with its insights? Shit!
[10:43:58] <learath> osmosis works man!
[10:44:02] <learath> I saw it on tv.
[10:46:07] <myself> Magnets. I'm prety sure you can learn by dilluting a solution of rare-earth magnets...
[10:46:18] <myself> it'll energise your chai tea or something.
[10:48:52] <malinus> learath, I think you mean diffusion ;)
[11:01:20] <learath> no no, learn by osmosis
[11:02:08] <malinus> b-but
[11:02:11] <malinus> okay..
[13:17:45] <ambro718> Has anyone written a cycle count calculator that can calculate a worst case cycle count for simple avr assembly (no loops)?
[13:18:32] <RikusW> I have one, in my head....
[13:18:58] <RikusW> you could use the simulator in AS
[13:19:44] <ambro718> but your head, not mine, isn't terribly useful when I want to evaluate whether the interrupt is fast enough and observe the effect of changing the code in various ways on the cycle count ;)
[13:20:03] <ambro718> since it adds up to hundreds of cycles
[13:20:16] <ambro718> what's AS?
[13:20:23] <RikusW> AVR Studio
[13:20:31] <RikusW> Atmel Studio now
[13:21:20] <Kev> ambro718, what do you mean by "if the interrupt is fast enough" ?
[13:21:22] <RikusW> is it that big an interrupt ?...
[13:21:52] <RikusW> my interrupts are generally below 100 instructions....
[13:22:04] <ambro718> Kev: I mean if the ISR executes quickly enough so that certain requirements are satisfied.
[13:23:22] <RikusW> ambro718: in short instructions accessing RAM is 2 cycles, branches are 2 if taken, most is 1
[13:23:45] <RikusW> its fairly easy to remember
[13:23:53] <ambro718> I know that ;)
[13:26:38] <megal0maniac> ambro718: It appears you need RikusW's head
[13:26:42] <megal0maniac> RikusW: Prepare to die
[13:26:59] <RikusW> you have to find me first :-P
[13:27:17] <megal0maniac> I assume that LCD didn't arrive?
[13:27:48] <megal0maniac> RikusW: Too late to open a case now, I'm afraid. Should've checked earlier :/
[13:28:03] <RikusW> not yet
[13:28:15] <megal0maniac> Yeah... it isn't coming
[13:32:04] <RikusW> maybe we should blame customs
[13:48:38] <Tom_itx> megal0maniac i've got the book as well
[13:48:48] <Tom_itx> do you have the pdf?
[13:59:44] <megal0maniac> Tom_itx: I do, but it's easier to flip through a book
[14:00:07] <megal0maniac> RikusW: Yeah, our wonderful post office
[14:00:45] * megal0maniac went wardriving today
[14:05:03] <Tom_itx> easier to search the pdf for something
[14:05:09] <Tom_itx> but i like the book as well
[14:07:24] <malinus> ambro718, just make a small script that calulates it from the asm code
[14:08:59] <ambro718> yeah I may do that
[14:13:46] <RikusW> megal0maniac: found anything ?
[14:16:50] <megal0maniac> Wasn't really looking, just contributing to Wigle :)
[14:16:57] <malinus> haha the ebay sellers are awesome. I've ordered something for $50 to EU, so I was sure I would have to pay the import tax, but they somehow manage re-pack everything in austria. So it was actually send to me from austria. Thank you cheap chinese seller.
[14:19:46] <megal0maniac> malinus: You can't beat them for value
[14:20:00] <megal0maniac> Dont think I've received a single parcel with the actual value on it
[14:20:03] <malinus> megal0maniac, how do they pull that stunt off though? and how can it be legal (for them).
[14:20:26] <megal0maniac> I have no idea. But if there's a way, they'll find it
[14:20:29] <malinus> megal0maniac, yeah normally they just write a lower value, but this time the package actually was sent from "austria".
[14:24:09] <RikusW> malinus: maybe it was bundled in a larger package
[14:24:49] <RikusW> xsa
[14:24:50] <malinus> RikusW, I don't know. I'm just happy.
[14:24:59] <RikusW> indeed
[14:28:28] * hjohnson returns
[14:33:38] * megal0maniac uses top lip to test temperature
[14:40:18] <RikusW> megal0maniac: and is it 100C ? :D
[14:40:43] * RikusW have been burnt doing that
[14:44:22] <malinus> megal0maniac, your dmm should have a temp probe
[14:44:27] <malinus> :D
[14:45:37] <megal0maniac> I just felt it was warmer to the touch, so used lip for further inspection :P
[14:45:59] <megal0maniac> I know of someone who checked if his iron was hot like that
[14:46:21] <malinus> haha
[14:46:22] <RikusW> There is no pill for stupidity :D
[14:52:05] <megal0maniac> I'm trying to find a datasheet for an IC
[14:53:43] <megal0maniac> I'll post details in a sec. I can't find anything :/
[14:56:33] <megal0maniac> http://i.imgur.com/bDnfuqB.jpg
[14:56:44] <megal0maniac> http://i.imgur.com/KwVvUcg.jpg
[14:56:58] <megal0maniac> It's a battery charging IC afaik
[14:57:40] <megal0maniac> 4088 N4620 LT1L
[14:57:49] <megal0maniac> That's what I can make out. And 14 pin qfn
[14:57:52] <twnqx> http://www.linear.com/docs/24938 that one?
[14:58:35] <twnqx> not like typing "4088 battery" into google was particularly difficult :P
[14:59:25] <RikusW> what camera are you using ? or microscope ?
[14:59:39] <megal0maniac> RikusW: A 10x loupe with a phone camera
[14:59:57] <megal0maniac> twnqx: Thank you! I found it last time, I appear to be having a case of the dumbs today :/
[15:00:01] <RikusW> quite nice phone camera
[15:00:55] <megal0maniac> RikusW: It's a Nexus 4 8mp camera. Except the autofocus broke :D
[15:01:04] <megal0maniac> So it's fixed-focus now, but that's fine with the loupe
[15:01:41] <RikusW> mine's autofocus is non existent from the start...
[15:02:08] <RikusW> maybe it will work better with my magnifying glass
[15:03:06] <RikusW> sometimes google appears to be uncooperative ;)
[15:48:07] <megal0maniac> On lipo batteries, what is the centre contact for?
[15:48:39] <megal0maniac> I assume there's some kind of control circuitry inside them if they have the 3rd contact
[15:49:24] <Rokko> it's the third rail. don't pee on it.
[15:49:41] <Rokko> it's a thermocouple pin
[15:49:41] <myself> temperature sensing, typically a 10k ntc
[15:49:48] <Rokko> or ntc
[15:49:52] <Rokko> did i say thermocouple?
[15:49:56] <Rokko> geez
[15:49:56] <megal0maniac> Haha yes, it is temperature
[15:50:06] <myself> ntc thermistor, mister!
[15:50:14] <megal0maniac> Just confirmed continuity between it and the TEMP pin
[15:50:21] <Rokko> yes it is. so you don't try to charge it over ~40C
[15:50:58] <megal0maniac> Something is weird. As soon as the battery is connected to the device, I measure 0V at the battery terminals
[15:51:07] <megal0maniac> 4V otherwise
[15:51:12] <megal0maniac> And there isn't a short circuit
[15:52:56] <megal0maniac> wtf?
[15:53:21] <megal0maniac> Static resistance is 10 ohms, so that's 370mA
[15:54:19] <megal0maniac> Why would the battery be shutting off?
[15:55:17] <megal0maniac> 2000mAh. 370mA is a lot, but surely it isn't too much
[15:56:22] <RikusW> what are you using to charge it ? builtin one ?
[15:56:39] <megal0maniac> Yeah, that charging IC I mentioned
[15:56:49] <megal0maniac> No power source connected at the moment, thouhg
[15:56:51] <megal0maniac> though
[15:57:15] <megal0maniac> Battery shuts off as soon as it makes contact
[15:57:24] <RikusW> liion needs to be properly charged, usually with an IC
[15:57:39] <RikusW> might be overcurrent
[15:58:27] <megal0maniac> Yeah, it is charged though
[15:58:37] <megal0maniac> Why overcurrent? :/
[15:59:11] <RikusW> thats all I can think of
[15:59:22] * megal0maniac considers attaching 3.7V
[15:59:39] <megal0maniac> Without charging power source
[15:59:44] <megal0maniac> Of course :)
[15:59:44] <RikusW> the built in circuit protects from low voltage (on discharge) and over current
[16:11:13] <megal0maniac> RikusW: Yeah, it seems like it's probably that. Just stuck a scope on it. 12ms and it cuts out
[16:16:01] <megal0maniac> Hmmm... And sometimes the voltage sits at 0.3V for a second before it jumps up to 3.4, drops immediately to 2.5 and cuts out after 12ms
[16:18:53] <megal0maniac> http://i.imgur.com/RhTneyk.png
[16:19:24] <megal0maniac> Is there a story there?
[16:28:37] <malinus> megal0maniac, what kind os scope did you use for that?
[16:30:44] <megal0maniac> A very slow one :P
[16:30:56] <megal0maniac> It uses the ADC on a PIC
[16:32:22] <malinus> megal0maniac, so up to a couple khz I guess?
[16:33:00] <megal0maniac> 20khz for 1ch 7bit, 1 ch 1bit or 10khz for 2ch 7 bit
[16:33:08] <megal0maniac> Oh, 8 bit
[16:34:40] <malinus> well it isn't exactly 100mhz scope ;P
[16:34:47] <malinus> but I guess it's fine for many uses
[16:34:54] <megal0maniac> malinus: It's an avr programmer actually
[16:35:04] <megal0maniac> But also serves as a basic scope
[16:35:10] <megal0maniac> And usb - serial
[16:35:24] <megal0maniac> I love it
[16:36:21] <malinus> megal0maniac, which one is it?
[16:36:42] <megal0maniac> www.pololu.com/product/1300
[16:38:39] <ub|k> has anyone ever used this?
[16:38:42] <ub|k> https://code.google.com/p/hd44780-avr-tools
[16:45:30] <tzanger> megal0maniac: I can't tell what USB-UART chip is on there but Im' suspicious that it's Prolific
[16:45:33] <tzanger> if it is, STAY AWAY
[16:45:54] <megal0maniac> tzanger: Haha! No, it's all PIC firmware
[16:46:06] <tzanger> ah that's not so bad then
[16:46:15] <megal0maniac> I've had nothing but good service from my 3 Prolific clone chips
[16:46:40] <tzanger> really? they crash macs, Linux hates them and even under Windows they're flakey as hell
[16:46:49] <megal0maniac> Not even once
[16:47:01] <tzanger> wow, I think you're the first
[16:47:20] <megal0maniac> I think they key might be the drivers
[16:47:47] <tzanger> oh Im' sure of it
[16:47:59] <tzanger> there isn't a good prolific driver for mac, I even tried hacking the open source one to make it work better
[16:48:08] <tzanger> linux generally works with anything but even those guys have given up on them
[16:48:41] <megal0maniac> Ah, I found a good one for Windows. And haven't had issues with Linux, although I typically use them with Windows
[17:01:56] <z0idb3rg> Hi
[21:32:20] <Klapo> hmm
[21:33:51] <Klapo> guys I have DS3231 and arduino with 328P. How I'm supposed to use sqw interrupts? I have already configured RTC to; INTCN = 0 , RS1 = 0, RS2 = 0 (so from rtc side I'm getting sqw 1Hz signal)
[21:34:10] <Klapo> but dunno what should I do with arduino side, how should I set registers (didn't do this before)
[21:35:10] <Klapo> I'm connected to PCINT18/INT0