#avr | Logs for 2015-01-25

Back
[00:04:26] <anonnumberanon> Lambda-Aurigae, I made a DC constant voltage power supply the other day. It was very fun experimenting with RC filter setups for the output.
[00:05:27] <anonnumberanon> I want to use transistors for my own projects because all I've ever done with them was deriving their equations in class and doing a few labs with them (I don't even remember physically doing it).
[05:46:37] <t4nk704> hi, where can I find a circuit example how to share a interrupt? if i connect a output pin of a device to pind3 and int0 parallelly the input will not be triggered
[05:48:34] <RikusW> on which avr is that ?
[05:49:41] <t4nk704> atmega32
[05:52:12] <RikusW> so you connect d3 and d2 ?
[05:52:13] <t4nk704> when i turn on the pullup resistors, int0 has a level of approx. 3v and pind3 has a level of 1.7v.. i think int0 will then be pulled low by pin3.. it's a falling edge interrupt
[05:52:21] <t4nk704> yes
[05:52:44] <t4nk704> i need 3 interrupt so i wanted to poll in the isr
[05:53:03] <RikusW> poll in isr ?! bad idea
[05:53:27] <RikusW> an isr should contain the minimum of code
[05:53:38] <RikusW> and run fairly quickly
[05:54:12] <t4nk704> hmm.. is there a solution how to have 3 interrupts on an atmega32?
[05:54:21] <t4nk704> i need falling edge interrupts
[05:55:34] <RikusW> just configure the MCUCR ISC bits for falling edge
[05:55:51] <t4nk704> yes i have done that
[05:56:14] <RikusW> why do you want to connect d2 and d3 ?
[05:56:34] <t4nk862> sorry. discconneted
[05:56:41] <RikusW> why do you want to connect d2 and d3 ?
[05:57:12] <RikusW> any one of them should be enough ?
[05:58:41] <RikusW> did you configure GICR and SREG I bit ?
[05:59:10] <t4nk862> look, I have a magnetic stripe reader which can read all three tracks. It is self clocking and provides a clock signal for each track. I have to have an interrupt for each of these three clock signals so I know when I can pull the data bits. Because my atmega32 has only INT0 for falling edge interrupts I thought I can connect all three clock signlas to int0 and also to pd3, pd4, pd5. When the interrupt is trigged i wanted to look in the
[05:59:15] <t4nk862> triggered the interrupt
[05:59:25] <t4nk862> RikusW: I hope this is understandable
[06:00:16] <t4nk862> If you know a better solution go ahead :)
[06:01:00] <RikusW> ah
[06:02:01] <RikusW> at what kind of frequency will that be ? < 100Hz ?
[06:02:06] <RikusW> maybe 1kHz ?
[06:02:28] <t4nk862> the reader is very slow
[06:02:55] <t4nk862> < 100hz definately
[06:03:25] <RikusW> you could use plain polling with no interrupts
[06:03:44] <RikusW> and it seems INT 0 1 2 can all have falling edge on the mega32
[06:04:15] <RikusW> read the external interrupts chapter in the mega32 datasheet
[06:04:54] <t4nk862> really? that'd be cool.
[06:05:05] <RikusW> yep, it seems so
[06:05:42] <RikusW> is the clock embedded in the data ?
[06:05:54] <RikusW> which kind of signalling is used ?
[06:06:02] <t4nk862> nope. the data has different lines for each track
[06:06:13] <RikusW> so 6 tracks then ?
[06:06:19] <t4nk862> 6 lines
[06:06:26] <RikusW> ah
[06:06:29] <t4nk862> 2 for each track (data and lcokc)
[06:07:13] <RikusW> how likely is it that the clock pulses are simultaneous ?
[06:07:20] <RikusW> on the 3 lines that is
[06:08:39] <t4nk862> well not really likely. i haven't seen that case yet with my oscilloscope
[06:09:32] <RikusW> good, otherwise one int might be running when the other is triggered
[06:09:48] <RikusW> but do keep the isr code as short as possible
[06:09:56] <t4nk862> well one pulse is 20us long
[06:10:04] <t4nk862> i think there is enough time to poll each one
[06:10:13] <t4nk862> or do you disagree
[06:10:18] <t4nk862> the atmega runs with 16mhz
[06:11:18] <t4nk862> it's even a bit more
[06:12:17] <RikusW> thats 320 clocks per pulse, should be enough
[06:12:37] <t4nk862> ok thank you RikusW. Lunch time now :) have a nice day!
[06:12:52] <RikusW> good luck
[09:44:12] <anonnumberanon> How much ram does atmega328 have?
[09:44:42] <anonnumberanon> Looking at using lookup tables and how you can trade off memory for execution speed.
[09:44:52] <RikusW> 2k
[09:45:13] <RikusW> lookup can be in flash
[09:50:15] <anonnumberanon> I'm not sure which one that is, it's not the memory that also contains the program itself, is it?
[09:50:42] <specing> thats flash
[09:50:48] <anonnumberanon> oky
[09:52:34] <RikusW> 328 got 2k ram and 32k flash
[09:53:06] <RikusW> it cannot execute from ram, only flash, since it is Harvard architecture
[09:56:55] <Lambda-Aurigae> http://www.nongnu.org/avr-libc/user-manual/group__avr__pgmspace.html
[09:56:58] <Lambda-Aurigae> there ya go anonnumberanon
[09:57:03] <Lambda-Aurigae> program space utilities.
[10:00:02] <anonnumberanon> neat thanks
[10:00:22] <Lambda-Aurigae> also that has all the avr-libc reference nearby.
[10:05:13] <Lambda-Aurigae> http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&ved=0CDYQFjAC&url=http%3A%2F%2Fwww.teslabs.com%2Fopenplayer%2Fdocs%2Fdocs%2Fprognotes%2FProgmem%2520Tutorial.pdf&ei=Nw_FVMXsE9GlyATF_4HADQ&usg=AFQjCNGj9E1cWM77nWX9vGBzvWDTXUPy2Q&bvm=bv.84349003,d.aWw
[10:05:16] <Lambda-Aurigae> hmm.
[10:05:19] <Lambda-Aurigae> that don't work so well.
[10:06:41] <Lambda-Aurigae> http://www.teslabs.com/openplayer/docs/docs/prognotes/Progmem%20Tutorial.pdf
[10:06:43] <Lambda-Aurigae> much better
[10:06:52] <Lambda-Aurigae> nice tutorial on progmem stuff
[10:07:13] <Lambda-Aurigae> by our own Dean Camera,,,aka abcminiuser
[10:08:05] <Lambda-Aurigae> http://www.teslabs.com/openplayer/docs/docs/prognotes/
[10:08:06] <anonnumberanon> I did this as my first arduino project a few days ago: https://vid.me/rPcW
[10:08:12] <Lambda-Aurigae> and some other stuff that might be helpful.
[10:08:44] <anonnumberanon> okay I gotta go to my mom's house for Sunday lunch, bbl
[10:08:54] <anonnumberanon> Thanks for all these.
[10:17:13] <Jartza> https://github.com/Jartza/attiny-uart-test
[10:17:35] <Jartza> ...if for some strange reason someone wants to look at interrupt-based tx-only uart
[10:17:42] <Jartza> 460800bps @ 16MHz clock
[10:17:50] <Jartza> 230400bps @ 8Mhz clock
[10:19:00] <Jartza> that was my exercise for avr asm
[10:27:07] <specing> Jartza: why push registers?
[10:27:15] <specing> just globably reserve one or two
[10:49:15] <Jartza> specing: because I wanted it to work with interrupts and 460800bps :)
[10:49:22] <Jartza> not enough cycles left
[10:49:35] <Jartza> oh sorry
[10:49:42] <Jartza> understood incorrectly
[10:50:10] <Jartza> or read in haste... though you asked why gpior :D
[10:56:07] <Jartza> specing: well, I lived in an understanding, that only registers r2-r15 could be reserved and registers <r16 can't be used with "immediate" commands
[10:56:42] <Lambda-Aurigae> reserved only applies to using C or C++ compiler.
[10:57:00] <Jartza> well, that's C, only the ISR is written in asm
[10:57:21] <Jartza> it's true that if I could reserve the register, I wouldn't need the push & pop
[10:57:27] <Lambda-Aurigae> if you are writing your code entirely in assembly there is no reserved or not in registers..only what you use.
[10:57:35] <Lambda-Aurigae> aahh.
[10:59:36] <Jartza> well. I tried reserving the r18... "warning: call-clobbered register used for global register variable"
[11:00:06] <Lambda-Aurigae> yeah..if you are doing it with any C then you are kinda screwed there.
[11:00:32] <Jartza> well I'm not
[11:00:37] <Jartza> I just use the push & pop
[11:00:47] <Jartza> like the code already does
[11:01:09] <Lambda-Aurigae> but your main program is C so it overrides things nastily.
[11:01:15] <Jartza> yes
[11:01:21] <Jartza> but I'm only using one register :)
[11:01:28] <Jartza> and pushing that
[11:01:35] <Jartza> and also saving the SREG
[11:01:43] <Lambda-Aurigae> probably a good idea.
[11:02:03] <Jartza> the ISR is here: https://github.com/Jartza/attiny-uart-test/blob/master/uart.S
[11:12:20] <malinus_> Guys don't inline asm, in general
[11:12:54] <twnqx> only girls do?
[11:12:57] <twnqx> sounds weird.
[11:14:13] <malinus_> girls are immune to asm anyway
[11:18:26] <Jartza> well.
[11:18:40] <Jartza> that was just a test anyway, and part of my avr-asm learning
[11:18:55] <hypermagic> hey
[11:19:03] <hypermagic> i'm currently hacking a server psu
[11:22:28] <Lambda-Aurigae> that's nice.
[11:22:55] <Lambda-Aurigae> time for a shower here..gotta go to town today.
[11:23:08] <Tom_L> impress the masses
[11:27:36] <hypermagic> take it apart, take a look: fuuuuu
[11:29:13] <hypermagic> full of stuff
[11:29:44] <hypermagic> it has 2 psus inside
[11:29:54] <hypermagic> redundant, with pfc
[11:31:31] <hypermagic> now where is that fkin ps on signal
[11:37:31] <hypermagic> i think i got it
[11:58:24] <Shavik> Morning all. So I'm looking at the datasheet for the sn74hc595 (8 bit parallel out shift register) and it has a 35mA value for Continous output current but 70mA listed for "Continous current through VCC or GND"
[11:58:28] <Shavik> How do those differ?
[12:00:38] <Fleck> Shavik: one pin can hold 35mA max, all toghether 70mA max would be my guess
[12:01:57] <Shavik> So if I'm looking to drive 6 LED's I'd need to choose resistors for those LED's that would limit them all combined to under 70mA (~11.67 mA per LED - some for safety margin, as to not run at the iC maximums)
[12:01:59] <hypermagic> vcc bond wire can take 70mA
[12:02:06] <hypermagic> all others 35
[12:02:19] <hypermagic> what is not clear in this?
[12:02:30] <Shavik> Just making sure I understand it fully
[12:02:41] <Shavik> Thanks for the infor
[12:02:51] <hypermagic> 8x11mA is out of spec already...
[12:02:58] <Shavik> I mentioned 6
[12:02:59] <Fleck> yeah :)
[12:03:16] <Fleck> for 6 it's ok
[12:03:31] <hypermagic> but i think it will be limited by rds_on anyawy
[12:03:42] <hypermagic> even if you do not use a resistor
[12:04:16] <Shavik> rds_on?
[12:04:52] <Shavik> nevermind. had to google rds(on)
[12:44:05] <hypermagic> cmos ics has tiny output mosfets ...
[13:00:50] <malinus> Shavik: just don't let your avr sink/source it
[13:01:38] <Shavik> malinus: I was gonna drive the sn74hc595 via my avr
[13:01:45] <Shavik> But i have an external power source
[13:01:52] <Shavik> 500mA SMPS
[13:03:28] <malinus> What does "driving via my avr" mean? As long as you are under the source/drain max for each pin, port and in total, then you are fine.
[13:05:20] <Shavik> Yea, I get that now :)
[14:19:01] <hetii> Hi :)
[14:19:20] <hetii> I found nice GPL tool called espeak: http://espeak.sourceforge.net
[14:19:43] <hetii> It works very nice and wonder if its possible to strip it down to run in avrs.
[14:20:21] <hetii> espeak-data we could store in spi flash
[14:44:15] <malinus> hetii: no need for that
[14:44:37] <malinus> there is like this 2kb asm implementation of a simple text to speech
[14:44:48] <malinus> somebody already linked in on here once
[14:45:07] <malinus> Obviously it's probably not as fancy as this one. But people had it running on avrs
[14:46:39] <hetii> hmm
[14:48:36] <Lambda-Aurigae> heck, we had text to speech chip for the c64 back in,,,1985...maybe earlier.
[14:48:58] <hetii> yes I know, it was called SAM
[14:49:13] <malinus> ah yes
[14:49:16] <malinus> that's the one!
[14:49:37] <Lambda-Aurigae> aaand I know of at least one emergency broadcast station that still uses one.
[14:49:38] <hetii> you can get some port of it from my repo: https://bitbucket.org/hetii/s.a.m
[14:49:56] <malinus> ah yes
[14:50:03] <malinus> maybe it was you who talked about it hetii
[14:50:08] <malinus> haha
[14:50:49] <hetii> you can test it even online: http://simulationcorner.net/index.php?page=sam
[14:51:26] <Lambda-Aurigae> I remember having one from radio shack that I hooked to an eprom(uv erasable kind) that I had programmed from my c64.
[14:52:19] <hetii> malinus: but its not in ASM :)
[14:52:45] <malinus> it isn't. Funny, I probably just sam->asm in my mind
[14:52:47] <hetii> I know that author of this revrse enginering code did or plan to do some port for arduino
[14:55:16] <malinus> Sounds like a fun project
[14:55:23] <malinus> go do it :D
[15:03:51] <Casper> hetii: :D thanks for espeak, that may help me in one of my projects
[15:04:01] <Casper> on pc
[15:04:10] <Casper> ... if I can find out how to make it work
[15:07:51] <Lambda-Aurigae> wish I had the technology from Kurzweil Voice from 1994.
[15:08:12] <Lambda-Aurigae> on a 66MHz 486 we had 60000 word voice recognition dictionary.
[15:10:38] <malinus> hehe
[15:11:03] <Lambda-Aurigae> it did use a custom audio input/processing board.
[15:11:06] <Lambda-Aurigae> but still,,,
[15:14:44] <Lambda-Aurigae> it was a full length AT board full of all kinds of discreet chips.
[15:36:33] <tpw_rules> discrete*
[15:37:46] <Lambda-Aurigae> that too.
[15:37:59] * Lambda-Aurigae updates ye olde dictionary entries.
[15:41:57] <Lambda-Aurigae> I'm sure the discrete chips were very discreet...they never did tell me their secrets after all.
[16:09:31] <hetii> Casper: you welcome ;) you need to go into src directory and type make, then espeak will be build
[16:09:55] <hetii> Casper: or you can use packet manager like apt-get or yum to install it from repository
[16:10:21] <hetii> Lambda-Aurigae: you mean board to speak or to recognize voice ?
[16:10:53] <Casper> hetii: it is built (didn't knew I have it on my system)
[16:11:00] <Casper> but do nothing (linux, not avr)
[16:11:29] <Lambda-Aurigae> hetii, it was a 16bit ISA board that the microphone connected to...you spoke into the mic, the board did some kind of pre-processing, and the cpu handled the next stage.
[16:11:47] <hetii> cool stuff :)
[16:11:51] <Lambda-Aurigae> it was.
[16:12:16] <Lambda-Aurigae> with 16MB of ram it would do 60000 word recognition out of the box.
[16:12:34] <hetii> hmm I see, but general its not easy topic even this day to recognize speach in real enviroment
[16:12:46] <Lambda-Aurigae> nono...with 16MB of ram it did 30000 words...32MB was needed for 60000 words.
[16:12:48] <Lambda-Aurigae> and it learned.
[16:13:01] <Lambda-Aurigae> the more you used it the better it got at recognizing your voice.
[16:13:34] <hetii> What was used as a core for recognision ?
[16:13:44] <malinus> hetii: did you make espeak?
[16:13:50] <Lambda-Aurigae> there was a program that ran on windows.
[16:14:06] <Lambda-Aurigae> and a database on the harddrive but it didn't hit that very hard.
[16:14:20] <Lambda-Aurigae> it ran from ram.
[16:14:26] <hetii> malinus: I use it with succeess from repository and also build from sources and both works fine
[16:14:36] <Lambda-Aurigae> it was an awesome technology.
[16:14:56] <hetii> Lambda-Aurigae: ok but how you match word to text ?
[16:15:04] <hetii> you some FFT compare the wave
[16:15:05] <malinus> hetii: but did you make it?
[16:15:18] <Lambda-Aurigae> it had the thing pre-matched somehow....ask Kurzweil.
[16:15:19] <hetii> malinus: no, i`m not a author of this code
[16:15:41] <Lambda-Aurigae> dragon naturally speaking bought that technology and they do it now without the special audio input card.
[16:16:21] <Lambda-Aurigae> you could also train it to recognize non-word sounds...
[16:16:37] <Lambda-Aurigae> we had a guy who could grunt and whistle but barely move his hands and he couldn't speak.
[16:17:17] <Lambda-Aurigae> but we helped him train it to use mouse to type on a virtual keyboard with it by whistling in different tones and grunting.
[16:18:06] <hetii> So suppose they could use FFT somehow to do the job
[16:18:10] <hetii> like here: https://befinitiv.wordpress.com/2012/04/01/control-your-home-devices-by-whistling/
[16:18:13] <Lambda-Aurigae> I suppose.
[16:18:24] <Lambda-Aurigae> I don't have the knowledge of FFT to know one way or the other.
[16:26:57] <hetii> yep, I have also limited knowlagde about DSP in fact :(
[16:27:28] <Lambda-Aurigae> one of the many things I would love to learn.
[16:27:49] <Lambda-Aurigae> did a little reading on the subject but found it a bit above me in the math section.
[16:58:35] <Lambda-Aurigae> ok..need a new project for the kids this summer.
[17:05:39] <hetii> huh I try teach my girl a bit programming in python...
[17:05:48] <Lambda-Aurigae> I'm sorry
[17:06:28] <Lambda-Aurigae> I teach 10 to 16 year olds microcontroller programming using AVRs and C,,and those who can understand it we go to ASM as well.
[17:08:02] <hetii> have you some girl in this group?
[17:08:10] <Lambda-Aurigae> usually I have 3 to 6 kids each summer who come visit every couple weeks.
[17:08:12] <Lambda-Aurigae> yes
[17:08:17] <Lambda-Aurigae> girls and boys both.
[17:08:34] <Lambda-Aurigae> what I'm teaching them is more than just programming microcontrollers though. I teach them to learn.
[17:09:08] <Lambda-Aurigae> and to enjoy learning.
[17:09:26] <hetii> yep, I try the same with her but she is not able understand what "variable" means...
[17:09:34] <hetii> so its a bit painful way
[17:09:45] <Lambda-Aurigae> how old is she?
[17:09:59] <hetii> 28
[17:10:05] <Lambda-Aurigae> hmmm.
[17:10:25] <Lambda-Aurigae> didn't do so well in math in school I would think?
[17:10:38] <hetii> no clue
[17:10:39] <hetii> ...
[17:10:54] <hetii> or pure imagination
[17:11:17] <Lambda-Aurigae> a variable is like a glass...you can put different things in it. water, milk, oil.
[17:11:24] <Lambda-Aurigae> with different amounts.
[17:11:35] <Lambda-Aurigae> so, imagine a glass that can only hold one kind of substance.
[17:11:37] <Lambda-Aurigae> a milk glass
[17:11:41] <Lambda-Aurigae> and a juice glass
[17:11:52] <hetii> ok need to try explain in that way :)
[17:12:19] <Lambda-Aurigae> different glasses are different sizes....like different variables can hold different amounts of data..
[17:12:35] <Lambda-Aurigae> an 8bit unsigned int is a 1 cup glass.
[17:12:47] <hetii> hehe
[17:12:49] <Lambda-Aurigae> a 32 bit unsigned int is a pool sized glass.
[17:13:17] <hetii> we start with python so she no need to worry about types
[17:13:24] <Lambda-Aurigae> don't!
[17:13:27] <Lambda-Aurigae> please don't!
[17:13:38] <Lambda-Aurigae> you do that and you will ruin her.
[17:13:57] <Lambda-Aurigae> although, a python variable is more like a regular glass that can hold any liquid(data)
[17:14:03] <Lambda-Aurigae> so the analogy is closer.
[17:14:16] <Lambda-Aurigae> I would teach BASIC before python.
[17:15:55] <hetii> hmm maybe you are right
[17:16:13] <Lambda-Aurigae> bit math is just different glasses...8 bits,,8 glasses, each one twice the size of the one before.
[17:16:24] <Lambda-Aurigae> you can have a glass either empty or full.
[17:16:32] <Lambda-Aurigae> then add the contents all together to get the total.
[17:18:36] <Lambda-Aurigae> and all 8 glasses together make one big variable.
[17:34:46] <hetii> OK time for me today, have feeling that she get this now :)
[17:34:55] <hetii> have a good day/night :)
[17:35:00] <Lambda-Aurigae> party hard
[17:44:39] <malinus> Lambda-Aurigae: hehe nice
[17:44:58] <Lambda-Aurigae> malinus, thanks...gotta come up with unique teaching methods sometimes.
[17:45:19] <Lambda-Aurigae> I just came up with that analogy on the fly.
[23:07:20] <slidercrank> what software do you use to design schematics in Linux? gEDA/gschem misses a lot of symbols
[23:08:04] <slidercrank> For example, I want to add an ADT75 sensor to my schmatics and this chip is absent in the library. What shall I do?
[23:11:12] <Casper> make it?
[23:11:31] <Casper> I personally use eagle
[23:32:41] <hackvana> slidercrank: Many people use KiCad
[23:33:01] <hackvana> If you like gEDA because it's free software, then KiCad is also open source.
[23:33:16] <slidercrank> I'm on Gnome.
[23:33:21] <hackvana> Good
[23:33:28] <hackvana> slidercrank: Lots of people talking PCBs in #hackvana....
[23:34:23] <slidercrank> hackvana, are you the guy who manufactures pcbs in China?
[23:35:06] <hackvana> The PCBs I supply are made in China, yes. Shenzhen is the capital of the electronics universe.
[23:35:59] <slidercrank> I think we've talked before :) maybe a year ago
[23:36:11] <hackvana> Could well be :-)
[23:49:52] <anonnumberanon> hI.