#avr Logs

Jun 03 2017

#avr Calendar

12:33 AM day_ is now known as daey
01:53 AM day_ is now known as daey
02:11 AM day_ is now known as daey
06:24 AM NoHitWonder^: what is the smallest avr that has 4 timers and hardware uart?
06:25 AM NoHitWonder^: in memory size
06:25 AM specing: maybe tiny2313?
06:26 AM specing: 128B or so
06:49 AM Emil: NoHitWonder^: 4 separate timers?
06:49 AM Emil: NoHitWonder^: or 4 outputs?
06:49 AM Emil: for pwm
06:50 AM Emil: because the that 2313 does not have four timers iirc
06:50 AM APic is now known as ASM17Pic
07:02 AM NoHitWonder^: 4 timers, output not required
07:04 AM LeoNerd: Do you really need 4 timers? What are you trying to do?
07:04 AM LeoNerd: Can you not get away with fewer timers + software trickery somehow?
07:17 AM rue_bed: NoHitWonder^, you need them for software irq?
07:17 AM rue_bed: the 328 has like 6 timers, most with 2 channels
07:17 AM LeoNerd: No, it has 3 timers; each with two compare/PWM channels
07:17 AM LeoNerd: I've usually managed to do all the software things I need in a single timer though
07:17 AM rue_bed: oh yea, 6 pwm, thats what I'm thinking
07:18 AM LeoNerd: Have it tick at some relatively fast frequency and maintain your own counters in software for the individual things you need to happen
07:18 AM rue_bed: the tiny13 has a 2 channel timer iirc
07:18 AM LeoNerd: tiny13 has no UART though which was the other half of the question
07:19 AM rue_bed: er, yea, so prolly tiny85
07:19 AM rue_bed: but I'd not played with those
07:23 AM LeoNerd: I don't recall the tiny85 having a UART either. They're fairly rare on tinies
07:24 AM LeoNerd: 84 lacks it, 841 has, also 1632 and 2313 oddly
07:28 AM Emil: rue_bed: m328pb has 6 timers iirc
07:29 AM Emil: or was it 4
07:29 AM Emil: LeoNerd: can you check your gcc-avr version?
07:29 AM Emil: NoHitWonder^: why must it be small memory size?
07:29 AM Emil: NoHitWonder^: just take a m328pb in qfn
07:30 AM Emil: And you have plenty of space to play around with
07:32 AM NoHitWonder^: well for it to be cheap. the software is gonna be super simple
07:32 AM NoHitWonder^: so no need for much memory
07:32 AM Emil: if you want cheap, arm it is
07:33 AM NoHitWonder^: yeah but i prefer avr for small projects
07:35 AM jaakkos: NoHitWonder^: have you considered carefully that you really need 4 timers, because the AVR timers have kind of 2 channels each that *might* suffice
07:36 AM Emil: jaakkos: no output required
07:36 AM Emil: jaakkos: the channels are only for pwm
07:37 AM jaakkos: Emil: you can have 2 compare matches
07:37 AM jaakkos: eg. different values for OCR0A and OCR0B
07:38 AM Emil: ...
07:38 AM Emil: Mate
07:41 AM jaakkos: anyway, they are most certainly not only for pwm
07:44 AM rue_house: Emil, you want to do software pwm?
07:44 AM rue_house: then you only need 1 channel
07:44 AM rue_house: 1 timer
07:44 AM rue_house: you have it interrupt you at your pwm count rate
07:45 AM rue_house: /*********************************************************
07:45 AM rue_house: !!!!!!!!! SEVERLY OPTIMIZED CODE !!!!!!!!!
07:45 AM rue_house: REFERNENCE ASSEMBLER OUTPUT WHEN MODIFYING
07:45 AM rue_house: THIS PWM FUNCTION
07:45 AM rue_house: gcc -O1
07:45 AM rue_house: **********************************************************/
07:45 AM rue_house: SIGNAL (SIG_OVERFLOW0) {
07:45 AM rue_house: if (++pwmcount == 0){
07:45 AM rue_house: p0 = pwm0; p1 = pwm1; p2 = pwm2; p3 = pwm3;
07:45 AM rue_house: SetBit(PWM0BIT, PWM0PORT);
07:45 AM rue_house: SetBit(PWM1BIT, PWM1PORT);
07:45 AM rue_house: SetBit(PWM2BIT, PWM2PORT);
07:45 AM rue_house: SetBit(PWM3BIT, PWM3PORT);
07:45 AM rue_house: };
07:45 AM rue_house: if ((p0 ^ pwmcount) == 0) { ClearBit(PWM0BIT, PWM0PORT); }
07:45 AM rue_house: if ((p1 ^ pwmcount) == 0) { ClearBit(PWM1BIT, PWM1PORT); }
07:45 AM rue_house: if ((p2 ^ pwmcount) == 0) { ClearBit(PWM2BIT, PWM2PORT); }
07:45 AM rue_house: if ((p3 ^ pwmcount) == 0) { ClearBit(PWM3BIT, PWM3PORT); }
07:45 AM rue_house:
07:46 AM rue_house: }
07:46 AM rue_house: there ya go, 4 software pwm channels
07:46 AM rue_house: #define SetBit(BIT, PORT) PORT |= (1<<BIT)
07:46 AM rue_house: #define ClearBit(BIT, PORT) PORT &= ~(1<<BIT)
07:46 AM rue_house: (gcc turns those into sbi and cbi instructions)
07:48 AM specing: C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-Combo breaker!
07:53 AM rue_house: there really is no point in anyone sharing anything, nobody wants to use anyone elses code, even if they took weeks figuring it out and making it perfect
07:53 AM specing: Make it into a library
07:53 AM rue_house: so people can misuse it and say it dosn't work?
07:59 AM LeoNerd: Emil: avr-gcc (GCC) 4.9.2
07:59 AM specing: Liek anything else would happen otherwise
08:00 AM specing: also if you wanted to severely optimize it, why not just do inline asm?
08:00 AM kre10s: rdablty maybe?
08:00 AM specing: define setbit as sbi and gcc will flip out if it cannot be used
08:01 AM specing: because right now you are commiting a crime of relying upon a compiler implementation
08:01 AM Emil: LeoNerd: interestin
08:02 AM Emil: rue_house: no I
08:02 AM Emil: 'm fine
08:02 AM Emil: Also
08:02 AM Emil: >Using Signal
08:02 AM Emil: what the actual fuck mate
08:02 AM Emil: that's deprecated
08:04 AM Emil: rue_house: also mate your cynicism is annoying
08:05 AM rue_house: :)
08:05 AM jaakkos: Emil: re timer channels: agreed that the compare match is probably not very useful for other than PWM
08:05 AM rue_house: ... I thought I rewrote all that stuff... huh
08:06 AM Emil: LeoNerd: what distro are you on?
08:06 AM rue_house: well easy change, and I prefer to use C to move that code around, but I'm also not well practissed at inline asm, or extern for that matter
08:06 AM Emil: jaakkos: but yeah sure, one can use the compares for generating periodic interrupts
08:07 AM Emil: true
08:07 AM jaakkos: rue_house: maybe use a pastebin for such a long paste next time, people will be much less offended
08:07 AM Emil: jaakkos: excellent point
08:07 AM -!- #avr mode set to +o by ChanServ
08:07 AM rue_house: Its fine to post small chunks of code if your not interrupting a conversation
08:08 AM Emil: >small chunks
08:08 AM Emil: that was no small chunk
08:08 AM rue_house: whaaat? that jus a few lines
08:08 AM Emil: few is 2 to at most 6
08:08 AM polprog: ive seen worse
08:08 AM Emil: polprog: not the point
08:08 AM polprog: ive seen worse flooding
08:08 AM Emil: Everyone's seen worse
08:09 AM specing: rue_house: now you have to ban self
08:09 AM rue_house: pfff
08:09 AM jaakkos: C-beams glitter in the dark near the Tannhäuser Gate
08:09 AM rue_house: Emil, so, you doing software pwm or what?
08:10 AM Emil: rue_house: 2017-06-03 15:31:57 +0300 and 2017-06-03 15:32:02 +030
08:10 AM Emil: rue_house: I'm not doing pwm at the moment
08:11 AM rue_house: just generating interrupts for it?
08:11 AM rue_house: why would you want 4 interrupts for 4 channels tho?
08:11 AM Emil: mate :D
08:11 AM Emil: wtf
08:11 AM Emil: I
08:11 AM Emil: NoHitWonder^ asked for code help, not me
08:12 AM rue_house: pfff, atleast I'm helping someone with a problem, granted, maybe not the person who has the problem, geez, pickey, pickey...
08:12 AM Emil: ...
08:13 AM Emil: /kick rue_house desu desu desu
08:14 AM Emil: I'm off to enjoying some homemade hamburgers :3
08:52 AM LeoNerd: Emil: debian testing. is debian package version 1:4.9.2+Atmel3.5.3-1
09:11 AM Emil: LeoNerd: and grep -ir "328pb" returns something when searching at /usr/lib/ ?
09:11 AM Emil: grep -Iir "328pb"
09:12 AM day_ is now known as daey
09:24 AM LeoNerd: Emil: that'd be avr-libc surely?
09:24 AM LeoNerd: The .h files come with libc, not gcc
09:27 AM Emil: Ah, true
09:28 AM Emil: but gcc-avr depends on libc and the newer version should pull a never version of libc
09:28 AM LeoNerd: /usr/lib/avr/include/avr/iom328pb.h:#ifndef _AVR_ATMEGA328PB_H_INCLUDED
09:28 AM Emil: Yeah
09:28 AM Emil: Alrighty
09:28 AM LeoNerd: avr-libc: /usr/lib/avr/include
09:28 AM Emil: I wonder if I could install a backport
09:29 AM Emil: I'm not sure how my pine handles testing
09:29 AM LeoNerd: Version: 1:1.8.0+Atmel3.5.0-1
09:29 AM Emil: wtf, that's older than mine :D
09:29 AM Emil: or is it
09:30 AM LeoNerd: 1.8.0 + Atmel3.5.0.. the +atmel part is significant perhas
09:30 AM Emil: #define __AVR_LIBC_VERSION_STRING__ "1.8.0svn"
09:30 AM Emil: LeoNerd: highly likely
09:30 AM Emil: It's super annoying since the libc is actually on version 2 upstream
09:31 AM LeoNerd: It's a slight shame that the abstract-C library parts and the concrete machine-level register definition parts have to be so closely linked :/
10:05 AM rue_house changed topic of #avr to: 8 bit atmel microcontrollers ...and stm32?... http://wormfood.net/avrbaudcalc.php http://www.engbedded.com/fusecalc/
01:44 PM JanC is now known as Guest19040
02:06 PM polprog: i got a domain!
02:28 PM Emil: polprog: ooooh
02:28 PM Emil: share it
02:28 PM Emil: So I was checking pcb prices on itead
02:29 PM Emil: Because you know the recent Hackaday "article" about that 8x8x8 led cube
02:29 PM Emil: I might as well try to one up it
02:30 PM Emil: or rather just make one quicker ":D"
02:30 PM Emil: So those pcb prices
02:31 PM Emil: 1x1cm pcb times 600 only costs fucking 55e shipped :D
02:32 PM kre10s: use fischer leiterplatten. sometimes they will fill the rest of thier nutzen with small pcb. and send you the extras for free.
02:34 PM Emil: Do you have experience with them?
02:35 PM kre10s: I do. they are pretty good. although using their online calculator 10x10mm @ 600 is ~100EUR
02:37 PM kre10s: what fab quoted you 55e?
02:39 PM polprog: kre10s: can you share a link?
02:39 PM polprog: http://polprog.net Emil:
02:39 PM Tom_L: duh
02:43 PM kre10s: http://www.fischer-leiterplatten.de/online-kalkulator.htm
02:43 PM polprog: thanks
02:44 PM polprog: down to 3 working days, cool
02:44 PM polprog: pricing is... fair
02:45 PM kre10s: Is such a speed really necessary?
02:45 PM polprog: no
02:45 PM polprog: but its nice that they can
02:46 PM polprog: my millhouse makes a 2-sided pcb with soldermask in 7 working days
02:46 PM kre10s: I always select 15 days. The still delivered in 3 once regardless.
02:46 PM polprog: that's even better :P
03:10 PM Emil: polprog: did you make that site yourself?
03:10 PM Emil: polprog: also add favicon
03:13 PM Emil: kre10s: if you have a contact at that site, can you ask them to provide a translation for the order and calculator page?
03:13 PM Emil: atleast
03:39 PM polprog: Emil: yeah, its put together by me. i'll ad the favicon later
03:39 PM polprog: defi itely gonna add stuff
03:40 PM Emil: looks pretty nice, mate!
03:41 PM polprog: thanks :) ill install wordpress in a subdirectory or a separate server with subdomailn and have a small blog
03:41 PM Emil: >wordpress
03:41 PM Emil: pls no
03:41 PM polprog: but i already know it
03:41 PM Emil: polprog: if you want a thing that handles your blog
03:42 PM Emil: try jekyll or something
03:42 PM polprog: il see
04:39 PM enhering: Hi. Good night.
04:44 PM julius: hi
04:45 PM julius: ive got a rtc clock that is sending data via i2c running here, can i now attach a oled display with oled sad -> atmega sda and oled sdc -> atmega sdc ? both sda and sdc got a 4.7k resistor to ground
04:46 PM julius: i mean, they should work on the same "bus"
04:49 PM Emil: to ground?
04:49 PM Emil: no vcc
04:49 PM Emil: ?
04:49 PM Emil: they are pullups, mate :D
04:49 PM Emil: not pulldowns
04:50 PM Emil: julius: but yes, as long as you don't have address collisions you can put them (and that's the design of i2c) onto the same bus
05:08 PM julius: ah, might have confused that
05:13 PM julius: oh how i love people that put code out their that does compile with ~15 errors
05:16 PM Emil: hehe
05:16 PM Emil: Well
05:16 PM Emil: I mean
05:17 PM Emil: -Wall can be annoying if you must rely on shit libs
05:17 PM Emil: Personally it is -Wall -Werror
05:19 PM Emil: Or go home
05:19 PM Emil: also -Wvla
05:19 PM Emil: and um
05:21 PM Emil: yeah -Wall.-Werror -Wvlaa
05:21 PM Emil: though the last one is optional since it is a compiler supported feature that is useful
05:21 PM Emil: because it operates on stack
05:38 PM wirts-leg: i like being able to program the 328p directly with a parallel port cable
05:39 PM Emil: kool
05:40 PM wirts-leg: i can't afford one of the fancy dedicated programmers, but i have a lot of old computers to work with.
05:43 PM wirts-leg: there are some instances where I need much more RAM. audio processing for example. but not necessarily heavy on program code. any cheap replacement that may be better suited than a 328p?
05:46 PM NoHitWonder^: i dont know direct replacement, but atmega1284 is a good chip, lots of ram
05:47 PM NoHitWonder^: and you can get it in dip package which is always nice
05:48 PM NoHitWonder^: it also has dual uart, which is nice if your doing midi stuff
05:48 PM wirts-leg: that seems like it would do nicely
06:05 PM wirts-leg: i like how it's called bit banging
06:16 PM kre10s: polprog: your site has two flashing cursors... also. why have a flashing cursor when you can't type anything?
06:23 PM Tom_L: to make you wonder why
09:04 PM Tachaway is now known as Tachawai
11:59 PM day_ is now known as daey