#avr | Logs for 2016-07-03

Back
[01:02:46] <iwancoppa> Hey guys, Is there a way to parametrically search 8 bit AVRs for frequency @ 3.3v
[01:03:06] <iwancoppa> Specifically; is there an 8 bit AVR that will run 16mhz @ 3.3v
[01:03:40] <Casper> afaik, they are all rated 8MHz, possibly some at 10...
[01:03:45] <inflex> mega*8's probably can
[01:03:55] <iwancoppa> Nope :/
[01:04:03] <iwancoppa> Currently a mega328 is in use, but at 5v
[01:05:04] <inflex> ah crud... they petter out at ~12.5MHz @ 3.3V
[01:05:16] <inflex> need 4V to get to 16
[01:43:49] <carabia> you can get xmegas running higher freqs at 3 V
[01:44:47] <carabia> but... xmegas. heh. I suggest looking at pics. You can get eeeverything with pics.
[01:45:29] <inflex> sure, you can do 40MHz with a PIC... but only about 5~10MHz effective :(
[01:50:45] <carabia> how about check that again?
[01:58:45] <carabia> inflex, it might be worth once in a while to get your facts straight instead of blindly repeating what you might have heard. And so on, you know?
[02:01:19] <carabia> pic32s are damn cheap, their peripheral set outmatches that of avrs by far while also in DIP. That is, if you're stuck in a timewarp in the 90s.
[02:02:03] <carabia> and their performance cannot be nowhere near matched by avrs.
[02:06:31] <inflex> One internet point for you, and have a lovely day.
[02:07:30] <carabia> though the comparison is unfair, if you'd want to compare them apples to apples you'd compare the pic32 line with the avr32 line. But avr32's are far more expensive and the mips-core used in pics is in wider use also
[02:09:07] <carabia> and the avr32s only come in qfp/qfn and maybe some bga (not sure)
[05:33:15] <LOMAS> hi.. do you people have some example code using this display http://www.buydisplay.com/default/5-7-inch-320x240-lcd-display-graphic-module-touch-panel-black-on-white ?
[05:41:14] <Lambda_Aurigae> ummmm
[05:41:24] <Lambda_Aurigae> random display....
[05:41:42] <liwakura> seems to have the default 8 bit parallel interface
[05:41:46] <Lambda_Aurigae> what is the controller?
[05:42:09] <liwakura> i8080 intf
[05:42:14] <Lambda_Aurigae> that's the interface.
[05:42:25] <Lambda_Aurigae> says nothing about the controller behind the interface.
[05:42:31] <liwakura> mh
[05:42:52] <Lambda_Aurigae> looks like an ra8875
[05:45:48] <Lambda_Aurigae> https://github.com/adafruit/Adafruit_RA8875
[05:46:01] <Lambda_Aurigae> but that is for their ra8875 implementation.
[05:46:05] <Lambda_Aurigae> might need to be modded for yours.
[05:46:45] <Lambda_Aurigae> http://www.buydisplay.com/download/democode/ERM320240-2_DemoCode.txt
[05:46:56] <Lambda_Aurigae> that one is right from the page you posted LOMAS
[08:09:52] <LeoNerd> Hrm.. Does avr-libc not accept printf "%*s", length, str then?
[08:10:01] <LeoNerd> I don't see * documented at http://www.nongnu.org/avr-libc/user-manual/group__avr__stdio.html#gaa3b98c0d17b35642c0f3e4649092b9f1
[08:34:20] <Emil> MD-328D
[08:34:33] <Emil> Is that like a no shame chinese arm copy of the atmega328p? :D
[08:35:28] <LeoNerd> "MassDuino"
[08:35:40] <Emil> yeah
[08:36:58] <LeoNerd> It's a bit more featured. Has deadtime generator, 12-bit ADC (vs 10bit on the AVR), 2 anacomps (vs 1 on the AVR), 2 DACs (vs none at all)
[08:38:36] <Emil> Hmm, how's the compiler for i?
[08:39:01] <Emil> If it has two real dacs it could be an interesting chip to mess around with
[08:39:15] <LeoNerd> Yah; the lack of DACs on the AVRs is sometimes disappointing
[08:39:27] <LeoNerd> That said, the ADCs are fairly disappointing too.. relatively slow, low-resolution
[08:39:38] <LeoNerd> If you're doing serious analog frontend work you tend to add external DAC/ADC anyway
[08:39:49] <Emil> true, true
[08:41:03] <Emil> I think the maximum sample rate you can get is around 77kSps
[08:41:08] <Emil> On an avr
[08:41:28] <Emil> and at that speed, no one really knows what kind of bit depth you have
[08:41:35] <LeoNerd> To be honest, I find the entire ADC architecture just a bit annoying on the AVR. The constant need to sample once, throw result away, sample again
[08:41:51] <Emil> Not if you keep it running all the time
[08:42:07] <LeoNerd> Hmm.. well, true
[08:59:29] <Tom_itx> they weren't made primarily as adc chips
[09:00:04] <Emil> Tom_itx: we know
[09:00:42] <iwancoppa> Emil: http://www.atmel.com/devices/ATXMEGA128A4U.aspx
[09:00:45] <iwancoppa> There ya go
[09:01:15] * LeoNerd wonders if __builtin_add_overflow() is going to be sane on AVR
[09:01:23] <Emil> iwancoppa: ?
[09:01:46] <iwancoppa> 12bit, 2msps, 12 channel ADC + 2 channel DAC 8-bit AVR
[09:03:58] <LeoNerd> src/pwmboard.c:28:5: warning: implicit declaration of function ‘__builtin_add_overflow’ [-Wimplicit-function-declaration]
[09:04:00] <LeoNerd> *booo*
[09:04:50] <Tom_itx> LeoNerd, do you do this as a living?
[09:04:59] <LeoNerd> Mm?
[09:05:13] <Tom_itx> avr
[09:05:56] <Tom_itx> you seem to always be working on something...
[09:06:05] <LeoNerd> I'm always working on something, yes :)
[09:06:31] <Tom_itx> well i was like that for a while but haven't been so active lately
[09:08:04] <Tom_itx> just curious...
[09:19:20] <inflex> aye, likewise :\
[10:45:17] <carabia> LeoNerd, perl seems like an interesting choice for a language...
[10:45:58] <LeoNerd> It's a lot easier to do asynchronous stuff than C
[10:46:09] <LeoNerd> Well, *any* language with things like closures and anonymous subs makes that easier :)
[10:48:40] <Lambda_Aurigae> whatever closures and anonymous subs are.
[10:48:42] * Lambda_Aurigae googles.
[10:49:48] <LeoNerd> anonymous code block. code that is inline as a firstclass value, not just a named function that lives somewhere
[10:50:14] <LeoNerd> anonymous code is particularly useful if it can form lexical closures, because then it can capture variables
[10:50:42] <Lambda_Aurigae> still no clue.
[10:51:12] <LeoNerd> So you know how in C, the only thing you can pass aroudn as a function pointer, say, is literally a pointer to a function?
[10:51:13] <Lambda_Aurigae> reading wikipedia now.
[10:51:21] <carabia> :D
[10:51:30] <Lambda_Aurigae> ok.
[10:51:40] <LeoNerd> Imagine if you could do more.. imagine if, isntead of defining a toplevel named function somewhere, you could jsut put more code inline
[10:51:52] <Lambda_Aurigae> called a macro
[10:52:02] <twnqx> or... an inline function
[10:52:03] <LeoNerd> void foo(void) { do some stuff } do_later(&foo); <== a normal function pointer
[10:52:13] <LeoNerd> Imagine if instead you could do_later(void(void){ do some stuff });
[10:52:30] <LeoNerd> That could be some syntax in a C-like language to express the idea of an anonymous function. It's a function withuot a name.. it's just inline code
[10:52:35] <LeoNerd> Code that's passed around by value
[10:52:50] <Lambda_Aurigae> like a macro
[10:52:55] <LeoNerd> No nothing like a macro
[10:53:14] <LeoNerd> do_later is a normal function, it receives a normal void (*)(void) in this case
[10:53:17] <carabia> LeoNerd, still. I'm no software guru, but how's the overhead
[10:53:25] <LeoNerd> That's just a pointer value. You can use it like any other pointer value
[10:53:51] <LeoNerd> carabia: By far the slowest part of this mechanism is the USB-CDC polling latency of 1000Hz
[10:53:57] <LeoNerd> So beyond that I Really Don't Care
[10:56:15] <carabia> Not sure if it's worth it. Unless you really really like perl
[10:56:39] * Lambda_Aurigae goes back to learning Fiery Print Controllers for work...90% of which will never actually be used.
[10:57:20] <LeoNerd> It's a resonable choice. As I said, it's a lot nicer than C for writing high-level stuff. I tend to only write C on AVR MCUs, or in lower-level mechanism parts
[10:57:24] <LeoNerd> Anything else wants a nicer HLL
[11:24:41] <LOMAS> there seems no option for 'external tools' in atmel studio 7. How can I configure my USBasp ?
[11:25:14] <Lambda_Aurigae> probably can't.
[11:25:19] <Lambda_Aurigae> you will need to use avrdude
[11:26:57] <LOMAS> Lambda_Aurigae, Its frustrating!! Yes, I have been using it.
[11:34:05] <Lambda_Aurigae> what is frustrating about it?
[11:34:13] <Lambda_Aurigae> the fact that it's not a point and poke gui?
[11:39:19] <Lambda_Aurigae> I believe you need an AVRISP mkII or similar to work directly with atmel studio.
[11:39:28] <Lambda_Aurigae> or, maybe a jtag-ice
[11:40:08] <Lambda_Aurigae> the usbasp is a 3rd party programmer and likely not supported directly by atmel studio.
[11:47:35] <Lambda_Aurigae> looks like it supports AVR Dragon, AVR ONE!, AVRISP mkII, Atmel-ICE, JTAGICE mkII, JTAGICE3, Power-Debugger, QT600, SAM-ICE, STK500, STK600
[12:28:49] <LeoNerd> Remind me: Who round here was interested in my soft UART code?
[12:30:53] <Lambda_Aurigae> everybody?
[12:31:01] <Lambda_Aurigae> we want to pirate it!
[12:31:43] <LeoNerd> Heh.. Really? I mean, aren't there about 30 of them around already?
[12:31:51] <Lambda_Aurigae> probably.
[12:32:00] <Lambda_Aurigae> I like jarzta's myself.
[12:32:00] <LeoNerd> It was more there was one particualr person who kept asking me about it, but I forget who that was
[12:32:11] <Lambda_Aurigae> not that I've used it much, but it is elegant and small.
[12:32:38] <LeoNerd> Mine doesn't yet do majority voting on 3 samples yet.. it's single sample :/
[12:32:50] <LeoNerd> But it seems reliable enough at 57.6k
[12:33:13] <Lambda_Aurigae> Jartza's runs in the vertical blanking on an attiny85 generating VGA video.
[12:33:25] <LeoNerd> Ohyes, that one
[12:33:30] <Lambda_Aurigae> at 9600 bps.
[12:33:34] <LeoNerd> Rather specialised :)
[12:33:38] <Lambda_Aurigae> yup.
[12:34:01] <LeoNerd> Mine's a generic thing. It'll run justabout anywhere. It just needs a pair of IO lins on a PCINT capable port, and a spare 8bit timer
[12:34:10] <Lambda_Aurigae> kewl.
[12:34:48] <Lambda_Aurigae> not a lot of use for it myself really as I generally stick with chips that have usart hardware but I'm sure there are others around here who could use it.
[12:35:09] <LeoNerd> Yah.. if there's a hardware UART I tend to use it
[12:35:25] <LeoNerd> I wrote the TX part of this so I had a debug serial port I could printf() to on a chip where Iwas already using the UART for other things.
[12:35:30] <Lambda_Aurigae> my most commonly used AVR is the atmega1284p which has 2.
[12:35:39] <LeoNerd> DMX-512 at 250kbaud vs. debugging at 19.2k - so clearly the former wants to use the real UART
[12:35:58] <Lambda_Aurigae> always nice to have extra debug stuff.
[12:35:59] <LeoNerd> Recently (ie. this weekend) I added RX ability so I can use it on a tiny85
[12:36:09] <LeoNerd> I'm using a tiny85 as a serial-attached PWM controller
[15:24:48] <LeoNerd> Lambda_Aurigae: http://pastie.org/10898006 <== an example by the way, of the sort of place where an anonymous might make the code neater. It'd be nice if I could fold those four statics into the struct initialiser itself
[15:25:15] <LeoNerd> So e.g. { .port = 1, .pnum = 3, .set_pwm = (void)(bool pwm, uint8_t val){ pwm ? ... : ... } },