#avr | Logs for 2015-05-18

Back
[00:27:20] <malinus> osteri: yes
[01:02:01] <osteri> malinus: OK. About LUFA: why the firmware needs to be different, in cases of HID/USB-CDC/etc... why cannot be just "USBLibraryAPI.h" that is included in the application section? I'm trying to understand bootloaders...
[01:05:14] <osteri> trying to learn by questioning :)
[03:26:04] <EI24> does the program always start at 0x0000 no matter what?
[03:26:33] <EI24> in asm
[03:26:37] <EI24> avr asm*
[03:30:28] <Tom_itx> unless you specify something else
[03:30:36] <Tom_itx> like a bootloader
[03:34:04] <EI24> Tom_itx: say i have a main file, which starts with .org 0x0000 RJMP main. but the main file starts of by including another file which have instructions, will i the start executing the included file first?
[03:34:50] <EI24> will the program start executing the included file first?**
[03:35:28] <Tom_itx> if it's assembled with the code it will
[03:35:47] <Tom_itx> in the end it's all one file
[03:36:16] <EI24> ok :/
[03:36:35] <EI24> then ill have to put the reset interrupt vector in the included file...
[04:02:34] <EI24> Is there any difference between .asm and .inc files? I dont find any resuls when i search for it
[04:07:08] <rue_house> asm files include inc files
[04:08:21] <malinus> osteri: I don't know the in and outs of LUFA. I just read the manual and use it as intended. I hate usb and don't want to touch it myself more than I have to :D
[04:09:04] <malinus> So you won't get any answers on "why" questions from me :D
[04:12:03] <EI24> rue_house: is there any other difference? If the only difference is that inc files is included by asm files, it seems rather pointless to have two different file names
[04:12:12] <twnqx> why?
[04:12:18] <twnqx> it's the same with .c and .h files
[04:12:39] <twnqx> the difference is to tell humans about the purpose
[04:13:50] <EI24> perhaps i'm wrong
[04:13:50] <malinus> what's the point of indents?
[04:13:53] <malinus> :D
[04:14:14] <twnqx> dunno, i write all my C in single line
[04:14:17] <twnqx> :P
[04:19:06] <rue_house> how do I divide a integer by 2.016 in assembler again?
[04:20:06] <twnqx> write it in c, and c&p the assembler output? :D
[04:21:22] <malinus> lol'd
[04:28:09] <osteri> abcminiuser: About LUFA: why the firmware needs to be different, in cases of HID/USB-CDC/etc... why cannot be just "USBLibraryAPI.h" that is included in the application section? I'm trying to understand bootloaders...
[04:29:00] <twnqx> probably size
[04:29:29] <twnqx> also you have limited endpoints, they are either for one function or the other
[04:29:39] <twnqx> and each usb-enabled chip is different, too
[04:32:11] <osteri> but what it has to do with firmware, I still don't get it
[04:32:27] <twnqx> ... you do have a definition probelm here
[04:32:34] <twnqx> there is only one software on an avr
[04:33:05] <twnqx> or i don't get qhat you are asking
[04:33:44] <twnqx> you could tightly couple bootloader and application so that they share code
[04:34:18] <twnqx> but it would create unwanted dependencies, and you'd have to update the bootloader if the provided library need a new feature
[04:34:58] <osteri> oh, now I understand
[04:35:20] <osteri> the firmware has nothing to do with USB stack, it's just for programming
[04:36:04] <osteri> so the CDC firmware was for programming in AVR109 protocol... I was just confused
[04:39:39] <twnqx> if by firmware you mean bootloader, yes
[04:39:50] <osteri> yeah
[04:39:57] <twnqx> you can go without
[04:40:01] <twnqx> (if oyu want to)
[04:40:31] <osteri> yes, with ISP/JTAG programmer?
[04:41:04] <twnqx> yeah
[04:41:44] <osteri> so if I mess up and completely flush flash & botloader, I can still program it with ISP-programmer
[04:42:03] <twnqx> of course
[04:43:11] <osteri> this clears things a bit, thanks
[04:44:26] <idiot2> hi
[04:45:01] <idiot2> EI24, yes, but the interrupt vector if enabled is at the program start, so you start with a jump to start
[04:45:32] <twnqx> (unless relocated by fuse)
[04:46:30] <idiot2> anybody made an ssd yet? :)
[04:46:40] <idiot2> sounds like a task for a fast arm
[04:46:56] <idiot2> usb or sata
[04:47:34] <twnqx> i doubt any software can push those speeds
[04:47:40] <twnqx> on the lowend chips
[04:47:54] <twnqx> so basically, tons of hardware offload and a cpu for management
[04:47:57] <idiot2> i'd gues it needs a 400MHz+ arm
[04:48:24] <idiot2> especially if it has special features, wear leveling, raid, ecc
[04:48:25] <twnqx> well, it depends
[04:48:42] <twnqx> i... do have a at90usb based memory stick
[04:48:48] <idiot2> :)
[04:48:51] <twnqx> atmel's USB key demo
[04:48:57] <idiot2> that would work, a bit slow though
[04:49:20] <idiot2> ho wmany flash chips did you use?
[04:49:26] <twnqx> http://www.atmel.com/tools/at90usbkey.aspx
[04:50:24] <EI24> idiot2: yes but i want all interrupt vectors in a init file, but if that init file includes say a function file, before setting the interrupt V list, then ill need to have the reset vector in the function file
[04:51:07] <idiot2> euyou can do that by including your vector file at the specific point.
[04:51:13] <idiot2> EI24
[04:51:24] <twnqx> define a separate section for it and use a matching linker script
[04:51:29] <idiot2> so the code will seem cleaner
[04:52:41] <twnqx> what's the point of programming an AVR in 100% asm? wanting to learn it?
[04:53:04] <idiot2> that is not bad
[04:53:06] <EI24> i think i will include the function file in main, which is jumped to after init :)
[04:53:33] <twnqx> idiot2: never said it's bad, just wondering why someone would do it
[04:53:34] <malinus> twnqx: cutting edge technology, that requires the full speed of a 16MHz 8-bit mcu!
[04:53:49] <idiot2> btw i did my first knight rider runnig lights in pure asm
[04:54:08] <EI24> twnqx;yes i want to learn the fundamentals, and i like the one to one correspondence aspect
[04:54:09] <twnqx> i think i never did pure ASM after the C64
[04:54:26] <idiot2> well, i did not even have gcc back then, i just been given an assembler
[04:54:40] <EI24> but i will prob move to C later
[04:54:40] <idiot2> and a mcu and a programmer, and do what you can
[04:55:15] <malinus> idiot2: gcc in the 80's :D?
[04:55:23] <idiot2> no, it was in 2002
[04:55:39] <idiot2> gcc probably existed i just didin't have it
[04:55:48] <EI24> ^^
[04:55:50] <malinus> lol yeah, it existed
[04:57:19] <abcminiuser> Crap what did I miss?
[04:57:29] <twnqx> not much :)
[04:57:36] <twnqx> questions already answered
[05:00:39] <idiot2> hey abcminiuser
[05:00:52] <idiot2> you missed sunrise. as ususal
[05:05:50] <twnqx> still wondering
[05:06:01] <abcminiuser> As always :P
[05:06:06] <twnqx> wether to use a mega32 + ethernet
[05:06:08] <abcminiuser> Christ I have no free time these days
[05:06:18] <twnqx> or just an arm with embedded ethernet :X
[05:06:24] <twnqx> and finally learn2arm
[06:18:22] <r2d22> test
[06:23:47] <Lambda-Aurigae> fail
[07:05:04] <LeoNerd> Mmm.. I think this will be my first triple-powerrail board
[07:05:20] <LeoNerd> +9V for the high-brightness LED feeds, +5V for the AVR, +3.3V for the nRF24L01
[07:14:54] <DO9XE> my current project has 5 powerrails :)
[07:15:12] <DO9XE> +-12V +-3.3V and +5V :)
[07:15:33] <Lambda-Aurigae> no 24V?
[07:15:39] <Lambda-Aurigae> gotta have -24V!
[07:15:39] <LeoNerd> Sounds almost like ATX, only that has +/-5 and no -3
[07:17:31] <idiot2> why would you want separate mcu supply anyway
[07:17:44] <Lambda-Aurigae> stability, noise immunity
[07:17:50] <idiot2> there is ldo regulator
[07:17:55] <idiot2> and 7805.
[07:18:02] <idiot2> from 7V 7805 is good
[07:18:03] <Lambda-Aurigae> linear regulators suck a lot of power.
[07:18:09] <idiot2> oh sure...
[07:18:13] <idiot2> 1-5mA
[07:18:35] <Lambda-Aurigae> when powering by battery that's a lot.
[07:18:45] <LeoNerd> If you're mains-powered that's definitely "acceptable losses"
[07:18:46] <idiot2> he uses an atx power supply m8
[07:19:04] <Lambda-Aurigae> I use old copier power supplies myself.
[07:19:19] <Lambda-Aurigae> that way I get nice 24V power for driving steppers and motors I get out of copiers.
[07:19:28] <idiot2> hmm
[07:19:41] <idiot2> and you use stwitched mode driver?
[07:19:50] <idiot2> current generator?
[07:19:59] <Lambda-Aurigae> copier power supplies are switch mode supplies, yes.
[07:20:18] <idiot2> i was asking about the driving of the stepper
[07:20:32] <Lambda-Aurigae> oh...various modes for driving the steppers.
[07:20:33] <idiot2> if you use resistor then you waste 90% of power
[07:20:40] <Lambda-Aurigae> driver chips of some sort usually.
[07:21:04] <Lambda-Aurigae> quite often uln2803 chips when I can get them cheap.
[07:21:06] <idiot2> so you need high voltage to be able to "step" fast
[07:21:17] <idiot2> they will work from 3-5V usually
[07:21:19] <Lambda-Aurigae> the steppers I have are rated for 24V
[07:21:25] <Lambda-Aurigae> they do not work for squat at 5V
[07:21:32] <idiot2> squat?
[07:21:34] <Lambda-Aurigae> work acceptably at 12V usually.
[07:21:49] <Lambda-Aurigae> these are made for higher voltage and do not like to work at 5V
[07:21:53] <idiot2> sure they will be slow at 5V because... 5V
[07:22:28] <Lambda-Aurigae> not a lot of torque at 5V either.
[07:22:46] <idiot2> that only depends on internal resistance/number of turns
[07:22:59] <Lambda-Aurigae> and many of the free running motors don't like to start up below 12V.
[07:22:59] <idiot2> torque is function of current, not voltage
[07:23:22] <idiot2> hm, i dont know what you mean by that
[07:23:29] <idiot2> it thought you have "stepper" motor
[07:23:38] <Lambda-Aurigae> I have different kinds of motors.
[07:23:46] <idiot2> sure.
[07:23:51] <Lambda-Aurigae> I have a lot of these brushless DC motors with integrated controllers.
[07:24:06] <Lambda-Aurigae> at 12V the controller will start and start the motor..at 5V it won't even start up.
[07:24:13] <idiot2> well
[07:24:20] <idiot2> a tl494 operates downto 7V too
[07:24:23] <Lambda-Aurigae> at 18 to 24 volts it runs great.
[07:24:27] <idiot2> it will not work from 5V
[07:26:38] <Lambda-Aurigae> ok...time for me to go to work and break some more copiers.
[07:27:07] <idiot2> hehehe
[07:27:08] <idiot2> nice
[07:27:15] <idiot2> i want copiers too ! :(
[07:27:20] <idiot2> i have nice bldc from some
[07:28:02] <idiot2> but idiots just throw them out, and who knows what it is will want to sel expensive
[07:49:51] <twnqx> my current project
[07:50:01] <twnqx> has USB to +40V input
[07:50:09] <twnqx> drops that to 3.3V with a switcher
[07:50:28] <twnqx> and then, since usb + diode drop can be too much, has another switcher to step it back up to 5V >_>
[07:50:54] <idiot2> you are doing it wrong
[07:51:37] <twnqx> not really
[07:51:50] <idiot2> usb is fine with 3v3
[07:51:55] <twnqx> yeah
[07:52:01] <twnqx> but i need a 5V rail for one of the chips
[07:52:04] <idiot2> actually is specified for 3v6 top
[07:52:21] <twnqx> and i can't rely on the usb voltage to be high enough
[07:52:31] <idiot2> you can make 5V and ldo downto 3v3
[07:52:37] <idiot2> this is the std way
[07:52:41] <twnqx> that way would suck
[07:52:50] <twnqx> 'cause then i need a buck/boost or SEPIC
[07:53:04] <twnqx> to go from <5V or >5V to 5V
[07:53:09] <twnqx> been there, done that
[07:53:26] <twnqx> and yes, that board actually also has an LDO to 3.3V
[07:53:28] <idiot2> i see no problems other than those you created for yourself
[07:53:45] <twnqx> mh?
[07:53:48] <twnqx> SEPICs suck
[07:53:48] <idiot2> :)
[07:54:06] <twnqx> far too large Ls
[07:54:17] <twnqx> last i used is 12mmx12mm
[07:54:47] <twnqx> mind you, i am not always USB powered, might be just 24V powered
[07:55:20] <twnqx> and SEPIC's efficiency is <80%, which is also bad
[07:55:21] <idiot2> whatever you feel comfortable with
[07:55:29] <twnqx> i would prefer >95%
[07:55:40] <idiot2> that is not easy
[07:56:04] <idiot2> especially when the driver eats 0.5W and your load is 100mW
[07:56:26] <twnqx> ... why would a driver eat 0.5W?
[07:56:41] <idiot2> because mosfet switching at 200kHz
[07:56:54] <idiot2> and switching losses in transformer core
[07:57:12] <idiot2> and parasitic losses
[07:58:18] <idiot2> you can only do >90% with phase shift pwm or the magical resonant mode
[07:58:28] <twnqx> where do you have transformers in your small dc-dc regulators, except in sepic/isolated flyback topologies
[07:58:46] <idiot2> all inductors have ferrite cores.
[07:59:03] <idiot2> air core is just a wire wound could that will be large
[07:59:40] <twnqx> i thught you were specifically referring to transformers (>1 windings), my bad
[07:59:53] <idiot2> oh those are the same thing ;)
[08:00:08] <idiot2> your inductor is a transformer with no secondary (yet)
[08:00:28] <idiot2> you could use a single inductor for a sepic btw if you wound another winding on it
[08:01:34] <twnqx> yes, effectively a transformer.
[08:01:46] <twnqx> using that. can even halve the inductance with that.
[08:02:13] <idiot2> so you want superhightech lossless switching power converter ;)
[08:02:44] <twnqx> http://i.imgur.com/BGqhvCK.jpg see that large L1
[08:03:00] <idiot2> and you will waste hundreds of watts elsewhere
[08:03:57] <idiot2> that is considered small
[08:04:27] <idiot2> i'd like to see your resonant mode or phase shift pwm supply fit in that space :)
[08:04:51] <twnqx> that's topologies you'd use in AC/DC
[08:04:55] <twnqx> not in low-current DC/DC
[08:05:10] <idiot2> will you add pfc too for your mcu supply lol ?
[08:05:40] <twnqx> again
[08:05:44] <twnqx> we are talking DC/DC
[08:05:53] <twnqx> since there is no AX
[08:05:53] <twnqx> AC
[08:06:03] <idiot2> ok m8 have fun
[08:06:07] <twnqx> i obviously do not HAVE a power factor that needs correction
[09:52:46] <Artyum> Hi, I'm first time on this channel so greets to everyone. Maybe you could help me. I have weird SPI behaviour with sd card and radio module. I use FatFS, Generally I can write and read on sd card and use radio at the same time but I experience hangups
[09:54:07] <LeoNerd> Hi
[09:54:23] <LeoNerd> What kind of radio module? (I only ask because my current big project uses an nRF24L01 so I'm quite familiar with it)
[09:56:06] <Artyum> I use RFM69HW. Strange thing is that the problem seems to exists on kingstone class 10 and my other card sandisk class 4 is ok
[09:56:15] <LeoNerd> Mmm
[09:56:27] <LeoNerd> So how are you talking to each?
[09:56:44] <LeoNerd> As in: When do you decide? E.g. you can't do one from ISR and one not
[09:56:55] <LeoNerd> I arrange my code so that ISRs don't talk SPI
[09:59:28] <Artyum> I don't communicate in ISR. Just in main loop. When I disable radio then the sd is fine, and vice versa. When the hung occures than the code execution is paused until I remove sd from the slot
[09:59:53] <LeoNerd> Mmm.. have you checked that both units correctly hiZ themselves off the MISO line?
[10:00:09] <LeoNerd> I've seen sometimes "SPI-compatible" chips that don't do that, so you have to buffer it somehow
[10:00:18] <LeoNerd> (74xx165 I AM LOOKING AT YOU)
[10:01:34] <Artyum> Mayby it is the reaseon, I saw some code in FatFS responsible for putting into hiZ code. Mayby I should do the same for radio module ?
[10:02:00] <Artyum> but the problem is that I dont know how that hiZ works :)
[10:02:08] <LeoNerd> It's not usually a software-controlled thing
[10:02:28] <LeoNerd> A truely SPI-compatible chip will hiZ its DO/MISO line once you deassert SS
[10:02:52] <LeoNerd> If it doesn't do that, you can easily isolate it with something like a 75xx125. I keep a stock of them for that reason
[10:03:04] <LeoNerd> (Got myself some lovely little single-gate versions - they come on a tiny SOT-23-5 package :) )
[10:03:44] <Artyum> Could you tell me how to control hiZ the software way?
[10:04:01] <LeoNerd> Uhmm..
[10:04:06] <LeoNerd> It's not usually a software thing
[10:04:18] <LeoNerd> If *some* chips have that ability that'll be something weird and custom within them
[10:06:14] <Artyum> could it be true that kingston sd card is not "spi-compatible" and sandisk is ok ?
[10:06:45] <LeoNerd> I don't really know SD cards, but if one of them didn't hiZ properly then yes that could explain your issue
[10:07:18] <LeoNerd> An easy enough one to test by isolating it with a tristate buffer; hopefully you'll have some kind of tristate chip to hand?
[10:07:33] <LeoNerd> (74xx125, 126, 240,..)
[10:09:56] <Artyum> I have "Atnel atb" where sd slot is connected do uC through 74LVC125, but I have the same issue there. The 74... works there also as level converter
[10:10:41] <Artyum> therefor I'm stuck
[11:02:43] <twnqx> It includes a built-in USB programming interface that is as simple as using a USB Flash Drive. Plug it in, drop on an ARM program binary, and its up and running!
[11:02:47] <twnqx> cute idea
[11:03:00] <twnqx> i wonder if LUFA could do that, too :D
[11:27:43] <anton02> is this buffer mosfet able to have a high input impedance? http://upload.wikimedia.org/wikipedia/commons/thumb/3/30/N-channel_JFET_source_follower.svg/270px-N-channel_JFET_source_follower.svg.png
[11:31:48] <anton02> jfet*
[12:00:45] <TechIsCool> anyone played with Belimo Actuators?
[12:19:46] <rue_house> not i
[13:09:00] <Artyum> LeoNerd, I had to go, but thanks for answer.
[14:10:04] <LeoNerd> I have an optocoupler (4N28) output attached to INT1. I'm watching it on a logic probe. I have a debug printing line in the INT1 handler.
[14:10:12] <LeoNerd> Occasionally it just doesn't notice a falling edge.
[14:10:21] <LeoNerd> What should I be looking at and thinking about to work out why?
[14:11:10] <LeoNerd> By "occasionally", I mean I start a transation [this is the clock line of an I2C-like link], and the first byte is prettymuch always received OK, then by about the 2nd or 3rd tick of the clock in the second byte, it just doesn't notice one tick. Thereafter of course all the rest of the bytes are messed up
[14:13:07] <idiot2> hi
[14:13:43] <idiot2> 4n28 is very slow
[14:14:01] <idiot2> edge trigger needs fast edges, level trigger works with levels
[14:14:19] <idiot2> you can use faster optos and maybe add a schmitt trigger cmos gate
[14:14:39] <LeoNerd> Ahyes I could gate it couldn't I.. Hmmm
[14:14:48] <LeoNerd> See I have had this working fairly reliably. I'm not sure what's upset now :(
[14:15:03] <LeoNerd> Worked on breadboard, seems to be less reliable having starting moving it out to protoboard
[14:16:39] <LeoNerd> AHA!
[14:16:52] <LeoNerd> Needs current-limiting smaller resistor on the LED side of the isolator
[14:17:02] <LeoNerd> 470R a bit too high at 5V. 220R works nicely
[14:17:23] <idiot2> that should not matter, but ok
[14:17:52] <idiot2> you set whatever working current you prefer, these are analog
[14:18:23] <LeoNerd> Yes, but obviously the larger resistor, the less bright the LED, so the less conductive the transistor, so the slower it'll transition
[14:18:42] <idiot2> yes
[14:19:01] <idiot2> but if it is not good at 5mA then i would not trust it at 10mA either
[14:20:31] <idiot2> signal conditioning may help, or if good enough, a faster opti, like 6n136 6n137
[14:21:59] <idiot2> you can add svhmitt trigger, comparator with hysteresis, and you could even send differential signal using 2 optos
[14:36:14] <LeoNerd> Righty; I don't *have* any 6Ns, (well, I have _one_ but that's in use elsewhere)
[14:36:28] <LeoNerd> I don't offhand have a schmitt trigger. I have until Thursday to make this work
[14:36:46] <LeoNerd> As I said it did work superreliably on the breadboard which is why I'm somewhat upset now
[14:39:10] <LeoNerd> Aaaand yes; 220 instead of 470R seems to be helping
[14:42:10] <LeoNerd> When I have time to do a better rebuild I think I'm going to turn it into an RS485 system
[14:42:17] <LeoNerd> But I don't have time right now
[15:00:29] <Artyum> Please advise about fatfs. I'm using radio and sd slot on spi bus. I want to write data to file but I'm getting empty file or no file at all (f_mount and f_open returns FR_OK). I open file once at the begining but I wonder if I have to f_open file in every spi acccess?
[15:07:27] <Artyum> LeoNerd, what range did you get with nrf24l01 ?
[15:25:25] <idiot2> well it can take 30-50mA continuous/50% duty, so yo can boost it with more current if you want thta
[15:25:44] <idiot2> but if you saturate a transistor it will still have slow turn off
[15:26:00] <idiot2> did you do it as emitter follower?
[15:26:15] <idiot2> or common emitter saturated mode?
[15:26:41] <idiot2> LeoNerd
[15:36:09] <LeoNerd> I'm talking about the LED side, not the transistor
[15:37:05] <idiot2> the led can take 30-50mA yes.
[15:37:38] <idiot2> those IR leds are high power
[15:38:22] <idiot2> you also need to take k_ctr into account and set an appropriate emitter current on the other side
[15:38:57] <LeoNerd> Yah