#avr | Logs for 2013-01-26

Back
[01:25:30] <inflex> 0xCAFEBABE
[01:57:18] <Brittany> Is anyone here aware of a 32bit microcontroller in a DIP package?
[02:02:53] <theBear> hmmm..... oh, microcontroller, definately not, not to say one doesn't exist, i'd be surprised tho
[02:03:07] <theBear> i can think of a bunch of 16bit cpus
[02:03:19] <Xark> Brittany: Sure, PIC32 (or some NXP ARM).
[02:03:41] * Xark has both...
[02:05:11] <theBear> seriously, arm in dip ? that's kinda cool
[02:06:39] <Xark> Yep. Check out http://dangerousprototypes.com/2011/11/10/new-microchip-pic32-chips-in-dip-packages/ and http://hackaday.com/2012/09/09/the-easiest-way-to-dive-in-to-arm-programming/
[02:07:00] <theBear> heh, due to personal preference, i'l just check the 2nd one
[02:07:28] <Brittany> holy carp
[02:07:30] <theBear> that is mindblowingly cool
[02:07:39] <Xark> theBear: Well, Microchip PIC sucks, but PIC is really MIPS32 and is pretty nice (the licensed it). :)
[02:07:45] <Xark> er, PIC32
[02:08:06] <theBear> hmm, i do like mips, but i find it hard to forgive them for the past 20 years or so
[02:08:13] <theBear> basic stamp ffs
[02:08:16] <Xark> PCI32 is 80Mhz (not bad). They have USB enabled chips too.
[02:09:01] <theBear> kinda like how i just can't trust farnells since an overnight surprise namechange (yeah, they sent an email a couple months before saying get ready for a surprise, hardly prepares you for a trusted brand completely disappearing overnight)
[02:09:09] <Xark> theBear: Yeah. I am not a big Microchip fan (and avoided BS), but I do like MIPS architecture (and until NXP it was only DIP 32 bit MCU).
[02:09:20] <Brittany> Perfect. http://uk.mouser.com/Search/ProductDetail.aspx?R=LPC1114FN28%2f102%2c12virtualkey99990000virtualkey771-LPC1114FN28%2f1021
[02:09:22] <Brittany> thank you :)
[02:09:32] <Xark> Brittany: No problem. :)
[02:45:58] <Grievar> So I have an ARM device running linux as the master on an I2C/TWI bus where all the slaves are ATMega328s
[02:46:12] <Grievar> and I recently did some stuff, and now when I scan the i2c bus I get garbage sometimes
[02:46:22] <Grievar> e.g. all of the addresses appear present, or none of them
[02:46:45] <Grievar> could this /possibly/ becaused by a software bug or is it much more likely noise/bad termination/other hardware issue?
[03:58:32] <Timelord83> anyone here ever make their own Mega2560?
[04:00:23] <inflex> O_o
[04:00:33] <inflex> I don't think anyone other than a chip foundry can do that
[04:00:40] <Timelord83> i don't mean the chip
[04:01:00] <Timelord83> I meant the Ardunio MEGA 2560 assembly
[04:02:07] <Xark> Timelord83: Not breadboard friendly. I have only done its little brother 1280 (still a powerful AVR and 40 pin DIP). :)
[04:02:26] <Timelord83> i found the Eagle files for it on the arduino website
[04:02:33] <Timelord83> and sent them out for a quote
[04:02:39] <Timelord83> see how much they will charge me for the PCB
[04:04:10] <OndraSter_> huh
[04:04:13] <OndraSter_> why do that?
[04:06:12] <Xark> Timelord83: Sounds questionable. However, there are some nice assembled boards for around $40 (like Seeedduino or Freaduino).
[04:06:20] <OndraSter_> even less on ebay
[04:06:59] <OndraSter_> also arduino mega2560 is nothing :P
[04:08:32] <Timelord83> ya its for a project. and for driving a 3d printer i need nothing more than a mega2560
[06:18:04] <_abc_> so, anyone *else* here with horror stories about 32.768kHz xtals not working right on atmegas because of dodgy ceramic caps?
[06:18:41] <_abc_> I had all sorts of crap problems yesterday, and they are gone simply by changing the supposedly NP0 caps with known to be good other make NP0 caps
[06:20:24] <OndraSter_> eh
[06:21:08] <_abc_> I am not kidding, +700ppm deviation
[06:21:30] <OndraSter_> wow
[06:21:48] <OndraSter_> where were the caps from
[06:21:58] <_abc_> my usual supplier, one of them. tme.eu
[06:23:16] <_abc_> morale: never, ever use anything but C0G or NP0 from known good batch/maker for xtal caps on any mcu, at any frequency
[06:38:57] <GuShH> _abc_: I tend to avoid ceramics by all means.
[06:39:07] <GuShH> any "buyable" grade.
[06:40:48] <_abc_> hi GuShH
[06:41:13] <_abc_> ceramics are fine but you need to be careful since 'new and cheapel ploducts' have invaded the market
[06:41:41] <_abc_> My ceramics I had trouble with were reputed to be C0G or NP0, but the good ones are from AVX and the bad ones are from ???
[06:41:47] <_abc_> both bought from the same dristri
[06:42:00] <_abc_> the AVX ones are 10 cents each the other ones 3 cents.
[06:43:10] <_abc_> note that I used the 3 cent ones by the bucketfull before, but not with 32768Hz xtals at low power
[07:00:37] <GuShH> _abc_: those 3 cent NP0 are also sold as temperature sensors? :p
[07:01:36] <_abc_> GuShH: no, but I suspect they resonate mechanically or something. I have no other explanation
[07:01:50] <_abc_> They are also larger, I thought they would have lower leakage due to higher voltage
[07:01:53] <GuShH> how about they are not actually NP0
[07:02:06] <_abc_> i.e. 100V instead of 25V or 50V for the good ones
[07:02:11] <GuShH> China...
[07:02:15] <_abc_> GuShH: black dot and it says NP0 in the bag
[07:02:25] <_abc_> and yes, they will plint whatevel you want on the bag
[07:02:39] <GuShH> they can black dot it for you for an extra half a cent.
[07:02:41] <GuShH> :p
[07:03:00] <_abc_> fortunately I did not use a Lolex brand watch to calibrate the clock against otherwise I would still be working at it :)
[07:04:39] <GuShH> It's true, the chinese watches are not to be trusted!
[07:06:58] <GuShH> Sadly, some relatively expensive wrist watches come with chinese insides these days
[07:07:29] <GuShH> 3-4 seconds off per day, the self-winding type.
[07:08:30] <Steffanx> Poor GuShH
[07:08:39] <GuShH> Steffanx: why?
[07:08:51] <GuShH> I don't have any self-winding watch.
[07:28:53] <creep> ceramic x5r dielectric is like -20+50% and has some bad tempco, not really for ultraprecision oscillators.
[07:28:58] <creep> i use them all the time.
[07:29:38] <creep> x7r is better, but still has bad tempco, so npo is for precise applications
[07:30:00] <GuShH> asbestos is cancerigenous, not really good for ya.... I snort it all the time.
[07:30:10] <GuShH> cancerogenous*
[07:30:13] <creep> i thought so :)
[07:30:20] <GuShH> creep: no, I'm just mocking you.
[07:30:20] <creep> you will die painfully in cancer ;)
[07:30:41] <GuShH> you claim a fact of something that's known to be bad, then you admit to use it all the time.
[07:31:14] <creep> because i don't give shit about worse tempco
[07:31:16] <GuShH> I doubt _abc_ needs a cheap lecture on the subject either
[07:31:35] <GuShH> creep: speaking of shit, do you want my coffee?
[07:32:04] <creep> do i look like a giant bug?
[07:32:17] <GuShH> Yeah, one that's hard to find.
[07:32:24] <GuShH> You know, the annoying type of bug.
[07:32:51] <RikusW> GuShH: carcinogenic
[07:33:08] <GuShH> RikusW: don't make me get the dictionary
[07:33:11] <_abc_> http://www.theregister.co.uk/2013/01/25/github_ssh_key_snafu/ this is very cool
[07:33:17] <_abc_> for those who find the keys
[07:33:36] <_abc_> gives a whole new meaning to 'shared key cryptography'
[07:34:36] <GuShH> the spanish word I was thinking of is "cancerigeno" which ought to be "cancerogenous" and in spanish, carcinogenic would be "carcinógeno"
[07:35:06] <GuShH> no?
[07:35:21] * RikusW is not spanish ;)
[07:35:43] <creep> they spek spanish in hell you know
[07:35:50] <GuShH> Doesn't matter, if I can reference them they should exist!
[07:36:25] <GuShH> creep: at least I can speak a few languages...
[07:36:48] <GuShH> _abc_: Did you read the article about the exploding Dell laptops yet?
[07:37:00] <creep> i go only to places where they speak human languages
[07:38:03] <_abc_> GuShH: that is old news, or do they do it again?
[07:38:07] <RikusW> the li battery ?
[07:38:27] <_abc_> I do not trust brand name machines because they tend to use proprietary hardware and that leads to nonworking standard drivers in open source os'es
[07:38:45] <_abc_> RikusW: yes, Dell had a serious Li battery problem in laptops predating 787
[07:38:52] <_abc_> RikusW: Lenovo also had one afaik
[07:39:08] <RikusW> how bad was the explosions ?
[07:39:13] <_abc_> bad
[07:39:19] <_abc_> nobody died but bad
[07:39:19] <creep> it is only a few years old article
[07:39:33] <RikusW> any serious injuries ?
[07:39:34] <creep> takes time to get to places like thew middle of the desert in africa
[07:39:58] <_abc_> RikusW: no
[07:40:23] <RikusW> thats fortunate for dell
[07:40:51] <GuShH> creep: your ancestors were slaves dude. you are in no position to be racist.
[07:41:26] <creep> every engineer and advanced user knows lithium-ion and lithium-polymer are an fire and explosion hazard
[07:41:30] <GuShH> _abc_: I should check the date, sometimes the "spotlight" shows older news, at least here...
[07:41:41] <GuShH> creep: a fire, not an fire.
[07:43:11] <GuShH> yeah relatively old.
[07:43:25] <GuShH> don't trust RSS anymore.
[08:51:59] <tomatto> how can i do VU meter with avr?
[09:01:50] <_abc_> rectifier+adc+lookup table and differential thing to get the time constant right
[09:02:49] <_abc_> What spotlight GuShH ?
[09:03:00] <GuShH> on those news sites
[09:07:53] <Horologium> tomatto, first, learn how to work with and program AVR microcontrollers....second, learn how a VU meter works...third, combine the two knowledges.
[09:18:20] <tomatto> Horologium: i now all of it, but i don't know, how modify music/audio signal to connect to avr analog pin
[09:19:02] <tomatto> _abc_: what rectifier?
[09:19:08] <Horologium> how would you do it to feed it to a meter for a VU meter?
[09:19:29] <OndraSter_> GUYS! I need quick help. Where to emigrate? Today we voted our next president and we (group of many people) just want to go somewhere else. Any tips?
[09:19:41] <Horologium> Equador
[09:19:58] <Horologium> if they will take Assange they will take anyone.
[09:20:00] <OndraSter_> I was thinking new zealand
[09:20:07] <OndraSter_> or hawaii
[09:20:09] <soul-d> our country is wet cold rainy and dirty
[09:20:22] <Tom_itx> tomatto, http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=19884&start=0
[09:20:44] <OndraSter_> tomatto, active rectifier thoguh
[09:20:45] <OndraSter_> though*
[09:20:50] <OndraSter_> since regular audio is 0.7V p-p :P
[09:23:01] <tomatto> OndraSter_: what do you mean by active rectifier?
[09:24:01] <OndraSter_> something like diode + mosfet. Check internet, I have never done it
[09:24:11] <Tom_itx> tomatto, https://forum.sparkfun.com/viewtopic.php?t=10952
[09:26:07] <OndraSter_> tomatto, http://www.zemancountdown.cz/
[09:26:08] <OndraSter_> lol
[09:34:31] <yunta> OndraSter_: I've heard New Hampshire is good for libertarians, if you are one.
[09:35:32] <OndraSter_> I am
[09:36:43] <yunta> alternatively, come to finland for a year, then go back to CR.
[09:36:52] <OndraSter_> I want to go outside the europe
[09:46:28] <Tom_itx> why?
[09:47:38] <Tom_itx> move to canada
[09:48:56] <inkjetunito> sticky syrup :S
[09:51:28] <creep> go china
[10:05:10] <_abc_> see china and die
[10:05:16] <_abc_> was that not about paris?
[10:05:19] <_abc_> how times are changing
[10:30:44] <BigHugeDog> No! Never went china!
[10:30:47] <BigHugeDog> I am here!
[10:30:51] <BigHugeDog> It's bad.
[10:31:07] <OndraSter_> BigHugeDog, .. must.. not.. joke.. about.. your... nickname.. and.. china
[10:31:57] <darknite> heh
[10:35:31] <BigHugeDog> Yes. I am in China.
[10:35:35] <BigHugeDog> Yes. I am Chinese.
[10:35:48] <BigHugeDog> Yes. I want to go european.
[10:36:18] <BigHugeDog> OndraSter_: And I love avr.
[10:38:50] <OndraSter_> :)
[10:50:54] <Steffanx> Go to norway or so BigHugeDog :)
[10:51:08] <Steffanx> Or another country not part of the EU
[11:12:41] <BigHugeDog1> Steffanx: Thank you for your advice.
[15:15:12] <RifRaf> would anyone be able to give me a clue as to why i'd be getting the compile error when trying to start a servo in this code http://pastebin.com/7TwmfnQf
[15:15:49] <RifRaf> am using servo.h from webbotlibs
[15:17:21] <jacekowski> what is the error exactly?
[15:17:46] <RifRaf> gait.cpp: In function 'void appInitHardware()':
[15:17:47] <RifRaf> gait.cpp:28: error: 'servosInit' was not declared in this scope
[15:17:47] <RifRaf> make: *** [gait.o] Error 1
[15:18:26] <RifRaf> is like the command has been removed , but it seems pretty vital
[15:22:39] <RifRaf> but is documented here http://webbot.org.uk/WebbotLibDocs/object.jsp?id=27359
[15:26:49] <RifRaf> can compile if that line is commented out, and even connect from pc application, but no servos are energised or move
[15:56:56] <creep> h
[16:07:28] <mashk> Hi
[16:07:39] <mashk> I have a problem with USB ISP
[16:07:46] <mashk> avrdude is not detecting it
[16:07:48] <mashk> 03eb:c8b4
[16:11:41] <mashk> anyone around ?
[16:21:18] <_abc_> mashk: look up vid:pid to see maker
[16:22:26] <mashk> how to do that ?
[16:22:41] <mashk> lsusb displays 03eb:c8b4
[16:22:54] <_abc_> google usb vid 03eb pid c8b4
[16:23:43] <RifRaf> jacekowski got it fixed, had to setup servos in the project manager, and call them with _servo1_ instead on just servo1
[16:23:50] <_abc_> mashk: http://9xforums.com/forum/viewtopic.php?t=2162&p=31823
[16:23:58] <RifRaf> http://pastebin.com/3sLSctWb the working code
[16:24:06] <_abc_> hexapod RifRaf ?
[16:25:22] <RifRaf> _abc_ for testing yes, just a little 3 servo hexapod
[16:25:35] <_abc_> 3 servo HEXApod?
[16:25:37] <_abc_> :)
[16:26:08] <mashk> _abc_, I am readin
[16:26:58] <RifRaf> _abc_ http://www.youtube.com/watch?v=-1RKkNn50eo
[16:27:33] <RifRaf> that was one i made years ago, this one is an even older prottype
[16:27:47] <_abc_> ok
[16:27:50] * _abc_ leaves
[16:48:05] <creep> h
[18:11:22] <tomatto> hi
[18:11:26] <OndraSter> hi
[18:11:40] <tomatto> can work 16bit timer/counter as 8bit?
[18:11:48] <OndraSter> yes
[18:11:56] <OndraSter> check datasheet, it is written there
[18:12:08] <tomatto> so overflow interrupt at 256
[18:12:33] <tomatto> i am looking on it right now, but i don't see it, only pwm setting
[18:12:38] <OndraSter> there is 8bit option for (some) modes
[18:13:10] <OndraSter> so set CTC mode, load OCRxA with 0xFF
[18:13:16] <OndraSter> ;)
[18:19:39] <tomatto> ok
[18:20:48] <tomatto> how can i set for two interrupts same behavior?
[18:24:00] <OndraSter> search for alias
[18:35:56] <tomatto> can someone help me with rewriting AVR400 appnote from asm to C ?
[18:36:51] <OndraSter> you have got an AVR without ADC?
[18:38:03] <tomatto> yes, attiny2313
[18:38:45] <OndraSter> well
[18:40:20] <OndraSter> I don't have the code
[18:40:41] <OndraSter> there is nothing weird about it though - just set few registers
[18:40:42] <OndraSter> and read them later.
[18:41:09] <OndraSter> I would TBH choose a different method how to do it (again, using analog comparator and timer - but with PWM output)
[18:41:12] <OndraSter> I am off
[18:41:13] <OndraSter> to sleepy
[18:41:13] <OndraSter> gn
[18:41:53] <tomatto> OndraSter: with PWM, how?
[18:42:05] <tomatto> and why
[18:43:03] <tomatto> OndraSter: i don't really understand that delay loop1
[18:55:23] <creep> http://electronics-diy.com/50MHz_Frequency_Meter_Counter.php
[18:56:01] <creep> what is this ? 60MHz frequency counting using a 4MHz quartz and a pic without a divider ? ;/
[19:09:34] <tomatto> creep: http://electronics-diy.com/schematics/MC12080-prescaler.jpg
[19:09:43] <creep> i saw that
[19:10:03] <creep> but the schematic is without the prescaler, and the picture also
[19:10:10] <tomatto> so it looks like, it is necessery to use it
[19:10:19] <tomatto> yeah, weird
[19:10:21] <creep> the author states that stuff measures 60MHz withut the rescaler
[19:11:01] <tomatto> may be same magic with that "resonant" circuit on the input
[19:11:14] <creep> and since that pic will never work on 60MHz i think its probably magic
[19:11:27] <creep> also a pic is not even 1MIPS at 1MHz
[19:12:15] <creep> haha, i foubt it that bf199 and a feed coil and a series resistor will make magic
[19:12:19] <creep> d
[19:13:39] <tomatto> how can i use alias for interrupt, when i want to compile gcc said error: 'asm' undeclared (first use in this function)
[19:13:54] <tomatto> but there isn't any asm
[19:15:41] <Horologium> tomatto, maybe some kind of differential measurement between pins 3 and 4?
[19:15:52] <Horologium> as far as that 50mhz freq counter goes.
[19:16:54] <tomatto> Horologium: what can be differential about single frequency input?
[19:17:48] <creep> hmm
[19:18:35] <creep> hmm
[19:18:36] <Horologium> tomatto, they have a coil on one of the inputs..
[19:18:44] <Horologium> bit of a delay line perhaps.
[19:18:57] <creep> voltage divider R and L ?
[19:19:15] <tomatto> Horologium: i saw, i told it to creep before
[19:19:28] <creep> but that would require some magical ACDC conversion i think
[19:19:50] <creep> otherwise it would only measure PWM duty
[19:20:13] <tomatto> how can i compile C code with some assember?
[19:20:15] <Horologium> would be interesting to look through the code for it.
[19:20:33] <Horologium> tomatto, have you looked at the inline assembly section of the avr-libc manual?
[19:20:37] <creep> tomatto<< i'd go for inline asm
[19:22:09] <creep> eerm guys, pin4 is connected to +5V on sch
[19:22:31] <creep> pin3 has the "60MHz magic"
[19:22:36] <tomatto> i don't see any gcc option to allow asm in C code
[19:23:33] <creep> [004902] <Tom_itx> http://www.nongnu.org/avr-libc/user-manual/inline_asm.html
[19:27:01] <Horologium> http://www.nongnu.org/avr-libc/user-manual/inline_asm.html
[19:27:18] <creep> :)
[19:27:36] <tomatto> there is not something like avr-gcc parameter
[19:27:59] <creep> he?
[19:28:13] <tomatto> i only need to use ISR_ALIAS
[19:28:22] <tomatto> but gcc told me
[19:28:37] <tomatto> error: 'asm' undeclared (first use in this function)
[19:28:47] <tomatto> and error: expected ';' before 'volatile'
[19:32:06] <creep> Horologium<< what do you think, should i allow the piezo to flyback and limit voltage using a TVS diode?
[19:32:18] <Horologium> ummm..
[19:32:21] <Horologium> no clue.
[19:32:27] <creep> was thinking about a simple N-FET piezo driver
[19:32:34] <Horologium> tomatto, without seeing the code, no clue.
[19:32:37] <creep> and a coil to V+
[19:35:22] <creep> (only to make annoying alarm sound)
[19:37:41] <Horologium> still no clue...but, brain is sub-functional at the moment.
[19:40:33] <tomatto> ISR_ALIAS(ANA_COMP_vect, TIMER0_OVF_vect);
[19:45:16] <tomatto> Horologium: ^^^
[19:45:29] <Horologium> umm.ok
[19:46:16] <tomatto> btw. $0B in assembler is 0x0B right?
[19:51:04] <Tom_itx> bugger
[19:51:09] <Horologium> oh, by the way, think I figured out how they are doing that frequency counter....that pin3 is the T0CKI or Timer 0 ClocK Input...they are dividing the incoming signal by 256 or thereabouts using the timer to generate interrupts I bet.
[19:51:17] <Tom_itx> i thought some older lcd's you could ground RW
[19:51:31] <Tom_itx> these require it wired to a pin so i find out
[19:52:01] <Horologium> there is also a prescaler that can be used to cut it down even more.
[19:52:42] <Horologium> Tom_itx, if you are only writing to it, yeah, you should be able to just pull it low because it is R/W...Read High, Write Low.
[19:53:09] <Horologium> if you intend to read anything, including status, then you need to be able to toggle it.
[19:54:34] <Tom_itx> well it wouldn't work until i hooked it up
[19:55:31] <Horologium> if your code relies on reading any kind of status then, yeah.
[19:55:59] <Horologium> if the code just plays dumb and implements longish delays to give it time to update and come back to ready state then it shouldn't need that.
[19:56:11] <Horologium> so, guessing the code is written "correctly"
[19:58:05] <Tom_itx> it's fleury's lib
[20:03:43] <Horologium> what mode you running it in?
[20:08:36] <blocky> Tom_itx i bought an isp programmer from you, a few years ago
[20:09:48] <blocky> finally used it this week
[20:12:52] <Horologium> Tom_itx, lcd_waitbusy() routine uses the read function...so, yeah, it needs the r/w line.
[20:14:49] <Horologium> wish I could find that guy's lcd lib that used delays instead. he had a port of it that used a pcf8574 as an interface chip so you just used the twi interface to write to the LCD.
[20:19:40] <Horologium> Tom_itx, http://www.electronics-base.com/index.php/projects/complete-projects/110-avr-2x16-character-lcd-diplay-universal-code-library not the one I was looking for but a simple delay based no r/w needed hd4470 lcd library.
[20:22:18] <tomatto> when i set TIMER1 as CTC and OCR1A=0xff; it stops responding from attiny2313
[20:27:29] <Horologium> Tom_itx, I was slightly mistaken...in 4 bit mode you need the R/W line to initiate 4 bit mode.
[20:27:41] <Horologium> if you run full 8 bit mode and use delays it is not needed...
[20:27:46] <Horologium> that is why it doesn't respond for you.
[20:30:13] <tomatto> i wanted to do 8bit from 16bit t/c 1
[20:30:39] <Horologium> that doesn't quite look right either...there must be another way to enter 4 bit mode..
[20:30:53] <Horologium> odd.
[20:31:03] <Horologium> tomatto, no clue...haven't played with that feature myself.
[20:31:35] <Tom_itx> that was probably it.
[20:31:40] <Tom_itx> the 4bit mode
[20:32:21] <Horologium> but fleury's lib definitely needs it.
[20:32:35] <Horologium> I'm seeing some with and some without, with different methods of entering 4bit mode.
[20:34:20] <tomatto> 4bit mode? i want 8bit mode
[20:35:33] <Tom_itx> what for?
[20:35:57] <Horologium> tomatto, wasn't talking about your problem....two different things.
[20:36:20] <tomatto> sorry
[20:36:30] <tomatto> :(
[20:36:30] <Horologium> was talking about Tom_itx problem with LCD display.
[20:36:35] <Horologium> as for your timer problem, no clue dude.
[20:37:01] <Horologium> http://www.bipom.com/documents/appnotes/LCD%20Interfacing%20using%20HD44780%20Hitachi%20chipset%20compatible%20LCD.pdf
[20:37:07] <Horologium> interesting little quickie pdf
[20:37:49] <Horologium> and, bedtime here.
[21:26:25] <blocky> anybody able to tell me what I'm doing wrong http://pastebin.com/kkwSY1ny
[21:32:16] <tomatto> blocky: try to increase that 25ms
[21:34:19] <tomatto> and i am not really sure if TIM0 is correct or TIMER0 must be used.
[21:42:04] <iSaleK> Quick question, on LM350T the formula is Vout=1.25*V(1+R2/R1) What is the V?
[21:42:05] <iSaleK> I guess it's not Vin :)
[21:51:10] <blocky> tomatto timer0 was it, thanks very much
[21:52:01] <tomatto> iSaleK: it is not 1.25*V but 1.25V like Voltage :)
[21:52:27] <iSaleK> Oh, I see... thank you :)
[22:04:44] <blocky> on an attiny, is the timer an 8 bit or 16 bit
[22:06:18] <seldon> which attiny?
[22:07:00] <blocky> attiny2313
[22:07:14] <seldon> One of each.
[22:08:28] <blocky> im playing with dimming an LED, I've got a timer interrupt firing at what I believe is 12.5 khz and i can make it dimmer by doing a sort of pseudo-PWM by saying if i = 0, on, i = 1 on, i = 2 off and cycling i on each interrupt
[22:08:44] <blocky> but something tells me there is a better way
[22:09:50] <blocky> but something tells me there is a better way
[22:09:55] <blocky> oops
[22:11:28] <seldon> Well, if you can, put the led on a pwm pin. According to the datasheet ( http://www.atmel.com/dyn/resources/prod_documents/doc2543.pdf ), that's PB2 or PD5 for the 8 bit timer and PB3 or PB4 for the 16 bit timer. Then you can put the corresponding timer in pwm mode and handle the whole thing in hardware.
[22:12:59] <seldon> If that's not an option, use two interrupts on one timer (OVF and COMPA, say), switch off in the OVF ISR, on in the COMPA ISR, then dim by moving COMPA around.
[22:13:07] <seldon> *OCfooA
[22:13:32] <blocky> i was thinking of just comparing the timer to a value, and setting on if timer > value
[22:13:40] <blocky> but it doesn't seem to be working
[22:14:05] <seldon> You'd have to poll that all the time.
[22:14:08] <blocky> i guess I need to count the interrupts, and use that
[22:14:19] <seldon> Nah, nothing so complicated.
[22:14:52] <blocky> the reason i don't think the pwm will work is because eventually i want to drive a clock display, four 7-segments, which has a total of 12 pins
[22:16:21] <seldon> Hmm...and you want to be able to change the brightness of that in software?
[22:18:45] <seldon> Can you give me a link to the datasheet of the display you plan to use?
[22:22:23] <blocky> well, not the brightness so much as the fact that 28 diodes share 4 cathodes
[22:24:15] <blocky> the datasheet is less than helpful http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Components/LED/1LEDBLUCC.pdf
[22:25:26] <seldon> the circuit diagram is the interesting bit. The thing works similar to a dot matrix.
[22:27:40] <seldon> Let's say you put the one side of the display (pins 11, 7, 4, 2, 1, 10, 5, 3) on PORTB and Pins 12, 9, 8, 6 on PD0 through PD3.
[22:29:07] <seldon> Then if you set PORTB to a bitmask that identifies the segments you want to glow in the leftmost digit, and PORTD to 0b1110.
[22:29:36] <seldon> You leave things that way until the timer comes around, then you set PORTB to a bitmask for the segments you want to glow in the second digit,a nd PORTD to 0b1101
[22:29:45] <blocky> neat
[22:30:18] <seldon> And cycle through the digits. You do that quick enough that the eye is fooled, and that's basically it.
[22:31:40] <seldon> You want to make sure you use sufficient resistors on the PORTB pins, or you'll fry the display and the chip.
[22:32:12] <seldon> Will you use 5V?
[22:32:15] <blocky> yeah
[22:32:26] <blocky> max is 68 mW ?
[22:33:17] <blocky> 500 ohms?
[22:34:25] <seldon> Less. The display eats 3V, so there are 2V over the resistors.
[22:34:42] <seldon> ~200 Ohms
[22:35:24] <seldon> But if I were you, I'd start with 300 Ohms and measure what actually goes through them, to be on the safe side.
[22:36:08] <blocky> sounds good
[22:36:32] <blocky> thanks
[22:36:54] <seldon> You're welcome.
[23:59:38] <seldon> blocky, are you still there?